#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTableRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTablesRequest {
#[prost(int32, tag = "1")]
pub page_size: i32,
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTablesResponse {
#[prost(message, repeated, tag = "1")]
pub tables: ::prost::alloc::vec::Vec<Table>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetWorkspaceRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkspacesRequest {
#[prost(int32, tag = "1")]
pub page_size: i32,
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkspacesResponse {
#[prost(message, repeated, tag = "1")]
pub workspaces: ::prost::alloc::vec::Vec<Workspace>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetRowRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "View", tag = "2")]
pub view: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListRowsRequest {
#[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(enumeration = "View", tag = "4")]
pub view: i32,
#[prost(string, tag = "5")]
pub filter: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListRowsResponse {
#[prost(message, repeated, tag = "1")]
pub rows: ::prost::alloc::vec::Vec<Row>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateRowRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub row: ::core::option::Option<Row>,
#[prost(enumeration = "View", tag = "3")]
pub view: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateRowsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub requests: ::prost::alloc::vec::Vec<CreateRowRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateRowsResponse {
#[prost(message, repeated, tag = "1")]
pub rows: ::prost::alloc::vec::Vec<Row>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateRowRequest {
#[prost(message, optional, tag = "1")]
pub row: ::core::option::Option<Row>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(enumeration = "View", tag = "3")]
pub view: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateRowsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub requests: ::prost::alloc::vec::Vec<UpdateRowRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateRowsResponse {
#[prost(message, repeated, tag = "1")]
pub rows: ::prost::alloc::vec::Vec<Row>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRowRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDeleteRowsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Table {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub columns: ::prost::alloc::vec::Vec<ColumnDescription>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ColumnDescription {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub data_type: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub labels: ::prost::alloc::vec::Vec<LabeledItem>,
#[prost(message, optional, tag = "5")]
pub relationship_details: ::core::option::Option<RelationshipDetails>,
#[prost(message, optional, tag = "6")]
pub lookup_details: ::core::option::Option<LookupDetails>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LabeledItem {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RelationshipDetails {
#[prost(string, tag = "1")]
pub linked_table: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupDetails {
#[prost(string, tag = "1")]
pub relationship_column: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub relationship_column_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Row {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "2")]
pub values: ::std::collections::HashMap<::prost::alloc::string::String, ::prost_types::Value>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Workspace {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub tables: ::prost::alloc::vec::Vec<Table>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum View {
Unspecified = 0,
ColumnIdView = 1,
}
#[doc = r" Generated client implementations."]
pub mod tables_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " The Tables Service provides an API for reading and updating tables."]
#[doc = " It defines the following resource model:"]
#[doc = ""]
#[doc = " - The API has a collection of [Table][google.area120.tables.v1alpha1.Table]"]
#[doc = " resources, named `tables/*`"]
#[doc = ""]
#[doc = " - Each Table has a collection of [Row][google.area120.tables.v1alpha1.Row]"]
#[doc = " resources, named `tables/*/rows/*`"]
#[doc = ""]
#[doc = " - The API has a collection of"]
#[doc = " [Workspace][google.area120.tables.v1alpha1.Workspace]"]
#[doc = " resources, named `workspaces/*`."]
#[derive(Debug, Clone)]
pub struct TablesServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> TablesServiceClient<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,
) -> TablesServiceClient<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,
{
TablesServiceClient::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 = " Gets a table. Returns NOT_FOUND if the table does not exist."]
pub async fn get_table(
&mut self,
request: impl tonic::IntoRequest<super::GetTableRequest>,
) -> Result<tonic::Response<super::Table>, 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.area120.tables.v1alpha1.TablesService/GetTable",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists tables for the user."]
pub async fn list_tables(
&mut self,
request: impl tonic::IntoRequest<super::ListTablesRequest>,
) -> Result<tonic::Response<super::ListTablesResponse>, 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.area120.tables.v1alpha1.TablesService/ListTables",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets a workspace. Returns NOT_FOUND if the workspace does not exist."]
pub async fn get_workspace(
&mut self,
request: impl tonic::IntoRequest<super::GetWorkspaceRequest>,
) -> Result<tonic::Response<super::Workspace>, 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.area120.tables.v1alpha1.TablesService/GetWorkspace",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists workspaces for the user."]
pub async fn list_workspaces(
&mut self,
request: impl tonic::IntoRequest<super::ListWorkspacesRequest>,
) -> Result<tonic::Response<super::ListWorkspacesResponse>, 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.area120.tables.v1alpha1.TablesService/ListWorkspaces",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets a row. Returns NOT_FOUND if the row does not exist in the table."]
pub async fn get_row(
&mut self,
request: impl tonic::IntoRequest<super::GetRowRequest>,
) -> Result<tonic::Response<super::Row>, 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.area120.tables.v1alpha1.TablesService/GetRow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists rows in a table. Returns NOT_FOUND if the table does not exist."]
pub async fn list_rows(
&mut self,
request: impl tonic::IntoRequest<super::ListRowsRequest>,
) -> Result<tonic::Response<super::ListRowsResponse>, 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.area120.tables.v1alpha1.TablesService/ListRows",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a row."]
pub async fn create_row(
&mut self,
request: impl tonic::IntoRequest<super::CreateRowRequest>,
) -> Result<tonic::Response<super::Row>, 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.area120.tables.v1alpha1.TablesService/CreateRow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates multiple rows."]
pub async fn batch_create_rows(
&mut self,
request: impl tonic::IntoRequest<super::BatchCreateRowsRequest>,
) -> Result<tonic::Response<super::BatchCreateRowsResponse>, 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.area120.tables.v1alpha1.TablesService/BatchCreateRows",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates a row."]
pub async fn update_row(
&mut self,
request: impl tonic::IntoRequest<super::UpdateRowRequest>,
) -> Result<tonic::Response<super::Row>, 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.area120.tables.v1alpha1.TablesService/UpdateRow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates multiple rows."]
pub async fn batch_update_rows(
&mut self,
request: impl tonic::IntoRequest<super::BatchUpdateRowsRequest>,
) -> Result<tonic::Response<super::BatchUpdateRowsResponse>, 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.area120.tables.v1alpha1.TablesService/BatchUpdateRows",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a row."]
pub async fn delete_row(
&mut self,
request: impl tonic::IntoRequest<super::DeleteRowRequest>,
) -> 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.area120.tables.v1alpha1.TablesService/DeleteRow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes multiple rows."]
pub async fn batch_delete_rows(
&mut self,
request: impl tonic::IntoRequest<super::BatchDeleteRowsRequest>,
) -> 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.area120.tables.v1alpha1.TablesService/BatchDeleteRows",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}