#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Repo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub size: i64,
#[prost(string, tag = "3")]
pub url: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub mirror_config: ::core::option::Option<MirrorConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MirrorConfig {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub webhook_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub deploy_key_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetRepoRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListReposRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListReposResponse {
#[prost(message, repeated, tag = "1")]
pub repos: ::prost::alloc::vec::Vec<Repo>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateRepoRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub repo: ::core::option::Option<Repo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRepoRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod source_repo_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " The Source Repo API service."]
#[derive(Debug, Clone)]
pub struct SourceRepoClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> SourceRepoClient<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,
) -> SourceRepoClient<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,
{
SourceRepoClient::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 = " Returns all repos belonging to a project. The sizes of the repos are"]
#[doc = " not set by ListRepos. To get the size of a repo, use GetRepo."]
pub async fn list_repos(
&mut self,
request: impl tonic::IntoRequest<super::ListReposRequest>,
) -> Result<tonic::Response<super::ListReposResponse>, 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.sourcerepo.v1.SourceRepo/ListRepos",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns information about a repo."]
pub async fn get_repo(
&mut self,
request: impl tonic::IntoRequest<super::GetRepoRequest>,
) -> Result<tonic::Response<super::Repo>, 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.sourcerepo.v1.SourceRepo/GetRepo",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a repo in the given project with the given name."]
#[doc = ""]
#[doc = " If the named repository already exists, `CreateRepo` returns"]
#[doc = " `ALREADY_EXISTS`."]
pub async fn create_repo(
&mut self,
request: impl tonic::IntoRequest<super::CreateRepoRequest>,
) -> Result<tonic::Response<super::Repo>, 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.sourcerepo.v1.SourceRepo/CreateRepo",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a repo."]
pub async fn delete_repo(
&mut self,
request: impl tonic::IntoRequest<super::DeleteRepoRequest>,
) -> 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.sourcerepo.v1.SourceRepo/DeleteRepo",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Sets the access control policy on the specified resource. Replaces any"]
#[doc = " existing policy."]
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::SetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.sourcerepo.v1.SourceRepo/SetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the access control policy for a resource."]
#[doc = " Returns an empty policy if the resource exists and does not have a policy"]
#[doc = " set."]
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::GetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.sourcerepo.v1.SourceRepo/GetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns permissions that a caller has on the specified resource."]
#[doc = " If the resource does not exist, this will return an empty set of"]
#[doc = " permissions, not a NOT_FOUND error."]
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> Result<
tonic::Response<super::super::super::super::iam::v1::TestIamPermissionsResponse>,
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.sourcerepo.v1.SourceRepo/TestIamPermissions",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}