#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuildStatus {
#[prost(enumeration = "build_status::Result", tag = "1")]
pub result: i32,
#[prost(string, tag = "3")]
pub final_invocation_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub build_tool_exit_code: ::core::option::Option<i32>,
#[prost(message, optional, tag = "2")]
pub details: ::core::option::Option<::prost_types::Any>,
}
pub mod build_status {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Result {
UnknownStatus = 0,
CommandSucceeded = 1,
CommandFailed = 2,
UserError = 3,
SystemError = 4,
ResourceExhausted = 5,
InvocationDeadlineExceeded = 6,
RequestDeadlineExceeded = 8,
Cancelled = 7,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuildEvent {
#[prost(message, optional, tag = "1")]
pub event_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(oneof = "build_event::Event", tags = "51, 52, 53, 55, 56, 59, 60, 61, 62")]
pub event: ::core::option::Option<build_event::Event>,
}
pub mod build_event {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvocationAttemptStarted {
#[prost(int64, tag = "1")]
pub attempt_number: i64,
#[prost(message, optional, tag = "2")]
pub details: ::core::option::Option<::prost_types::Any>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvocationAttemptFinished {
#[prost(message, optional, tag = "3")]
pub invocation_status: ::core::option::Option<super::BuildStatus>,
#[prost(message, optional, tag = "4")]
pub details: ::core::option::Option<::prost_types::Any>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuildEnqueued {
#[prost(message, optional, tag = "1")]
pub details: ::core::option::Option<::prost_types::Any>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuildFinished {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<super::BuildStatus>,
#[prost(message, optional, tag = "2")]
pub details: ::core::option::Option<::prost_types::Any>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsoleOutput {
#[prost(enumeration = "super::ConsoleOutputStream", tag = "1")]
pub r#type: i32,
#[prost(oneof = "console_output::Output", tags = "2, 3")]
pub output: ::core::option::Option<console_output::Output>,
}
pub mod console_output {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Output {
#[prost(string, tag = "2")]
TextOutput(::prost::alloc::string::String),
#[prost(bytes, tag = "3")]
BinaryOutput(::prost::alloc::vec::Vec<u8>),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuildComponentStreamFinished {
#[prost(enumeration = "build_component_stream_finished::FinishType", tag = "1")]
pub r#type: i32,
}
pub mod build_component_stream_finished {
#[derive(
Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration,
)]
#[repr(i32)]
pub enum FinishType {
Unspecified = 0,
Finished = 1,
Expired = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Event {
#[prost(message, tag = "51")]
InvocationAttemptStarted(InvocationAttemptStarted),
#[prost(message, tag = "52")]
InvocationAttemptFinished(InvocationAttemptFinished),
#[prost(message, tag = "53")]
BuildEnqueued(BuildEnqueued),
#[prost(message, tag = "55")]
BuildFinished(BuildFinished),
#[prost(message, tag = "56")]
ConsoleOutput(ConsoleOutput),
#[prost(message, tag = "59")]
ComponentStreamFinished(BuildComponentStreamFinished),
#[prost(message, tag = "60")]
BazelEvent(::prost_types::Any),
#[prost(message, tag = "61")]
BuildExecutionEvent(::prost_types::Any),
#[prost(message, tag = "62")]
SourceFetchEvent(::prost_types::Any),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamId {
#[prost(string, tag = "1")]
pub build_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub invocation_id: ::prost::alloc::string::String,
#[prost(enumeration = "stream_id::BuildComponent", tag = "3")]
pub component: i32,
}
pub mod stream_id {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BuildComponent {
UnknownComponent = 0,
Controller = 1,
Worker = 2,
Tool = 3,
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ConsoleOutputStream {
Unknown = 0,
Stdout = 1,
Stderr = 2,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PublishLifecycleEventRequest {
#[prost(enumeration = "publish_lifecycle_event_request::ServiceLevel", tag = "1")]
pub service_level: i32,
#[prost(message, optional, tag = "2")]
pub build_event: ::core::option::Option<OrderedBuildEvent>,
#[prost(message, optional, tag = "3")]
pub stream_timeout: ::core::option::Option<::prost_types::Duration>,
#[prost(string, repeated, tag = "4")]
pub notification_keywords: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "6")]
pub project_id: ::prost::alloc::string::String,
}
pub mod publish_lifecycle_event_request {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ServiceLevel {
Noninteractive = 0,
Interactive = 1,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PublishBuildToolEventStreamResponse {
#[prost(message, optional, tag = "1")]
pub stream_id: ::core::option::Option<StreamId>,
#[prost(int64, tag = "2")]
pub sequence_number: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderedBuildEvent {
#[prost(message, optional, tag = "1")]
pub stream_id: ::core::option::Option<StreamId>,
#[prost(int64, tag = "2")]
pub sequence_number: i64,
#[prost(message, optional, tag = "3")]
pub event: ::core::option::Option<BuildEvent>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PublishBuildToolEventStreamRequest {
#[prost(message, optional, tag = "4")]
pub ordered_build_event: ::core::option::Option<OrderedBuildEvent>,
#[prost(string, repeated, tag = "5")]
pub notification_keywords: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "6")]
pub project_id: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod publish_build_event_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " A service for publishing BuildEvents. BuildEvents are generated by Build"]
#[doc = " Systems to record actions taken during a Build. Events occur in streams,"]
#[doc = " are identified by a StreamId, and ordered by sequence number in a stream."]
#[doc = ""]
#[doc = " A Build may contain several streams of BuildEvents, depending on the systems"]
#[doc = " that are involved in the Build. Some BuildEvents are used to declare the"]
#[doc = " beginning and end of major portions of a Build; these are called"]
#[doc = " LifecycleEvents, and are used (for example) to indicate the beginning or end"]
#[doc = " of a Build, and the beginning or end of an Invocation attempt (there can be"]
#[doc = " more than 1 Invocation in a Build if, for example, a failure occurs somewhere"]
#[doc = " and it needs to be retried)."]
#[doc = ""]
#[doc = " Other, build-tool events represent actions taken by the Build tool, such as"]
#[doc = " target objects produced via compilation, tests run, et cetera. There could be"]
#[doc = " more than one build tool stream for an invocation attempt of a build."]
#[derive(Debug, Clone)]
pub struct PublishBuildEventClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> PublishBuildEventClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> PublishBuildEventClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
{
PublishBuildEventClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Publish a build event stating the new state of a build (typically from the"]
#[doc = " build queue). The BuildEnqueued event must be publishd before all other"]
#[doc = " events for the same build ID."]
#[doc = ""]
#[doc = " The backend will persist the event and deliver it to registered frontend"]
#[doc = " jobs immediately without batching."]
#[doc = ""]
#[doc = " The commit status of the request is reported by the RPC's util_status()"]
#[doc = " function. The error code is the canoncial error code defined in"]
#[doc = " //util/task/codes.proto."]
pub async fn publish_lifecycle_event(
&mut self,
request: impl tonic::IntoRequest<super::PublishLifecycleEventRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.devtools.build.v1.PublishBuildEvent/PublishLifecycleEvent",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Publish build tool events belonging to the same stream to a backend job"]
#[doc = " using bidirectional streaming."]
pub async fn publish_build_tool_event_stream(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::PublishBuildToolEventStreamRequest,
>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::PublishBuildToolEventStreamResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.devtools.build.v1.PublishBuildEvent/PublishBuildToolEventStream",
);
self.inner.streaming(request.into_streaming_request(), path, codec).await
}
}
}