#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Alert {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alert_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "5")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "6")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub source: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub data: ::core::option::Option<::prost_types::Any>,
#[prost(string, tag = "9")]
pub security_investigation_tool_link: ::prost::alloc::string::String,
#[prost(bool, tag = "11")]
pub deleted: bool,
#[prost(message, optional, tag = "12")]
pub metadata: ::core::option::Option<AlertMetadata>,
#[prost(message, optional, tag = "13")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "14")]
pub etag: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlertFeedback {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alert_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub feedback_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "AlertFeedbackType", tag = "5")]
pub r#type: i32,
#[prost(string, tag = "6")]
pub email: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlertMetadata {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alert_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub assignee: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "7")]
pub severity: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub etag: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Settings {
#[prost(message, repeated, tag = "1")]
pub notifications: ::prost::alloc::vec::Vec<settings::Notification>,
}
pub mod settings {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Notification {
#[prost(oneof = "notification::Destination", tags = "1")]
pub destination: ::core::option::Option<notification::Destination>,
}
pub mod notification {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloudPubsubTopic {
#[prost(string, tag = "1")]
pub topic_name: ::prost::alloc::string::String,
#[prost(enumeration = "PayloadFormat", tag = "2")]
pub payload_format: i32,
}
#[derive(
Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration,
)]
#[repr(i32)]
pub enum PayloadFormat {
Unspecified = 0,
Json = 1,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Destination {
#[prost(message, tag = "1")]
CloudPubsubTopic(CloudPubsubTopic),
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDeleteAlertsRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub alert_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDeleteAlertsResponse {
#[prost(string, repeated, tag = "1")]
pub success_alert_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, message", tag = "2")]
pub failed_alert_status: ::std::collections::HashMap<
::prost::alloc::string::String,
super::super::super::rpc::Status,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUndeleteAlertsRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub alert_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUndeleteAlertsResponse {
#[prost(string, repeated, tag = "1")]
pub success_alert_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, message", tag = "2")]
pub failed_alert_status: ::std::collections::HashMap<
::prost::alloc::string::String,
super::super::super::rpc::Status,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAlertsRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub order_by: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAlertsResponse {
#[prost(message, repeated, tag = "1")]
pub alerts: ::prost::alloc::vec::Vec<Alert>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAlertRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alert_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteAlertRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alert_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeleteAlertRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alert_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateAlertFeedbackRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alert_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub feedback: ::core::option::Option<AlertFeedback>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAlertFeedbackRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alert_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub filter: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAlertFeedbackResponse {
#[prost(message, repeated, tag = "1")]
pub feedback: ::prost::alloc::vec::Vec<AlertFeedback>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAlertMetadataRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alert_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSettingsRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSettingsRequest {
#[prost(string, tag = "1")]
pub customer_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub settings: ::core::option::Option<Settings>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AlertFeedbackType {
Unspecified = 0,
NotUseful = 1,
SomewhatUseful = 2,
VeryUseful = 3,
}
#[doc = r" Generated client implementations."]
pub mod alert_center_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Google Workspace Alert Center API (beta)."]
#[derive(Debug, Clone)]
pub struct AlertCenterServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> AlertCenterServiceClient<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,
) -> AlertCenterServiceClient<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,
{
AlertCenterServiceClient::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 = " Lists the alerts."]
pub async fn list_alerts(
&mut self,
request: impl tonic::IntoRequest<super::ListAlertsRequest>,
) -> Result<tonic::Response<super::ListAlertsResponse>, 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.apps.alertcenter.v1beta1.AlertCenterService/ListAlerts",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the specified alert. Attempting to get a nonexistent alert returns"]
#[doc = " `NOT_FOUND` error."]
pub async fn get_alert(
&mut self,
request: impl tonic::IntoRequest<super::GetAlertRequest>,
) -> Result<tonic::Response<super::Alert>, 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.apps.alertcenter.v1beta1.AlertCenterService/GetAlert",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Marks the specified alert for deletion. An alert that has been marked for"]
#[doc = " deletion is removed from Alert Center after 30 days."]
#[doc = " Marking an alert for deletion has no effect on an alert which has"]
#[doc = " already been marked for deletion. Attempting to mark a nonexistent alert"]
#[doc = " for deletion results in a `NOT_FOUND` error."]
pub async fn delete_alert(
&mut self,
request: impl tonic::IntoRequest<super::DeleteAlertRequest>,
) -> 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.apps.alertcenter.v1beta1.AlertCenterService/DeleteAlert",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Restores, or \"undeletes\", an alert that was marked for deletion within the"]
#[doc = " past 30 days. Attempting to undelete an alert which was marked for deletion"]
#[doc = " over 30 days ago (which has been removed from the Alert Center database) or"]
#[doc = " a nonexistent alert returns a `NOT_FOUND` error. Attempting to"]
#[doc = " undelete an alert which has not been marked for deletion has no effect."]
pub async fn undelete_alert(
&mut self,
request: impl tonic::IntoRequest<super::UndeleteAlertRequest>,
) -> Result<tonic::Response<super::Alert>, 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.apps.alertcenter.v1beta1.AlertCenterService/UndeleteAlert",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates new feedback for an alert. Attempting to create a feedback for"]
#[doc = " a non-existent alert returns `NOT_FOUND` error. Attempting to create a"]
#[doc = " feedback for an alert that is marked for deletion returns"]
#[doc = " `FAILED_PRECONDITION' error."]
pub async fn create_alert_feedback(
&mut self,
request: impl tonic::IntoRequest<super::CreateAlertFeedbackRequest>,
) -> Result<tonic::Response<super::AlertFeedback>, 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.apps.alertcenter.v1beta1.AlertCenterService/CreateAlertFeedback",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists all the feedback for an alert. Attempting to list feedbacks for"]
#[doc = " a non-existent alert returns `NOT_FOUND` error."]
pub async fn list_alert_feedback(
&mut self,
request: impl tonic::IntoRequest<super::ListAlertFeedbackRequest>,
) -> Result<tonic::Response<super::ListAlertFeedbackResponse>, 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.apps.alertcenter.v1beta1.AlertCenterService/ListAlertFeedback",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns the metadata of an alert. Attempting to get metadata for"]
#[doc = " a non-existent alert returns `NOT_FOUND` error."]
pub async fn get_alert_metadata(
&mut self,
request: impl tonic::IntoRequest<super::GetAlertMetadataRequest>,
) -> Result<tonic::Response<super::AlertMetadata>, 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.apps.alertcenter.v1beta1.AlertCenterService/GetAlertMetadata",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns customer-level settings."]
pub async fn get_settings(
&mut self,
request: impl tonic::IntoRequest<super::GetSettingsRequest>,
) -> Result<tonic::Response<super::Settings>, 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.apps.alertcenter.v1beta1.AlertCenterService/GetSettings",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the customer-level settings."]
pub async fn update_settings(
&mut self,
request: impl tonic::IntoRequest<super::UpdateSettingsRequest>,
) -> Result<tonic::Response<super::Settings>, 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.apps.alertcenter.v1beta1.AlertCenterService/UpdateSettings",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Performs batch delete operation on alerts."]
pub async fn batch_delete_alerts(
&mut self,
request: impl tonic::IntoRequest<super::BatchDeleteAlertsRequest>,
) -> Result<tonic::Response<super::BatchDeleteAlertsResponse>, 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.apps.alertcenter.v1beta1.AlertCenterService/BatchDeleteAlerts",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Performs batch undelete operation on alerts."]
pub async fn batch_undelete_alerts(
&mut self,
request: impl tonic::IntoRequest<super::BatchUndeleteAlertsRequest>,
) -> Result<tonic::Response<super::BatchUndeleteAlertsResponse>, 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.apps.alertcenter.v1beta1.AlertCenterService/BatchUndeleteAlerts",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}