#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Api {
#[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 display_name: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub managed_service: ::prost::alloc::string::String,
#[prost(enumeration = "api::State", tag = "12")]
pub state: i32,
}
pub mod api {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Creating = 1,
Active = 2,
Failed = 3,
Deleting = 4,
Updating = 5,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApiConfig {
#[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 display_name: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub gateway_service_account: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub service_config_id: ::prost::alloc::string::String,
#[prost(enumeration = "api_config::State", tag = "8")]
pub state: i32,
#[prost(message, repeated, tag = "9")]
pub openapi_documents: ::prost::alloc::vec::Vec<api_config::OpenApiDocument>,
#[prost(message, repeated, tag = "10")]
pub grpc_services: ::prost::alloc::vec::Vec<api_config::GrpcServiceDefinition>,
#[prost(message, repeated, tag = "11")]
pub managed_service_configs: ::prost::alloc::vec::Vec<api_config::File>,
}
pub mod api_config {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct File {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub contents: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenApiDocument {
#[prost(message, optional, tag = "1")]
pub document: ::core::option::Option<File>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GrpcServiceDefinition {
#[prost(message, optional, tag = "1")]
pub file_descriptor_set: ::core::option::Option<File>,
#[prost(message, repeated, tag = "2")]
pub source: ::prost::alloc::vec::Vec<File>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Creating = 1,
Active = 2,
Failed = 3,
Deleting = 4,
Updating = 5,
Activating = 6,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Gateway {
#[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 display_name: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub api_config: ::prost::alloc::string::String,
#[prost(enumeration = "gateway::State", tag = "7")]
pub state: i32,
#[prost(string, tag = "9")]
pub default_hostname: ::prost::alloc::string::String,
}
pub mod gateway {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Creating = 1,
Active = 2,
Failed = 3,
Deleting = 4,
Updating = 5,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListGatewaysRequest {
#[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 ListGatewaysResponse {
#[prost(message, repeated, tag = "1")]
pub gateways: ::prost::alloc::vec::Vec<Gateway>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub unreachable_locations: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGatewayRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateGatewayRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub gateway_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub gateway: ::core::option::Option<Gateway>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateGatewayRequest {
#[prost(message, optional, tag = "1")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(message, optional, tag = "2")]
pub gateway: ::core::option::Option<Gateway>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteGatewayRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListApisRequest {
#[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 ListApisResponse {
#[prost(message, repeated, tag = "1")]
pub apis: ::prost::alloc::vec::Vec<Api>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub unreachable_locations: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetApiRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateApiRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub api_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub api: ::core::option::Option<Api>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateApiRequest {
#[prost(message, optional, tag = "1")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(message, optional, tag = "2")]
pub api: ::core::option::Option<Api>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteApiRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListApiConfigsRequest {
#[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 ListApiConfigsResponse {
#[prost(message, repeated, tag = "1")]
pub api_configs: ::prost::alloc::vec::Vec<ApiConfig>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub unreachable_locations: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetApiConfigRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "get_api_config_request::ConfigView", tag = "3")]
pub view: i32,
}
pub mod get_api_config_request {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ConfigView {
Unspecified = 0,
Basic = 1,
Full = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateApiConfigRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub api_config_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub api_config: ::core::option::Option<ApiConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateApiConfigRequest {
#[prost(message, optional, tag = "1")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(message, optional, tag = "2")]
pub api_config: ::core::option::Option<ApiConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteApiConfigRequest {
#[prost(string, tag = "1")]
pub name: ::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,
#[prost(message, repeated, tag = "8")]
pub diagnostics: ::prost::alloc::vec::Vec<operation_metadata::Diagnostic>,
}
pub mod operation_metadata {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Diagnostic {
#[prost(string, tag = "1")]
pub location: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
}
#[doc = r" Generated client implementations."]
pub mod api_gateway_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " The API Gateway Service is the interface for managing API Gateways."]
#[derive(Debug, Clone)]
pub struct ApiGatewayServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> ApiGatewayServiceClient<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,
) -> ApiGatewayServiceClient<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,
{
ApiGatewayServiceClient::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 Gateways in a given project and location."]
pub async fn list_gateways(
&mut self,
request: impl tonic::IntoRequest<super::ListGatewaysRequest>,
) -> Result<tonic::Response<super::ListGatewaysResponse>, 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.apigateway.v1.ApiGatewayService/ListGateways",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets details of a single Gateway."]
pub async fn get_gateway(
&mut self,
request: impl tonic::IntoRequest<super::GetGatewayRequest>,
) -> Result<tonic::Response<super::Gateway>, 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.apigateway.v1.ApiGatewayService/GetGateway",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a new Gateway in a given project and location."]
pub async fn create_gateway(
&mut self,
request: impl tonic::IntoRequest<super::CreateGatewayRequest>,
) -> 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.apigateway.v1.ApiGatewayService/CreateGateway",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the parameters of a single Gateway."]
pub async fn update_gateway(
&mut self,
request: impl tonic::IntoRequest<super::UpdateGatewayRequest>,
) -> 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.apigateway.v1.ApiGatewayService/UpdateGateway",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a single Gateway."]
pub async fn delete_gateway(
&mut self,
request: impl tonic::IntoRequest<super::DeleteGatewayRequest>,
) -> 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.apigateway.v1.ApiGatewayService/DeleteGateway",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists Apis in a given project and location."]
pub async fn list_apis(
&mut self,
request: impl tonic::IntoRequest<super::ListApisRequest>,
) -> Result<tonic::Response<super::ListApisResponse>, 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.apigateway.v1.ApiGatewayService/ListApis",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets details of a single Api."]
pub async fn get_api(
&mut self,
request: impl tonic::IntoRequest<super::GetApiRequest>,
) -> Result<tonic::Response<super::Api>, 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.apigateway.v1.ApiGatewayService/GetApi",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a new Api in a given project and location."]
pub async fn create_api(
&mut self,
request: impl tonic::IntoRequest<super::CreateApiRequest>,
) -> 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.apigateway.v1.ApiGatewayService/CreateApi",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the parameters of a single Api."]
pub async fn update_api(
&mut self,
request: impl tonic::IntoRequest<super::UpdateApiRequest>,
) -> 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.apigateway.v1.ApiGatewayService/UpdateApi",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a single Api."]
pub async fn delete_api(
&mut self,
request: impl tonic::IntoRequest<super::DeleteApiRequest>,
) -> 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.apigateway.v1.ApiGatewayService/DeleteApi",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists ApiConfigs in a given project and location."]
pub async fn list_api_configs(
&mut self,
request: impl tonic::IntoRequest<super::ListApiConfigsRequest>,
) -> Result<tonic::Response<super::ListApiConfigsResponse>, 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.apigateway.v1.ApiGatewayService/ListApiConfigs",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets details of a single ApiConfig."]
pub async fn get_api_config(
&mut self,
request: impl tonic::IntoRequest<super::GetApiConfigRequest>,
) -> Result<tonic::Response<super::ApiConfig>, 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.apigateway.v1.ApiGatewayService/GetApiConfig",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a new ApiConfig in a given project and location."]
pub async fn create_api_config(
&mut self,
request: impl tonic::IntoRequest<super::CreateApiConfigRequest>,
) -> 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.apigateway.v1.ApiGatewayService/CreateApiConfig",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the parameters of a single ApiConfig."]
pub async fn update_api_config(
&mut self,
request: impl tonic::IntoRequest<super::UpdateApiConfigRequest>,
) -> 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.apigateway.v1.ApiGatewayService/UpdateApiConfig",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a single ApiConfig."]
pub async fn delete_api_config(
&mut self,
request: impl tonic::IntoRequest<super::DeleteApiConfigRequest>,
) -> 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.apigateway.v1.ApiGatewayService/DeleteApiConfig",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}