1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteAllRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionRequest {
    /// Exactly one of these fields should be set
    #[prost(message, optional, tag="1")]
    pub create_repo: ::std::option::Option<super::pfs::CreateRepoRequest>,
    #[prost(message, optional, tag="2")]
    pub delete_repo: ::std::option::Option<super::pfs::DeleteRepoRequest>,
    #[prost(message, optional, tag="3")]
    pub start_commit: ::std::option::Option<super::pfs::StartCommitRequest>,
    #[prost(message, optional, tag="4")]
    pub finish_commit: ::std::option::Option<super::pfs::FinishCommitRequest>,
    #[prost(message, optional, tag="5")]
    pub delete_commit: ::std::option::Option<super::pfs::DeleteCommitRequest>,
    #[prost(message, optional, tag="6")]
    pub create_branch: ::std::option::Option<super::pfs::CreateBranchRequest>,
    #[prost(message, optional, tag="7")]
    pub delete_branch: ::std::option::Option<super::pfs::DeleteBranchRequest>,
    #[prost(message, optional, tag="11")]
    pub update_job_state: ::std::option::Option<super::pps::UpdateJobStateRequest>,
    #[prost(message, optional, tag="10")]
    pub delete_all: ::std::option::Option<DeleteAllRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionResponse {
    /// At most, one of these fields should be set (most responses are empty)
    ///
    /// Only used for StartCommit - any way we can deterministically provide this before finishing the transaction?
    #[prost(message, optional, tag="2")]
    pub commit: ::std::option::Option<super::pfs::Commit>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transaction {
    #[prost(string, tag="1")]
    pub id: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionInfo {
    #[prost(message, optional, tag="1")]
    pub transaction: ::std::option::Option<Transaction>,
    #[prost(message, repeated, tag="2")]
    pub requests: ::std::vec::Vec<TransactionRequest>,
    #[prost(message, repeated, tag="3")]
    pub responses: ::std::vec::Vec<TransactionResponse>,
    #[prost(message, optional, tag="4")]
    pub started: ::std::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionInfos {
    #[prost(message, repeated, tag="1")]
    pub transaction_info: ::std::vec::Vec<TransactionInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchTransactionRequest {
    #[prost(message, repeated, tag="1")]
    pub requests: ::std::vec::Vec<TransactionRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartTransactionRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InspectTransactionRequest {
    #[prost(message, optional, tag="1")]
    pub transaction: ::std::option::Option<Transaction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTransactionRequest {
    #[prost(message, optional, tag="1")]
    pub transaction: ::std::option::Option<Transaction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTransactionRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinishTransactionRequest {
    #[prost(message, optional, tag="1")]
    pub transaction: ::std::option::Option<Transaction>,
}
# [ doc = r" Generated client implementations." ] pub mod api_client { # ! [ allow ( unused_variables , dead_code , missing_docs ) ] use tonic :: codegen :: * ; pub struct ApiClient < T > { inner : tonic :: client :: Grpc < T > , } impl ApiClient < tonic :: transport :: Channel > { # [ doc = r" Attempt to create a new client by connecting to a given endpoint." ] pub async fn connect < D > ( dst : D ) -> Result < Self , tonic :: transport :: Error > where D : std :: convert :: TryInto < tonic :: transport :: Endpoint > , D :: Error : Into < StdError > , { let conn = tonic :: transport :: Endpoint :: new ( dst ) ? . connect ( ) . await ? ; Ok ( Self :: new ( conn ) ) } } impl < T > ApiClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new ( inner : T ) -> Self { let inner = tonic :: client :: Grpc :: new ( inner ) ; Self { inner } } pub fn with_interceptor ( inner : T , interceptor : impl Into < tonic :: Interceptor > ) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor ( inner , interceptor ) ; Self { inner } } # [ doc = " Transaction rpcs" ] pub async fn batch_transaction ( & mut self , request : impl tonic :: IntoRequest < super :: BatchTransactionRequest > , ) -> Result < tonic :: Response < super :: TransactionInfo > , 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 ( "/transaction.API/BatchTransaction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } pub async fn start_transaction ( & mut self , request : impl tonic :: IntoRequest < super :: StartTransactionRequest > , ) -> Result < tonic :: Response < super :: Transaction > , 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 ( "/transaction.API/StartTransaction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } pub async fn inspect_transaction ( & mut self , request : impl tonic :: IntoRequest < super :: InspectTransactionRequest > , ) -> Result < tonic :: Response < super :: TransactionInfo > , 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 ( "/transaction.API/InspectTransaction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } pub async fn delete_transaction ( & mut self , request : impl tonic :: IntoRequest < super :: DeleteTransactionRequest > , ) -> 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 ( "/transaction.API/DeleteTransaction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } pub async fn list_transaction ( & mut self , request : impl tonic :: IntoRequest < super :: ListTransactionRequest > , ) -> Result < tonic :: Response < super :: TransactionInfos > , 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 ( "/transaction.API/ListTransaction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } pub async fn finish_transaction ( & mut self , request : impl tonic :: IntoRequest < super :: FinishTransactionRequest > , ) -> Result < tonic :: Response < super :: TransactionInfo > , 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 ( "/transaction.API/FinishTransaction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } pub async fn delete_all ( & mut self , request : impl tonic :: IntoRequest < super :: DeleteAllRequest > , ) -> 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 ( "/transaction.API/DeleteAll" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } } impl < T : Clone > Clone for ApiClient < T > { fn clone ( & self ) -> Self { Self { inner : self . inner . clone ( ) , } } } impl < T > std :: fmt :: Debug for ApiClient < T > { fn fmt ( & self , f : & mut std :: fmt :: Formatter < '_ > ) -> std :: fmt :: Result { write ! ( f , "ApiClient {{ ... }}" ) } } }