# Generated by the protocol buffer compiler.  DO NOT EDIT!
# Source: google/devtools/testing/v1/test_execution.proto for package 'google.devtools.testing.v1'
# Original file comments:
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.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/devtools/testing/v1/test_execution_pb'

module Google
  module Devtools
    module Testing
      module V1
        module TestExecutionService
          # A service for requesting test executions and querying their status.
          #
          # This service is part of Firebase Test Lab. To learn about how to use the
          # product, and how to integrate it with your system,
          # visit https://firebase.google.com/docs/test-lab.
          #
          # Each test execution will wait for available capacity. It will then be
          # invoked as described. The test may be invoked multiple times if an
          # infrastructure failure is detected. Results and other files generated by
          # the test will be stored in an external storage system.
          #
          # The TestExecutionService models this behavior using two resource types:
          #
          # - TestMatrix: a group of one or more TestExecutions, built by taking a
          #   product of values over a pre-defined set of axes. In the case of Android
          #   Tests, for example, device model and OS version are two axes of the matrix.
          #
          # - TestExecution: a single execution of one or more test targets on a
          #   single device. These are created automatically when a TestMatrix is
          #   created.
          #
          # This service returns any error codes from the canonical error space (i.e.
          # google.rpc.Code). The errors which may be returned are specified on each
          # method. In addition, any method may return UNAVAILABLE or INTERNAL.
          class Service

            include ::GRPC::GenericService

            self.marshal_class_method = :encode
            self.unmarshal_class_method = :decode
            self.service_name = 'google.devtools.testing.v1.TestExecutionService'

            # Creates and runs a matrix of tests according to the given specifications.
            # Unsupported environments will be returned in the state UNSUPPORTED.
            # A test matrix is limited to use at most 2000 devices in parallel.
            #
            # May return any of the following canonical error codes:
            #
            # - PERMISSION_DENIED - if the user is not authorized to write to project
            # - INVALID_ARGUMENT - if the request is malformed or if the matrix tries
            #                      to use too many simultaneous devices.
            rpc :CreateTestMatrix, ::Google::Devtools::Testing::V1::CreateTestMatrixRequest, ::Google::Devtools::Testing::V1::TestMatrix
            # Checks the status of a test matrix.
            #
            # May return any of the following canonical error codes:
            #
            # - PERMISSION_DENIED - if the user is not authorized to read project
            # - INVALID_ARGUMENT - if the request is malformed
            # - NOT_FOUND - if the Test Matrix does not exist
            rpc :GetTestMatrix, ::Google::Devtools::Testing::V1::GetTestMatrixRequest, ::Google::Devtools::Testing::V1::TestMatrix
            # Cancels unfinished test executions in a test matrix.
            # This call returns immediately and cancellation proceeds asynchronously.
            # If the matrix is already final, this operation will have no effect.
            #
            # May return any of the following canonical error codes:
            #
            # - PERMISSION_DENIED - if the user is not authorized to read project
            # - INVALID_ARGUMENT - if the request is malformed
            # - NOT_FOUND - if the Test Matrix does not exist
            rpc :CancelTestMatrix, ::Google::Devtools::Testing::V1::CancelTestMatrixRequest, ::Google::Devtools::Testing::V1::CancelTestMatrixResponse
          end

          Stub = Service.rpc_stub_class
        end
      end
    end
  end
end
