#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceErrorDetail {
#[prost(message, optional, tag = "1")]
pub resource_info: ::core::option::Option<super::super::super::super::rpc::ResourceInfo>,
#[prost(message, repeated, tag = "2")]
pub error_details: ::prost::alloc::vec::Vec<ErrorDetail>,
#[prost(int32, tag = "3")]
pub error_count: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ErrorDetail {
#[prost(message, optional, tag = "1")]
pub location: ::core::option::Option<ErrorLocation>,
#[prost(message, optional, tag = "2")]
pub error_info: ::core::option::Option<super::super::super::super::rpc::ErrorInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ErrorLocation {
#[prost(int32, tag = "1")]
pub line: i32,
#[prost(int32, tag = "2")]
pub column: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TimeSeries {
#[prost(string, tag = "1")]
pub metric: ::prost::alloc::string::String,
#[prost(
enumeration = "super::super::super::super::api::metric_descriptor::ValueType",
tag = "2"
)]
pub value_type: i32,
#[prost(
enumeration = "super::super::super::super::api::metric_descriptor::MetricKind",
tag = "3"
)]
pub metric_kind: i32,
#[prost(message, repeated, tag = "4")]
pub points: ::prost::alloc::vec::Vec<Point>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Point {
#[prost(message, optional, tag = "1")]
pub interval: ::core::option::Option<TimeInterval>,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<TypedValue>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TimeInterval {
#[prost(message, optional, tag = "1")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TypedValue {
#[prost(oneof = "typed_value::Value", tags = "1, 2, 3, 4, 5")]
pub value: ::core::option::Option<typed_value::Value>,
}
pub mod typed_value {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Value {
#[prost(bool, tag = "1")]
BoolValue(bool),
#[prost(int64, tag = "2")]
Int64Value(i64),
#[prost(double, tag = "3")]
DoubleValue(f64),
#[prost(string, tag = "4")]
StringValue(::prost::alloc::string::String),
#[prost(message, tag = "5")]
DistributionValue(super::super::super::super::super::api::Distribution),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MigrationWorkflow {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub display_name: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "2")]
pub tasks: ::std::collections::HashMap<::prost::alloc::string::String, MigrationTask>,
#[prost(enumeration = "migration_workflow::State", tag = "3")]
pub state: i32,
#[prost(message, optional, tag = "4")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "5")]
pub last_update_time: ::core::option::Option<::prost_types::Timestamp>,
}
pub mod migration_workflow {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Draft = 1,
Running = 2,
Paused = 3,
Completed = 4,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MigrationTask {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub r#type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub details: ::core::option::Option<::prost_types::Any>,
#[prost(enumeration = "migration_task::State", tag = "4")]
pub state: i32,
#[prost(message, optional, tag = "5")]
pub processing_error: ::core::option::Option<super::super::super::super::rpc::ErrorInfo>,
#[prost(message, optional, tag = "6")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub last_update_time: ::core::option::Option<::prost_types::Timestamp>,
}
pub mod migration_task {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Pending = 1,
Orchestrating = 2,
Running = 3,
Paused = 4,
Succeeded = 5,
Failed = 6,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MigrationSubtask {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub r#type: ::prost::alloc::string::String,
#[prost(enumeration = "migration_subtask::State", tag = "5")]
pub state: i32,
#[prost(message, optional, tag = "6")]
pub processing_error: ::core::option::Option<super::super::super::super::rpc::ErrorInfo>,
#[prost(message, repeated, tag = "12")]
pub resource_error_details: ::prost::alloc::vec::Vec<ResourceErrorDetail>,
#[prost(int32, tag = "13")]
pub resource_error_count: i32,
#[prost(message, optional, tag = "7")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub last_update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag = "11")]
pub metrics: ::prost::alloc::vec::Vec<TimeSeries>,
}
pub mod migration_subtask {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Active = 1,
Running = 2,
Succeeded = 3,
Failed = 4,
Paused = 5,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateMigrationWorkflowRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub migration_workflow: ::core::option::Option<MigrationWorkflow>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMigrationWorkflowRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMigrationWorkflowsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(int32, tag = "3")]
pub page_size: i32,
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMigrationWorkflowsResponse {
#[prost(message, repeated, tag = "1")]
pub migration_workflows: ::prost::alloc::vec::Vec<MigrationWorkflow>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteMigrationWorkflowRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMigrationWorkflowRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMigrationSubtaskRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMigrationSubtasksRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(int32, tag = "3")]
pub page_size: i32,
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub filter: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMigrationSubtasksResponse {
#[prost(message, repeated, tag = "1")]
pub migration_subtasks: ::prost::alloc::vec::Vec<MigrationSubtask>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod migration_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Service to handle EDW migrations."]
#[derive(Debug, Clone)]
pub struct MigrationServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> MigrationServiceClient<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,
) -> MigrationServiceClient<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,
{
MigrationServiceClient::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 = " Creates a migration workflow."]
pub async fn create_migration_workflow(
&mut self,
request: impl tonic::IntoRequest<super::CreateMigrationWorkflowRequest>,
) -> Result<tonic::Response<super::MigrationWorkflow>, 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.migration.v2alpha.MigrationService/CreateMigrationWorkflow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets a previously created migration workflow."]
pub async fn get_migration_workflow(
&mut self,
request: impl tonic::IntoRequest<super::GetMigrationWorkflowRequest>,
) -> Result<tonic::Response<super::MigrationWorkflow>, 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.migration.v2alpha.MigrationService/GetMigrationWorkflow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists previously created migration workflow."]
pub async fn list_migration_workflows(
&mut self,
request: impl tonic::IntoRequest<super::ListMigrationWorkflowsRequest>,
) -> Result<tonic::Response<super::ListMigrationWorkflowsResponse>, 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.migration.v2alpha.MigrationService/ListMigrationWorkflows",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a migration workflow by name."]
pub async fn delete_migration_workflow(
&mut self,
request: impl tonic::IntoRequest<super::DeleteMigrationWorkflowRequest>,
) -> 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.migration.v2alpha.MigrationService/DeleteMigrationWorkflow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Starts a previously created migration workflow. I.e., the state transitions"]
#[doc = " from DRAFT to RUNNING. This is a no-op if the state is already RUNNING."]
#[doc = " An error will be signaled if the state is anything other than DRAFT or"]
#[doc = " RUNNING."]
pub async fn start_migration_workflow(
&mut self,
request: impl tonic::IntoRequest<super::StartMigrationWorkflowRequest>,
) -> 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.migration.v2alpha.MigrationService/StartMigrationWorkflow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets a previously created migration subtask."]
pub async fn get_migration_subtask(
&mut self,
request: impl tonic::IntoRequest<super::GetMigrationSubtaskRequest>,
) -> Result<tonic::Response<super::MigrationSubtask>, 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.migration.v2alpha.MigrationService/GetMigrationSubtask",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists previously created migration subtasks."]
pub async fn list_migration_subtasks(
&mut self,
request: impl tonic::IntoRequest<super::ListMigrationSubtasksRequest>,
) -> Result<tonic::Response<super::ListMigrationSubtasksResponse>, 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.migration.v2alpha.MigrationService/ListMigrationSubtasks",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TranslateQueryRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(enumeration = "translate_query_request::SqlTranslationSourceDialect", tag = "2")]
pub source_dialect: i32,
#[prost(string, tag = "3")]
pub query: ::prost::alloc::string::String,
}
pub mod translate_query_request {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SqlTranslationSourceDialect {
Unspecified = 0,
Teradata = 1,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TranslateQueryResponse {
#[prost(string, tag = "1")]
pub translated_query: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub errors: ::prost::alloc::vec::Vec<SqlTranslationError>,
#[prost(message, repeated, tag = "3")]
pub warnings: ::prost::alloc::vec::Vec<SqlTranslationWarning>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SqlTranslationErrorDetail {
#[prost(int64, tag = "1")]
pub row: i64,
#[prost(int64, tag = "2")]
pub column: i64,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SqlTranslationError {
#[prost(enumeration = "sql_translation_error::SqlTranslationErrorType", tag = "1")]
pub error_type: i32,
#[prost(message, optional, tag = "2")]
pub error_detail: ::core::option::Option<SqlTranslationErrorDetail>,
}
pub mod sql_translation_error {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SqlTranslationErrorType {
Unspecified = 0,
SqlParseError = 1,
UnsupportedSqlFunction = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SqlTranslationWarning {
#[prost(message, optional, tag = "1")]
pub warning_detail: ::core::option::Option<SqlTranslationErrorDetail>,
}
#[doc = r" Generated client implementations."]
pub mod sql_translation_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Provides other SQL dialects to GoogleSQL translation operations."]
#[derive(Debug, Clone)]
pub struct SqlTranslationServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> SqlTranslationServiceClient<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,
) -> SqlTranslationServiceClient<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,
{
SqlTranslationServiceClient::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 = " Translates input queries from source dialects to GoogleSQL."]
pub async fn translate_query(
&mut self,
request: impl tonic::IntoRequest<super::TranslateQueryRequest>,
) -> Result<tonic::Response<super::TranslateQueryResponse>, 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.migration.v2alpha.SqlTranslationService/TranslateQuery",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}