From 4179348c037ec9cfbe5b33263f97e4b65e16e7dc Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 6 Feb 2026 02:05:11 +0000 Subject: [PATCH 1/2] fix!: An existing default host `visionai.googleapis.com` is changed to `warehouse-visionai.googleapis.com` in service `Warehouse` docs: A comment for field `page_size` in message `.google.cloud.visionai.v1.SearchIndexEndpointRequest` is changed docs: A comment for field `relevance` in message `.google.cloud.visionai.v1.SearchResultItem` is changed PiperOrigin-RevId: 866154811 Source-Link: https://github.com/googleapis/googleapis/commit/fe4d9b3bcaae6282d1d6ee57a42fed53b334931b Source-Link: https://github.com/googleapis/googleapis-gen/commit/f35da8b91dd3a36e85966ec0431fc87a42c7bdf6 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXZpc2lvbl9haS12MS8uT3dsQm90LnlhbWwiLCJoIjoiZjM1ZGE4YjkxZGQzYTM2ZTg1OTY2ZWMwNDMxZmM4N2E0MmM3YmRmNiJ9 --- .../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 | 11 + .../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 | 90 + .../lib/google/cloud/visionai/v1/common_pb.rb | 50 + .../cloud/visionai/v1/health_service_pb.rb | 48 + .../visionai/v1/health_service_services_pb.rb | 46 + .../lib/google/cloud/visionai/v1/lva_pb.rb | 54 + .../cloud/visionai/v1/lva_resources_pb.rb | 51 + .../cloud/visionai/v1/lva_service_pb.rb | 80 + .../visionai/v1/lva_service_services_pb.rb | 81 + .../google/cloud/visionai/v1/platform_pb.rb | 162 + .../cloud/visionai/v1/platform_services_pb.rb | 111 + .../visionai/v1/streaming_resources_pb.rb | 58 + .../cloud/visionai/v1/streaming_service_pb.rb | 71 + .../v1/streaming_service_services_pb.rb | 55 + .../cloud/visionai/v1/streams_resources_pb.rb | 53 + .../cloud/visionai/v1/streams_service_pb.rb | 85 + .../v1/streams_service_services_pb.rb | 92 + .../google/cloud/visionai/v1/warehouse_pb.rb | 251 + .../visionai/v1/warehouse_services_pb.rb | 228 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../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 | 103 + .../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 | 25 + 275 files changed, 97323 insertions(+) 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 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..dfc3c8fa5283 --- /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.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "google-iam-v1", "~> 1.3" +end diff --git a/owl-bot-staging/google-cloud-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..6dd517f598a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/annotations_pb.rb @@ -0,0 +1,90 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.ListValue", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..a03cf56fff36 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/common_pb.rb @@ -0,0 +1,50 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..eb43514da251 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_pb.rb @@ -0,0 +1,48 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..4cf8696b4289 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_pb.rb @@ -0,0 +1,54 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..076a03d9e765 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_resources_pb.rb @@ -0,0 +1,51 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.visionai.v1.OperatorDefinition", "google/cloud/visionai/v1/lva.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..90d14010eddc --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_pb.rb @@ -0,0 +1,80 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.visionai.v1.Operator", "google/cloud/visionai/v1/lva_resources.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..0e64573ddccd --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_pb.rb @@ -0,0 +1,162 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..4b63f572c8b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_pb.rb @@ -0,0 +1,85 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.cloud.visionai.v1.OperationMetadata", "google/cloud/visionai/v1/common.proto"], + ["google.protobuf.Any", "google/protobuf/any.proto"], + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.type.DateTime", "google/type/datetime.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..d15ba7af54e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/datetime.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! + + +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 is 0, the DateTime is considered not to have a specific year. month + # and day must have valid, non-zero values. + # + # 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] + # Required. Month of year. Must be from 1 to 12. + # @!attribute [rw] day + # @return [::Integer] + # Required. Day of month. Must be from 1 to 31 and valid for the year and + # month. + # @!attribute [rw] hours + # @return [::Integer] + # Required. Hours of day in 24 hour format. Should be from 0 to 23. An API + # may choose to allow the value "24:00:00" for scenarios like business + # closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Required. Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Required. Seconds of minutes of the time. Must normally be from 0 to 59. An + # API may allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Required. Fractions of seconds in nanoseconds. Must be from 0 to + # 999,999,999. + # @!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, e.g. "America/New_York". + # @!attribute [rw] version + # @return [::String] + # Optional. IANA Time Zone Database version number, e.g. "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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 2ebe16be9d6171f1bfdaf678b53127cc5f9c1408 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 6 Feb 2026 02:08:20 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../.owlbot-manifest.json | 1 + .../cloud/vision_ai/v1/app_platform/rest.rb | 1 + .../vision_ai/v1/app_platform/rest/client.rb | 8 + .../cloud/vision_ai/v1/bindings_override.rb | 0 .../vision_ai/v1/health_check_service/rest.rb | 1 + .../v1/health_check_service/rest/client.rb | 8 + .../vision_ai/v1/live_video_analytics/rest.rb | 1 + .../v1/live_video_analytics/rest/client.rb | 8 + .../lib/google/cloud/vision_ai/v1/rest.rb | 1 + .../vision_ai/v1/streaming_service/rest.rb | 1 + .../v1/streaming_service/rest/client.rb | 8 + .../vision_ai/v1/streams_service/rest.rb | 1 + .../v1/streams_service/rest/client.rb | 8 + .../cloud/vision_ai/v1/warehouse/client.rb | 6 +- .../vision_ai/v1/warehouse/operations.rb | 4 +- .../cloud/vision_ai/v1/warehouse/rest.rb | 1 + .../vision_ai/v1/warehouse/rest/client.rb | 14 +- .../vision_ai/v1/warehouse/rest/operations.rb | 4 +- .../google/cloud/visionai/v1/warehouse_pb.rb | 2 +- .../google/cloud/visionai/v1/warehouse.rb | 6 +- .../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 | 11 - .../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 ---- .../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 | 90 - .../lib/google/cloud/visionai/v1/common_pb.rb | 50 - .../cloud/visionai/v1/health_service_pb.rb | 48 - .../visionai/v1/health_service_services_pb.rb | 46 - .../lib/google/cloud/visionai/v1/lva_pb.rb | 54 - .../cloud/visionai/v1/lva_resources_pb.rb | 51 - .../cloud/visionai/v1/lva_service_pb.rb | 80 - .../visionai/v1/lva_service_services_pb.rb | 81 - .../google/cloud/visionai/v1/platform_pb.rb | 162 - .../cloud/visionai/v1/platform_services_pb.rb | 111 - .../visionai/v1/streaming_resources_pb.rb | 58 - .../cloud/visionai/v1/streaming_service_pb.rb | 71 - .../v1/streaming_service_services_pb.rb | 55 - .../cloud/visionai/v1/streams_resources_pb.rb | 53 - .../cloud/visionai/v1/streams_service_pb.rb | 85 - .../v1/streams_service_services_pb.rb | 92 - .../google/cloud/visionai/v1/warehouse_pb.rb | 251 - .../visionai/v1/warehouse_services_pb.rb | 228 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../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 | 103 - .../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 | 25 - 294 files changed, 70 insertions(+), 97262 deletions(-) rename {owl-bot-staging/google-cloud-vision_ai-v1 => google-cloud-vision_ai-v1}/lib/google/cloud/vision_ai/v1/bindings_override.rb (100%) 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/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 diff --git a/google-cloud-vision_ai-v1/.owlbot-manifest.json b/google-cloud-vision_ai-v1/.owlbot-manifest.json index 7eca16c30c27..7f0f413b9a45 100644 --- a/google-cloud-vision_ai-v1/.owlbot-manifest.json +++ b/google-cloud-vision_ai-v1/.owlbot-manifest.json @@ -24,6 +24,7 @@ "lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb", "lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb", "lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb", + "lib/google/cloud/vision_ai/v1/bindings_override.rb", "lib/google/cloud/vision_ai/v1/health_check_service.rb", "lib/google/cloud/vision_ai/v1/health_check_service/client.rb", "lib/google/cloud/vision_ai/v1/health_check_service/credentials.rb", diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.rb index 85d8d060c916..36ff55d150d8 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.rb @@ -21,6 +21,7 @@ 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" diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb index ade5e1986057..1bae5e021921 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb @@ -178,6 +178,7 @@ def initialize 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 @@ -2902,6 +2903,13 @@ class Configuration 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 diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.rb similarity index 100% rename from owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.rb rename to google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.rb diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb index 00b14f8b6068..fe41618312a6 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb @@ -21,6 +21,7 @@ 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" diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb index b4ca9a860695..45dd2821a67c 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb @@ -172,6 +172,7 @@ def initialize 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 @@ -394,6 +395,13 @@ class Configuration 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 diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb index 2e0ee0851cf3..6c8a26706de2 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb @@ -21,6 +21,7 @@ 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" diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb index 2eced10100cd..b09392940996 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb @@ -204,6 +204,7 @@ def initialize 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 @@ -2072,6 +2073,13 @@ class Configuration 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 diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb index 5028fe757ab4..05c22f7dee23 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb @@ -22,6 +22,7 @@ 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 diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb index 518b20543221..b2202b0edafa 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb @@ -21,6 +21,7 @@ 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" diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb index 9d938858f54b..6a70b8d42f90 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb @@ -171,6 +171,7 @@ def initialize 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 @@ -565,6 +566,13 @@ class Configuration 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 diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest.rb index 8a13dca567c7..9c5a824d1ca3 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest.rb @@ -21,6 +21,7 @@ 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" diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb index 3f965a368b18..c5234f8e09a6 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb @@ -181,6 +181,7 @@ def initialize 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 @@ -2557,6 +2558,13 @@ class Configuration 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 diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb index 9224ee99216e..a3702baf2aac 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb @@ -36,7 +36,7 @@ class Client API_VERSION = "" # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" include Paths @@ -4820,7 +4820,7 @@ def search_assets request, options = nil # 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 100. + # 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. @@ -6460,7 +6460,7 @@ class Configuration # @private # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "visionai.googleapis.com" + DEFAULT_ENDPOINT = "warehouse-visionai.googleapis.com" config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/operations.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/operations.rb index 67b0c4ad1fde..365f2245f8f7 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/operations.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/operations.rb @@ -30,7 +30,7 @@ class Operations API_VERSION = "" # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" # @private attr_reader :operations_stub @@ -725,7 +725,7 @@ class Configuration # @private # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "visionai.googleapis.com" + DEFAULT_ENDPOINT = "warehouse-visionai.googleapis.com" config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.rb index a972693b0a26..87c67f033791 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.rb @@ -21,6 +21,7 @@ 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" diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb index 177877bcb45d..2c72a2f09d02 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb @@ -38,7 +38,7 @@ class Client API_VERSION = "" # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" include Paths @@ -203,6 +203,7 @@ def initialize 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 @@ -4405,7 +4406,7 @@ def search_assets request, options = nil # 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 100. + # 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. @@ -5907,7 +5908,7 @@ class Configuration # @private # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "visionai.googleapis.com" + DEFAULT_ENDPOINT = "warehouse-visionai.googleapis.com" config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| @@ -5922,6 +5923,13 @@ class Configuration 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 diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb index 87e222cb8f61..3c7b2eaca6a2 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb @@ -30,7 +30,7 @@ class Operations API_VERSION = "" # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" # @private attr_reader :operations_stub @@ -563,7 +563,7 @@ class Configuration # @private # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "visionai.googleapis.com" + DEFAULT_ENDPOINT = "warehouse-visionai.googleapis.com" config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| diff --git a/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_pb.rb b/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_pb.rb index 71fb50d05c56..30dc8ade2fb8 100644 --- a/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_pb.rb +++ b/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_pb.rb @@ -20,7 +20,7 @@ require 'google/type/datetime_pb' -descriptor_data = "\n(google/cloud/visionai/v1/warehouse.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/longrunning/operations.proto\x1a\x19google/protobuf/any.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\x1a\x17google/rpc/status.proto\x1a\x1agoogle/type/datetime.proto\"\xaa\x01\n\x12\x43reateAssetRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12\x33\n\x05\x61sset\x18\x02 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.AssetB\x03\xe0\x41\x02\x12\x1a\n\x08\x61sset_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0b\n\t_asset_id\"F\n\x0fGetAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\"\x81\x01\n\x11ListAssetsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\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\x05 \x01(\t\"^\n\x12ListAssetsResponse\x12/\n\x06\x61ssets\x18\x01 \x03(\x0b\x32\x1f.google.cloud.visionai.v1.Asset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"z\n\x12UpdateAssetRequest\x12\x33\n\x05\x61sset\x18\x01 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.AssetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"I\n\x12\x44\x65leteAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\"\x97\x02\n\x0b\x41ssetSource\x12P\n\x10\x61sset_gcs_source\x18\x01 \x01(\x0b\x32\x34.google.cloud.visionai.v1.AssetSource.AssetGcsSourceH\x00\x12T\n\x12\x61sset_content_data\x18\x02 \x01(\x0b\x32\x36.google.cloud.visionai.v1.AssetSource.AssetContentDataH\x00\x1a!\n\x0e\x41ssetGcsSource\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x1a.\n\x10\x41ssetContentData\x12\x1a\n\x12\x61sset_content_data\x18\x01 \x01(\x0c\x42\r\n\x0bsource_form\"\x86\x01\n\x12UploadAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12;\n\x0c\x61sset_source\x18\x02 \x01(\x0b\x32%.google.cloud.visionai.v1.AssetSource\"\x15\n\x13UploadAssetResponse\"v\n\x13UploadAssetMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"R\n\x1bGenerateRetrievalUrlRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\"2\n\x1cGenerateRetrievalUrlResponse\x12\x12\n\nsigned_uri\x18\x01 \x01(\t\"\x86\x02\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12&\n\x03ttl\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12S\n\x10\x61sset_gcs_source\x18\x04 \x01(\x0b\x32\x34.google.cloud.visionai.v1.AssetSource.AssetGcsSourceB\x03\xe0\x41\x03:r\xea\x41o\n\x1dvisionai.googleapis.com/Asset\x12Nprojects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}\"J\n\x13\x41nalyzeAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\"\xe1\x03\n\x14\x41nalyzeAssetMetadata\x12V\n\x0f\x61nalysis_status\x18\x01 \x03(\x0b\x32=.google.cloud.visionai.v1.AnalyzeAssetMetadata.AnalysisStatus\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x8f\x02\n\x0e\x41nalysisStatus\x12R\n\x05state\x18\x02 \x01(\x0e\x32\x43.google.cloud.visionai.v1.AnalyzeAssetMetadata.AnalysisStatus.State\x12\x16\n\x0estatus_message\x18\x03 \x01(\t\x12\x45\n\x11search_capability\x18\x04 \x01(\x0b\x32*.google.cloud.visionai.v1.SearchCapability\"J\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"\x16\n\x14\x41nalyzeAssetResponse\"\xb8\x01\n\x0eIndexingStatus\x12\x42\n\x05state\x18\x02 \x01(\x0e\x32..google.cloud.visionai.v1.IndexingStatus.StateB\x03\xe0\x41\x03\x12\x16\n\x0estatus_message\x18\x03 \x01(\t\"J\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"~\n\x11IndexAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12\x34\n\x05index\x18\x02 \x01(\tB%\xe0\x41\x01\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"\xaf\x01\n\x12IndexAssetMetadata\x12\x38\n\x06status\x18\x04 \x01(\x0b\x32(.google.cloud.visionai.v1.IndexingStatus\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x14\n\x12IndexAssetResponse\"\x84\x01\n\x17RemoveIndexAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12\x34\n\x05index\x18\x02 \x01(\tB%\xe0\x41\x01\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"\xbe\x01\n\x18RemoveIndexAssetMetadata\x12\x41\n\x0findexing_status\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.IndexingStatus\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x1a\n\x18RemoveIndexAssetResponse\"\xe6\x01\n\x0cIndexedAsset\x12\x34\n\x05index\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\x12\x34\n\x05\x61sset\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\x87\x01\n\x18ViewIndexedAssetsRequest\x12\x34\n\x05index\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\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\"t\n\x19ViewIndexedAssetsResponse\x12>\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\x91\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\x1aK\xca\x41\x17visionai.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" +descriptor_data = "\n(google/cloud/visionai/v1/warehouse.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/longrunning/operations.proto\x1a\x19google/protobuf/any.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\x1a\x17google/rpc/status.proto\x1a\x1agoogle/type/datetime.proto\"\xaa\x01\n\x12\x43reateAssetRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12\x33\n\x05\x61sset\x18\x02 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.AssetB\x03\xe0\x41\x02\x12\x1a\n\x08\x61sset_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0b\n\t_asset_id\"F\n\x0fGetAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\"\x81\x01\n\x11ListAssetsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\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\x05 \x01(\t\"^\n\x12ListAssetsResponse\x12/\n\x06\x61ssets\x18\x01 \x03(\x0b\x32\x1f.google.cloud.visionai.v1.Asset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"z\n\x12UpdateAssetRequest\x12\x33\n\x05\x61sset\x18\x01 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.AssetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"I\n\x12\x44\x65leteAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\"\x97\x02\n\x0b\x41ssetSource\x12P\n\x10\x61sset_gcs_source\x18\x01 \x01(\x0b\x32\x34.google.cloud.visionai.v1.AssetSource.AssetGcsSourceH\x00\x12T\n\x12\x61sset_content_data\x18\x02 \x01(\x0b\x32\x36.google.cloud.visionai.v1.AssetSource.AssetContentDataH\x00\x1a!\n\x0e\x41ssetGcsSource\x12\x0f\n\x07gcs_uri\x18\x01 \x01(\t\x1a.\n\x10\x41ssetContentData\x12\x1a\n\x12\x61sset_content_data\x18\x01 \x01(\x0c\x42\r\n\x0bsource_form\"\x86\x01\n\x12UploadAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12;\n\x0c\x61sset_source\x18\x02 \x01(\x0b\x32%.google.cloud.visionai.v1.AssetSource\"\x15\n\x13UploadAssetResponse\"v\n\x13UploadAssetMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"R\n\x1bGenerateRetrievalUrlRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\"2\n\x1cGenerateRetrievalUrlResponse\x12\x12\n\nsigned_uri\x18\x01 \x01(\t\"\x86\x02\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12&\n\x03ttl\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12S\n\x10\x61sset_gcs_source\x18\x04 \x01(\x0b\x32\x34.google.cloud.visionai.v1.AssetSource.AssetGcsSourceB\x03\xe0\x41\x03:r\xea\x41o\n\x1dvisionai.googleapis.com/Asset\x12Nprojects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}\"J\n\x13\x41nalyzeAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\"\xe1\x03\n\x14\x41nalyzeAssetMetadata\x12V\n\x0f\x61nalysis_status\x18\x01 \x03(\x0b\x32=.google.cloud.visionai.v1.AnalyzeAssetMetadata.AnalysisStatus\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x8f\x02\n\x0e\x41nalysisStatus\x12R\n\x05state\x18\x02 \x01(\x0e\x32\x43.google.cloud.visionai.v1.AnalyzeAssetMetadata.AnalysisStatus.State\x12\x16\n\x0estatus_message\x18\x03 \x01(\t\x12\x45\n\x11search_capability\x18\x04 \x01(\x0b\x32*.google.cloud.visionai.v1.SearchCapability\"J\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"\x16\n\x14\x41nalyzeAssetResponse\"\xb8\x01\n\x0eIndexingStatus\x12\x42\n\x05state\x18\x02 \x01(\x0e\x32..google.cloud.visionai.v1.IndexingStatus.StateB\x03\xe0\x41\x03\x12\x16\n\x0estatus_message\x18\x03 \x01(\t\"J\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"~\n\x11IndexAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12\x34\n\x05index\x18\x02 \x01(\tB%\xe0\x41\x01\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"\xaf\x01\n\x12IndexAssetMetadata\x12\x38\n\x06status\x18\x04 \x01(\x0b\x32(.google.cloud.visionai.v1.IndexingStatus\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x14\n\x12IndexAssetResponse\"\x84\x01\n\x17RemoveIndexAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12\x34\n\x05index\x18\x02 \x01(\tB%\xe0\x41\x01\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"\xbe\x01\n\x18RemoveIndexAssetMetadata\x12\x41\n\x0findexing_status\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.IndexingStatus\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x1a\n\x18RemoveIndexAssetResponse\"\xe6\x01\n\x0cIndexedAsset\x12\x34\n\x05index\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\x12\x34\n\x05\x61sset\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\x87\x01\n\x18ViewIndexedAssetsRequest\x12\x34\n\x05index\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\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\"t\n\x19ViewIndexedAssetsResponse\x12>\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 diff --git a/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb b/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb index f0d48fa6304a..9caa0a18c832 100644 --- a/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb +++ b/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb @@ -2723,7 +2723,7 @@ class SearchAssetsRequest # 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 100. + # 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 @@ -2839,8 +2839,8 @@ class AnnotationMatchingResult # 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. + # 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 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 dfc3c8fa5283..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.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "google-iam-v1", "~> 1.3" -end diff --git a/owl-bot-staging/google-cloud-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/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 6dd517f598a8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/annotations_pb.rb +++ /dev/null @@ -1,90 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.ListValue", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 a03cf56fff36..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/common_pb.rb +++ /dev/null @@ -1,50 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 eb43514da251..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_pb.rb +++ /dev/null @@ -1,48 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 4cf8696b4289..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_pb.rb +++ /dev/null @@ -1,54 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 076a03d9e765..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_resources_pb.rb +++ /dev/null @@ -1,51 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.visionai.v1.OperatorDefinition", "google/cloud/visionai/v1/lva.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 90d14010eddc..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_pb.rb +++ /dev/null @@ -1,80 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.visionai.v1.Operator", "google/cloud/visionai/v1/lva_resources.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 0e64573ddccd..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_pb.rb +++ /dev/null @@ -1,162 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 4b63f572c8b2..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_pb.rb +++ /dev/null @@ -1,85 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.cloud.visionai.v1.OperationMetadata", "google/cloud/visionai/v1/common.proto"], - ["google.protobuf.Any", "google/protobuf/any.proto"], - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ["google.type.DateTime", "google/type/datetime.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 d15ba7af54e4..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/datetime.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! - - -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 is 0, the DateTime is considered not to have a specific year. month - # and day must have valid, non-zero values. - # - # 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] - # Required. Month of year. Must be from 1 to 12. - # @!attribute [rw] day - # @return [::Integer] - # Required. Day of month. Must be from 1 to 31 and valid for the year and - # month. - # @!attribute [rw] hours - # @return [::Integer] - # Required. Hours of day in 24 hour format. Should be from 0 to 23. An API - # may choose to allow the value "24:00:00" for scenarios like business - # closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Required. Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Required. Seconds of minutes of the time. Must normally be from 0 to 59. An - # API may allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Required. Fractions of seconds in nanoseconds. Must be from 0 to - # 999,999,999. - # @!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, e.g. "America/New_York". - # @!attribute [rw] version - # @return [::String] - # Optional. IANA Time Zone Database version number, e.g. "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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"