//
// Copyright (C) 2024 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.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.

// @generated by protoc-gen-es v2.2.2 with parameter "target=ts"
// @generated from file protos/perfetto/bigtrace/worker.proto (package perfetto.protos, syntax proto3)
/* eslint-disable */

import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1";
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1";
import type { QueryResult } from "../trace_processor/trace_processor_pb";
import { file_protos_perfetto_trace_processor_trace_processor } from "../trace_processor/trace_processor_pb";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/bigtrace/worker.proto.
 */
export const file_protos_perfetto_bigtrace_worker: GenFile = /*@__PURE__*/
  fileDesc("CiVwcm90b3MvcGVyZmV0dG8vYmlndHJhY2Uvd29ya2VyLnByb3RvEg9wZXJmZXR0by5wcm90b3MiXAoWQmlndHJhY2VRdWVyeVRyYWNlQXJncxISCgV0cmFjZRgBIAEoCUgAiAEBEhYKCXNxbF9xdWVyeRgCIAEoCUgBiAEBQggKBl90cmFjZUIMCgpfc3FsX3F1ZXJ5ImgKGkJpZ3RyYWNlUXVlcnlUcmFjZVJlc3BvbnNlEhIKBXRyYWNlGAEgASgJSACIAQESLAoGcmVzdWx0GAIgAygLMhwucGVyZmV0dG8ucHJvdG9zLlF1ZXJ5UmVzdWx0QggKBl90cmFjZTJ0Cg5CaWd0cmFjZVdvcmtlchJiCgpRdWVyeVRyYWNlEicucGVyZmV0dG8ucHJvdG9zLkJpZ3RyYWNlUXVlcnlUcmFjZUFyZ3MaKy5wZXJmZXR0by5wcm90b3MuQmlndHJhY2VRdWVyeVRyYWNlUmVzcG9uc2ViBnByb3RvMw", [file_protos_perfetto_trace_processor_trace_processor]);

/**
 * Request/Response for QueryTrace.
 *
 * @generated from message perfetto.protos.BigtraceQueryTraceArgs
 */
export type BigtraceQueryTraceArgs = Message<"perfetto.protos.BigtraceQueryTraceArgs"> & {
  /**
   * @generated from field: optional string trace = 1;
   */
  trace?: string;

  /**
   * @generated from field: optional string sql_query = 2;
   */
  sqlQuery?: string;
};

/**
 * Describes the message perfetto.protos.BigtraceQueryTraceArgs.
 * Use `create(BigtraceQueryTraceArgsSchema)` to create a new message.
 */
export const BigtraceQueryTraceArgsSchema: GenMessage<BigtraceQueryTraceArgs> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_bigtrace_worker, 0);

/**
 * @generated from message perfetto.protos.BigtraceQueryTraceResponse
 */
export type BigtraceQueryTraceResponse = Message<"perfetto.protos.BigtraceQueryTraceResponse"> & {
  /**
   * @generated from field: optional string trace = 1;
   */
  trace?: string;

  /**
   * @generated from field: repeated perfetto.protos.QueryResult result = 2;
   */
  result: QueryResult[];
};

/**
 * Describes the message perfetto.protos.BigtraceQueryTraceResponse.
 * Use `create(BigtraceQueryTraceResponseSchema)` to create a new message.
 */
export const BigtraceQueryTraceResponseSchema: GenMessage<BigtraceQueryTraceResponse> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_bigtrace_worker, 1);

/**
 * gRPC Interface for a Bigtrace Worker
 *
 * Workers are owned by an "Orchestrator" which forward traces from requests by
 * end users. Workers are responsible for loading the traces with
 * TraceProcessor and executing the requests.
 *
 * @generated from service perfetto.protos.BigtraceWorker
 */
export const BigtraceWorker: GenService<{
  /**
   * Executes a SQL query on the specified trace and returns a stream of
   * execution responses. Note that this method returns a stream because each
   * trace can return >1 result due to chunking of protos at the
   * TraceProcessor::QueryResult level.
   *
   * @generated from rpc perfetto.protos.BigtraceWorker.QueryTrace
   */
  queryTrace: {
    methodKind: "unary";
    input: typeof BigtraceQueryTraceArgsSchema;
    output: typeof BigtraceQueryTraceResponseSchema;
  },
}> = /*@__PURE__*/
  serviceDesc(file_protos_perfetto_bigtrace_worker, 0);

