#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Operation {
pub name: std::string::String,
pub metadata: std::option::Option<wkt::Any>,
pub done: bool,
pub result: std::option::Option<crate::model::operation::Result>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Operation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Any>,
{
self.metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Any>,
{
self.metadata = v.map(|x| x.into());
self
}
pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.done = v.into();
self
}
pub fn set_result<
T: std::convert::Into<std::option::Option<crate::model::operation::Result>>,
>(
mut self,
v: T,
) -> Self {
self.result = v.into();
self
}
pub fn error(&self) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::operation::Result::Error(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_error<T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(crate::model::operation::Result::Error(v.into()));
self
}
pub fn response(&self) -> std::option::Option<&std::boxed::Box<wkt::Any>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::operation::Result::Response(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_response<T: std::convert::Into<std::boxed::Box<wkt::Any>>>(mut self, v: T) -> Self {
self.result =
std::option::Option::Some(crate::model::operation::Result::Response(v.into()));
self
}
}
impl wkt::message::Message for Operation {
fn typename() -> &'static str {
"type.googleapis.com/google.longrunning.Operation"
}
}
pub mod operation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Result {
Error(std::boxed::Box<google_cloud_rpc::model::Status>),
Response(std::boxed::Box<wkt::Any>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetOperationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetOperationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetOperationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.longrunning.GetOperationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListOperationsRequest {
pub name: std::string::String,
pub filter: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub return_partial_success: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListOperationsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.return_partial_success = v.into();
self
}
}
impl wkt::message::Message for ListOperationsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.longrunning.ListOperationsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListOperationsResponse {
pub operations: std::vec::Vec<crate::model::Operation>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListOperationsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_operations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Operation>,
{
use std::iter::Iterator;
self.operations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListOperationsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.longrunning.ListOperationsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListOperationsResponse {
type PageItem = crate::model::Operation;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.operations
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelOperationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelOperationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for CancelOperationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.longrunning.CancelOperationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteOperationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteOperationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteOperationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.longrunning.DeleteOperationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WaitOperationRequest {
pub name: std::string::String,
pub timeout: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WaitOperationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for WaitOperationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.longrunning.WaitOperationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationInfo {
pub response_type: std::string::String,
pub metadata_type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_response_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.response_type = v.into();
self
}
pub fn set_metadata_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.metadata_type = v.into();
self
}
}
impl wkt::message::Message for OperationInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.longrunning.OperationInfo"
}
}