diff options
Diffstat (limited to 'third_party/googleapis/google/chromeos/uidetection')
4 files changed, 530 insertions, 0 deletions
diff --git a/third_party/googleapis/google/chromeos/uidetection/v1/BUILD.bazel b/third_party/googleapis/google/chromeos/uidetection/v1/BUILD.bazel new file mode 100644 index 0000000..2e8855f --- /dev/null +++ b/third_party/googleapis/google/chromeos/uidetection/v1/BUILD.bazel @@ -0,0 +1,367 @@ +# This file was automatically generated by BuildFileGenerator +# https://github.com/googleapis/rules_gapic/tree/master/bazel + +# Most of the manual changes to this file will be overwritten. +# It's **only** allowed to change the following rule attribute values: +# - names of *_gapic_assembly_* rules +# - certain parameters of *_gapic_library rules, including but not limited to: +#    * extra_protoc_parameters +#    * extra_protoc_file_parameters +# The complete list of preserved parameters can be found in the source code. + +# This is an API workspace, having public visibility by default makes perfect sense. +package(default_visibility = ["//visibility:public"]) + +############################################################################## +# Common +############################################################################## +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info") + +proto_library( +    name = "uidetection_proto", +    srcs = [ +        "ui_detection.proto", +    ], +    deps = [ +        "//google/api:annotations_proto", +        "//google/api:client_proto", +        "//google/api:field_behavior_proto", +    ], +) + +proto_library_with_info( +    name = "uidetection_proto_with_info", +    deps = [ +        ":uidetection_proto", +        "//google/cloud:common_resources_proto", +    ], +) + +############################################################################## +# Java +############################################################################## +load( +    "@com_google_googleapis_imports//:imports.bzl", +    "java_gapic_assembly_gradle_pkg", +    "java_gapic_library", +    "java_gapic_test", +    "java_grpc_library", +    "java_proto_library", +) + +java_proto_library( +    name = "uidetection_java_proto", +    deps = [":uidetection_proto"], +) + +java_grpc_library( +    name = "uidetection_java_grpc", +    srcs = [":uidetection_proto"], +    deps = [":uidetection_java_proto"], +) + +java_gapic_library( +    name = "uidetection_java_gapic", +    srcs = [":uidetection_proto_with_info"], +    gapic_yaml = None, +    grpc_service_config = "ui_detection_grpc_service_config.json", +    service_yaml = "chromeosuidetection_v1.yaml", +    test_deps = [ +        ":uidetection_java_grpc", +    ], +    transport = "grpc+rest", +    deps = [ +        ":uidetection_java_proto", +        "//google/api:api_java_proto", +    ], +) + +java_gapic_test( +    name = "uidetection_java_gapic_test_suite", +    test_classes = [ +        "com.google.chromeos.uidetection.v1.UiDetectionServiceClientHttpJsonTest", +        "com.google.chromeos.uidetection.v1.UiDetectionServiceClientTest", +    ], +    runtime_deps = [":uidetection_java_gapic_test"], +) + +# Open Source Packages +java_gapic_assembly_gradle_pkg( +    name = "google-cloud-chromeos-uidetection-v1-java", +    transport = "grpc+rest", +    deps = [ +        ":uidetection_java_gapic", +        ":uidetection_java_grpc", +        ":uidetection_java_proto", +        ":uidetection_proto", +    ], +) + +############################################################################## +# Go +############################################################################## +load( +    "@com_google_googleapis_imports//:imports.bzl", +    "go_gapic_assembly_pkg", +    "go_gapic_library", +    "go_proto_library", +    "go_test", +) + +go_proto_library( +    name = "uidetection_go_proto", +    compilers = ["@io_bazel_rules_go//proto:go_grpc"], +    importpath = "google.golang.org/genproto/googleapis/chromeos/uidetection/v1", +    protos = [":uidetection_proto"], +    deps = [ +        "//google/api:annotations_go_proto", +    ], +) + +go_gapic_library( +    name = "uidetection_go_gapic", +    srcs = [":uidetection_proto_with_info"], +    grpc_service_config = "ui_detection_grpc_service_config.json", +    importpath = "google.golang.org/google/chromeos/uidetection/v1;uidetection", +    metadata = True, +    service_yaml = "chromeosuidetection_v1.yaml", +    transport = "grpc+rest", +    deps = [ +        ":uidetection_go_proto", +    ], +) + +go_test( +    name = "uidetection_go_gapic_test", +    srcs = [":uidetection_go_gapic_srcjar_test"], +    embed = [":uidetection_go_gapic"], +    importpath = "google.golang.org/google/chromeos/uidetection/v1", +) + +# Open Source Packages +go_gapic_assembly_pkg( +    name = "gapi-cloud-chromeos-uidetection-v1-go", +    deps = [ +        ":uidetection_go_gapic", +        ":uidetection_go_gapic_srcjar-metadata.srcjar", +        ":uidetection_go_gapic_srcjar-test.srcjar", +        ":uidetection_go_proto", +    ], +) + +############################################################################## +# Python +############################################################################## +load( +    "@com_google_googleapis_imports//:imports.bzl", +    "py_gapic_assembly_pkg", +    "py_gapic_library", +    "py_test", +) + +py_gapic_library( +    name = "uidetection_py_gapic", +    srcs = [":uidetection_proto"], +    grpc_service_config = "ui_detection_grpc_service_config.json", +    transport = "grpc", +) + +py_test( +    name = "uidetection_py_gapic_test", +    srcs = [ +        "uidetection_py_gapic_pytest.py", +        "uidetection_py_gapic_test.py", +    ], +    legacy_create_init = False, +    deps = [":uidetection_py_gapic"], +) + +# Open Source Packages +py_gapic_assembly_pkg( +    name = "chromeos-uidetection-v1-py", +    deps = [ +        ":uidetection_py_gapic", +    ], +) + +############################################################################## +# PHP +############################################################################## +load( +    "@com_google_googleapis_imports//:imports.bzl", +    "php_gapic_assembly_pkg", +    "php_gapic_library", +    "php_grpc_library", +    "php_proto_library", +) + +php_proto_library( +    name = "uidetection_php_proto", +    deps = [":uidetection_proto"], +) + +php_grpc_library( +    name = "uidetection_php_grpc", +    srcs = [":uidetection_proto"], +    deps = [":uidetection_php_proto"], +) + +php_gapic_library( +    name = "uidetection_php_gapic", +    srcs = [":uidetection_proto_with_info"], +    grpc_service_config = "ui_detection_grpc_service_config.json", +    service_yaml = "chromeosuidetection_v1.yaml", +    deps = [ +        ":uidetection_php_grpc", +        ":uidetection_php_proto", +    ], +) + +# Open Source Packages +php_gapic_assembly_pkg( +    name = "google-cloud-chromeos-uidetection-v1-php", +    deps = [ +        ":uidetection_php_gapic", +        ":uidetection_php_grpc", +        ":uidetection_php_proto", +    ], +) + +############################################################################## +# Node.js +############################################################################## +load( +    "@com_google_googleapis_imports//:imports.bzl", +    "nodejs_gapic_assembly_pkg", +    "nodejs_gapic_library", +) + +nodejs_gapic_library( +    name = "uidetection_nodejs_gapic", +    package_name = "@google-cloud/uidetection", +    src = ":uidetection_proto_with_info", +    extra_protoc_parameters = ["metadata"], +    grpc_service_config = "ui_detection_grpc_service_config.json", +    package = "google.chromeos.uidetection.v1", +    service_yaml = "chromeosuidetection_v1.yaml", +    deps = [], +) + +nodejs_gapic_assembly_pkg( +    name = "chromeos-uidetection-v1-nodejs", +    deps = [ +        ":uidetection_nodejs_gapic", +        ":uidetection_proto", +    ], +) + +############################################################################## +# Ruby +############################################################################## +load( +    "@com_google_googleapis_imports//:imports.bzl", +    "ruby_cloud_gapic_library", +    "ruby_gapic_assembly_pkg", +    "ruby_grpc_library", +    "ruby_proto_library", +) + +ruby_proto_library( +    name = "uidetection_ruby_proto", +    deps = [":uidetection_proto"], +) + +ruby_grpc_library( +    name = "uidetection_ruby_grpc", +    srcs = [":uidetection_proto"], +    deps = [":uidetection_ruby_proto"], +) + +ruby_cloud_gapic_library( +    name = "uidetection_ruby_gapic", +    srcs = [":uidetection_proto_with_info"], +    extra_protoc_parameters = [ +        "ruby-cloud-gem-name=google-cloud-chromeos-uidetection-v1", +    ], +    grpc_service_config = "ui_detection_grpc_service_config.json", +    deps = [ +        ":uidetection_ruby_grpc", +        ":uidetection_ruby_proto", +    ], +) + +# Open Source Packages +ruby_gapic_assembly_pkg( +    name = "google-cloud-chromeos-uidetection-v1-ruby", +    deps = [ +        ":uidetection_ruby_gapic", +        ":uidetection_ruby_grpc", +        ":uidetection_ruby_proto", +    ], +) + +############################################################################## +# C# +############################################################################## +load( +    "@com_google_googleapis_imports//:imports.bzl", +    "csharp_gapic_assembly_pkg", +    "csharp_gapic_library", +    "csharp_grpc_library", +    "csharp_proto_library", +) + +csharp_proto_library( +    name = "uidetection_csharp_proto", +    deps = [":uidetection_proto"], +) + +csharp_grpc_library( +    name = "uidetection_csharp_grpc", +    srcs = [":uidetection_proto"], +    deps = [":uidetection_csharp_proto"], +) + +csharp_gapic_library( +    name = "uidetection_csharp_gapic", +    srcs = [":uidetection_proto_with_info"], +    common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json", +    grpc_service_config = "ui_detection_grpc_service_config.json", +    service_yaml = "chromeosuidetection_v1.yaml", +    deps = [ +        ":uidetection_csharp_grpc", +        ":uidetection_csharp_proto", +    ], +) + +# Open Source Packages +csharp_gapic_assembly_pkg( +    name = "google-cloud-chromeos-uidetection-v1-csharp", +    deps = [ +        ":uidetection_csharp_gapic", +        ":uidetection_csharp_grpc", +        ":uidetection_csharp_proto", +    ], +) + +############################################################################## +# C++ +############################################################################## +load( +    "@com_google_googleapis_imports//:imports.bzl", +    "cc_grpc_library", +    "cc_proto_library", +) + +cc_proto_library( +    name = "uidetection_cc_proto", +    deps = [":uidetection_proto"], +) + +cc_grpc_library( +    name = "uidetection_cc_grpc", +    srcs = [":uidetection_proto"], +    grpc_only = True, +    deps = [":uidetection_cc_proto"], +) diff --git a/third_party/googleapis/google/chromeos/uidetection/v1/chromeosuidetection_v1.yaml b/third_party/googleapis/google/chromeos/uidetection/v1/chromeosuidetection_v1.yaml new file mode 100644 index 0000000..f6e15a5 --- /dev/null +++ b/third_party/googleapis/google/chromeos/uidetection/v1/chromeosuidetection_v1.yaml @@ -0,0 +1,18 @@ +type: google.api.Service +config_version: 3 +name: chromeosuidetection.googleapis.com +title: ChromeOS UI Detection API + +apis: +- name: google.chromeos.uidetection.v1.UiDetectionService + +documentation: +  summary: |- +    ChromeOS UI Detection API allows image-based UI detection in E2E testing +    frameworks of ChromeOS. It will be used by ChromeOS labs and ChromeOS +    partners. + +backend: +  rules: +  - selector: google.chromeos.uidetection.v1.UiDetectionService.ExecuteDetection +    deadline: 30.0 diff --git a/third_party/googleapis/google/chromeos/uidetection/v1/ui_detection.proto b/third_party/googleapis/google/chromeos/uidetection/v1/ui_detection.proto new file mode 100644 index 0000000..e1f593f --- /dev/null +++ b/third_party/googleapis/google/chromeos/uidetection/v1/ui_detection.proto @@ -0,0 +1,132 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +syntax = "proto3"; + +package google.chromeos.uidetection.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option go_package = "google.golang.org/genproto/googleapis/chromeos/uidetection/v1;uidetection"; +option java_multiple_files = true; +option java_outer_classname = "UiDetectionProto"; +option java_package = "com.google.chromeos.uidetection.v1"; + +// Provides image-based UI detection service. +service UiDetectionService { +  option (google.api.default_host) = "chromeosuidetection.googleapis.com"; + +  // Runs the detection. +  rpc ExecuteDetection(UiDetectionRequest) returns (UiDetectionResponse) { +    option (google.api.http) = { +      get: "/v1/executeDetection:execute" +    }; +  } +} + +// Request message for UI detection. +message UiDetectionRequest { +  // Required. Required field that represents a PNG image. +  bytes image_png = 1 [(google.api.field_behavior) = REQUIRED]; + +  // Required. Required field that indicates the detection type. +  DetectionRequest request = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Detection type specifies what to detect in the image. +message DetectionRequest { +  oneof detection_request_type { +    // Detection type for word detection. +    WordDetectionRequest word_detection_request = 1; + +    // Detection type for text block detection. +    TextBlockDetectionRequest text_block_detection_request = 2; + +    // Detection type for custom icon detection. +    CustomIconDetectionRequest custom_icon_detection_request = 3; +  } +} + +// Detection type for word detection. +message WordDetectionRequest { +  // Required. The word to locate in the image. +  string word = 1 [(google.api.field_behavior) = REQUIRED]; + +  // Indicating whether the query string is a regex or not. +  bool regex_mode = 2; + +  // Indicating whether the detection is an approximate match. +  bool disable_approx_match = 3; + +  // Levenshtein distance threshold. +  // Applicable only if regex_mode is False. +  optional int32 max_edit_distance = 4; +} + +// Detection type for text block detection. +message TextBlockDetectionRequest { +  // Required. The text block consisting a list of words to locate in the image. +  repeated string words = 1 [(google.api.field_behavior) = REQUIRED]; + +  // Indicating whether the query string is a regex or not. +  bool regex_mode = 2; + +  // Indicating whether the detection is an approximate match. +  bool disable_approx_match = 3; + +  // Levenshtein distance threshold. +  // Applicable only if regex_mode is False. +  optional int32 max_edit_distance = 4; +} + +// Detection type for custom icon detection. +message CustomIconDetectionRequest { +  // Required. Required field that represents an icon in PNG format. +  bytes icon_png = 1 [(google.api.field_behavior) = REQUIRED]; + +  // Set match_count to -1 to not limit the number of matches. +  int32 match_count = 2; + +  // Confidence threshold in the range [0.0, 1.0] below which the matches will +  // be considered as non-existent. +  double min_confidence_threshold = 3; +} + +// Response message for UI detection. +message UiDetectionResponse { +  // Locations of matching UI elements. +  repeated BoundingBox bounding_boxes = 1; +} + +// The location of a UI element. +// A bounding box is reprensented by its top-left point [left, top] +// and its bottom-right point [right, bottom]. +message BoundingBox { +  // The text found in the bounding box. +  string text = 1; + +  // The y-coordinate of the top-left point. +  int32 top = 2; + +  // The x-coordinate of the top-left point. +  int32 left = 3; + +  // The y-coordinate of the bottom-right point. +  int32 bottom = 4; + +  // The x-coordinate of the bottom-right point. +  int32 right = 5; +} diff --git a/third_party/googleapis/google/chromeos/uidetection/v1/ui_detection_grpc_service_config.json b/third_party/googleapis/google/chromeos/uidetection/v1/ui_detection_grpc_service_config.json new file mode 100644 index 0000000..7632a3f --- /dev/null +++ b/third_party/googleapis/google/chromeos/uidetection/v1/ui_detection_grpc_service_config.json @@ -0,0 +1,13 @@ +{ +  "methodConfig": [{ +    "name": [{ "service": "google.chromeos.uidetection.v1.UiDetectionService", "method": "ExecuteDetection" }], +    "timeout": "60s", +    "retryPolicy": { +      "maxAttempts": 5, +      "initialBackoff": "1s", +      "maxBackoff": "10s", +      "backoffMultiplier": 1.3, +      "retryableStatusCodes": ["UNAVAILABLE"] +    } +  }] +}  | 
