#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Endpoint {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(map = "string, string", tag = "4")]
pub labels:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(string, tag = "5")]
pub network: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub endpoint_forwarding_rule: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub endpoint_ip: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub description: ::prost::alloc::string::String,
#[prost(enumeration = "endpoint::Severity", tag = "9")]
pub severity: i32,
#[prost(enumeration = "endpoint::State", tag = "12")]
pub state: i32,
#[prost(bool, tag = "13")]
pub traffic_logs: bool,
}
pub mod endpoint {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Severity {
Unspecified = 0,
Informational = 1,
Low = 2,
Medium = 3,
High = 4,
Critical = 5,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Creating = 1,
Ready = 2,
Deleting = 3,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEndpointsRequest {
#[prost(string, tag = "1")]
pub parent: ::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 ListEndpointsResponse {
#[prost(message, repeated, tag = "1")]
pub endpoints: ::prost::alloc::vec::Vec<Endpoint>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEndpointRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateEndpointRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub endpoint_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub endpoint: ::core::option::Option<Endpoint>,
#[prost(string, tag = "4")]
pub request_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteEndpointRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub request_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationMetadata {
#[prost(message, optional, tag = "1")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "3")]
pub target: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub verb: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub status_message: ::prost::alloc::string::String,
#[prost(bool, tag = "6")]
pub requested_cancellation: bool,
#[prost(string, tag = "7")]
pub api_version: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod ids_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " The IDS Service"]
#[derive(Debug, Clone)]
pub struct IdsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> IdsClient<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) -> IdsClient<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,
{
IdsClient::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 Endpoints in a given project and location."]
pub async fn list_endpoints(
&mut self,
request: impl tonic::IntoRequest<super::ListEndpointsRequest>,
) -> Result<tonic::Response<super::ListEndpointsResponse>, 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.cloud.ids.v1.IDS/ListEndpoints");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets details of a single Endpoint."]
pub async fn get_endpoint(
&mut self,
request: impl tonic::IntoRequest<super::GetEndpointRequest>,
) -> Result<tonic::Response<super::Endpoint>, 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.cloud.ids.v1.IDS/GetEndpoint");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a new Endpoint in a given project and location."]
pub async fn create_endpoint(
&mut self,
request: impl tonic::IntoRequest<super::CreateEndpointRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
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.cloud.ids.v1.IDS/CreateEndpoint");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a single Endpoint."]
pub async fn delete_endpoint(
&mut self,
request: impl tonic::IntoRequest<super::DeleteEndpointRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
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.cloud.ids.v1.IDS/DeleteEndpoint");
self.inner.unary(request.into_request(), path, codec).await
}
}
}