#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldSchema {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub r#type: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StorageDescriptor {
#[prost(string, tag = "1")]
pub location_uri: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub input_format: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub output_format: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub serde_info: ::core::option::Option<SerDeInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SerDeInfo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub serialization_library: ::prost::alloc::string::String,
#[prost(btree_map = "string, string", tag = "3")]
pub parameters: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetastorePartition {
#[prost(string, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub storage_descriptor: ::core::option::Option<StorageDescriptor>,
#[prost(btree_map = "string, string", tag = "4")]
pub parameters: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, repeated, tag = "5")]
pub fields: ::prost::alloc::vec::Vec<FieldSchema>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetastorePartitionList {
#[prost(message, repeated, tag = "1")]
pub partitions: ::prost::alloc::vec::Vec<MetastorePartition>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadStream {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamList {
#[prost(message, repeated, tag = "1")]
pub streams: ::prost::alloc::vec::Vec<ReadStream>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetastorePartitionValues {
#[prost(string, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateMetastorePartitionRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub metastore_partition: ::core::option::Option<MetastorePartition>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateMetastorePartitionsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub requests: ::prost::alloc::vec::Vec<CreateMetastorePartitionRequest>,
#[prost(bool, tag = "3")]
pub skip_existing_partitions: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateMetastorePartitionsResponse {
#[prost(message, repeated, tag = "1")]
pub partitions: ::prost::alloc::vec::Vec<MetastorePartition>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDeleteMetastorePartitionsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub partition_values: ::prost::alloc::vec::Vec<MetastorePartitionValues>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateMetastorePartitionRequest {
#[prost(message, optional, tag = "1")]
pub metastore_partition: ::core::option::Option<MetastorePartition>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateMetastorePartitionsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub requests: ::prost::alloc::vec::Vec<UpdateMetastorePartitionRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateMetastorePartitionsResponse {
#[prost(message, repeated, tag = "1")]
pub partitions: ::prost::alloc::vec::Vec<MetastorePartition>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMetastorePartitionsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub filter: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMetastorePartitionsResponse {
#[prost(oneof = "list_metastore_partitions_response::Response", tags = "1, 2")]
pub response: ::core::option::Option<list_metastore_partitions_response::Response>,
}
pub mod list_metastore_partitions_response {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "1")]
Partitions(super::MetastorePartitionList),
#[prost(message, tag = "2")]
Streams(super::StreamList),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamMetastorePartitionsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub metastore_partitions: ::prost::alloc::vec::Vec<MetastorePartition>,
#[prost(bool, tag = "3")]
pub skip_existing_partitions: bool,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StreamMetastorePartitionsResponse {
#[prost(int64, tag = "2")]
pub total_partitions_streamed_count: i64,
#[prost(int64, tag = "3")]
pub total_partitions_inserted_count: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchSizeTooLargeError {
#[prost(int64, tag = "1")]
pub max_batch_size: i64,
#[prost(string, tag = "2")]
pub error_message: ::prost::alloc::string::String,
}
pub mod metastore_partition_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MetastorePartitionServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> MetastorePartitionServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> MetastorePartitionServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
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> + std::marker::Send + std::marker::Sync,
{
MetastorePartitionServiceClient::new(
InterceptedService::new(inner, interceptor),
)
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn batch_create_metastore_partitions(
&mut self,
request: impl tonic::IntoRequest<
super::BatchCreateMetastorePartitionsRequest,
>,
) -> std::result::Result<
tonic::Response<super::BatchCreateMetastorePartitionsResponse>,
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.bigquery.storage.v1alpha.MetastorePartitionService/BatchCreateMetastorePartitions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.storage.v1alpha.MetastorePartitionService",
"BatchCreateMetastorePartitions",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_delete_metastore_partitions(
&mut self,
request: impl tonic::IntoRequest<
super::BatchDeleteMetastorePartitionsRequest,
>,
) -> std::result::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.cloud.bigquery.storage.v1alpha.MetastorePartitionService/BatchDeleteMetastorePartitions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.storage.v1alpha.MetastorePartitionService",
"BatchDeleteMetastorePartitions",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_update_metastore_partitions(
&mut self,
request: impl tonic::IntoRequest<
super::BatchUpdateMetastorePartitionsRequest,
>,
) -> std::result::Result<
tonic::Response<super::BatchUpdateMetastorePartitionsResponse>,
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.bigquery.storage.v1alpha.MetastorePartitionService/BatchUpdateMetastorePartitions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.storage.v1alpha.MetastorePartitionService",
"BatchUpdateMetastorePartitions",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_metastore_partitions(
&mut self,
request: impl tonic::IntoRequest<super::ListMetastorePartitionsRequest>,
) -> std::result::Result<
tonic::Response<super::ListMetastorePartitionsResponse>,
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.bigquery.storage.v1alpha.MetastorePartitionService/ListMetastorePartitions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.storage.v1alpha.MetastorePartitionService",
"ListMetastorePartitions",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn stream_metastore_partitions(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::StreamMetastorePartitionsRequest,
>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::StreamMetastorePartitionsResponse>,
>,
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.bigquery.storage.v1alpha.MetastorePartitionService/StreamMetastorePartitions",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.storage.v1alpha.MetastorePartitionService",
"StreamMetastorePartitions",
),
);
self.inner.streaming(req, path, codec).await
}
}
}