ydb_grpc/generated/
ydb.operations.rs

1#[derive(serde::Serialize, serde::Deserialize)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct OperationParams {
4    #[prost(enumeration = "operation_params::OperationMode", tag = "1")]
5    pub operation_mode: i32,
6    /// Indicates that client is no longer interested in the result of operation after the specified duration
7    /// starting from the time operation arrives at the server.
8    /// Server will try to stop the execution of operation and if no result is currently available the operation
9    /// will receive TIMEOUT status code, which will be sent back to client if it was waiting for the operation result.
10    /// Timeout of operation does not tell anything about its result, it might be completed successfully
11    /// or cancelled on server.
12    #[prost(message, optional, tag = "2")]
13    pub operation_timeout: ::core::option::Option<
14        super::super::google::protobuf::Duration,
15    >,
16    /// Server will try to cancel the operation after the specified duration starting from the time
17    /// the operation arrives at server.
18    /// In case of successful cancellation operation will receive CANCELLED status code, which will be
19    /// sent back to client if it was waiting for the operation result.
20    /// In case when cancellation isn't possible, no action will be performed.
21    #[prost(message, optional, tag = "3")]
22    pub cancel_after: ::core::option::Option<super::super::google::protobuf::Duration>,
23    /// User-defined labels of operation.
24    #[prost(map = "string, string", tag = "4")]
25    pub labels: ::std::collections::HashMap<
26        ::prost::alloc::string::String,
27        ::prost::alloc::string::String,
28    >,
29    /// If enabled, server will report cost information, if supported by the operation.
30    /// This flag is mostly useful for SYNC operations, to get the cost information in the response.
31    #[prost(enumeration = "super::feature_flag::Status", tag = "5")]
32    pub report_cost_info: i32,
33}
34/// Nested message and enum types in `OperationParams`.
35pub mod operation_params {
36    #[derive(serde::Serialize, serde::Deserialize)]
37    #[derive(
38        Clone,
39        Copy,
40        Debug,
41        PartialEq,
42        Eq,
43        Hash,
44        PartialOrd,
45        Ord,
46        ::prost::Enumeration
47    )]
48    #[repr(i32)]
49    pub enum OperationMode {
50        Unspecified = 0,
51        /// Server will only reply once operation is finished (ready=true), and operation object won't be
52        /// accessible after the reply. This is a basic request-response mode.
53        Sync = 1,
54        Async = 2,
55    }
56    impl OperationMode {
57        /// String value of the enum field names used in the ProtoBuf definition.
58        /// The values are not transformed in any way and thus are considered stable
59        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
60        pub fn as_str_name(&self) -> &'static str {
61            match self {
62                OperationMode::Unspecified => "OPERATION_MODE_UNSPECIFIED",
63                OperationMode::Sync => "SYNC",
64                OperationMode::Async => "ASYNC",
65            }
66        }
67    }
68}
69#[derive(serde::Serialize, serde::Deserialize)]
70#[derive(Clone, PartialEq, ::prost::Message)]
71pub struct GetOperationRequest {
72    #[prost(string, tag = "1")]
73    pub id: ::prost::alloc::string::String,
74}
75#[derive(serde::Serialize, serde::Deserialize)]
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct GetOperationResponse {
78    #[prost(message, optional, tag = "1")]
79    pub operation: ::core::option::Option<Operation>,
80}
81#[derive(serde::Serialize, serde::Deserialize)]
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct CancelOperationRequest {
84    #[prost(string, tag = "1")]
85    pub id: ::prost::alloc::string::String,
86}
87#[derive(serde::Serialize, serde::Deserialize)]
88#[derive(Clone, PartialEq, ::prost::Message)]
89pub struct CancelOperationResponse {
90    #[prost(enumeration = "super::status_ids::StatusCode", tag = "1")]
91    pub status: i32,
92    #[prost(message, repeated, tag = "2")]
93    pub issues: ::prost::alloc::vec::Vec<super::issue::IssueMessage>,
94}
95#[derive(serde::Serialize, serde::Deserialize)]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct ForgetOperationRequest {
98    #[prost(string, tag = "1")]
99    pub id: ::prost::alloc::string::String,
100}
101#[derive(serde::Serialize, serde::Deserialize)]
102#[derive(Clone, PartialEq, ::prost::Message)]
103pub struct ForgetOperationResponse {
104    #[prost(enumeration = "super::status_ids::StatusCode", tag = "1")]
105    pub status: i32,
106    #[prost(message, repeated, tag = "2")]
107    pub issues: ::prost::alloc::vec::Vec<super::issue::IssueMessage>,
108}
109#[derive(serde::Serialize, serde::Deserialize)]
110#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct ListOperationsRequest {
112    #[prost(string, tag = "1")]
113    pub kind: ::prost::alloc::string::String,
114    #[prost(uint64, tag = "2")]
115    pub page_size: u64,
116    #[prost(string, tag = "3")]
117    pub page_token: ::prost::alloc::string::String,
118}
119#[derive(serde::Serialize, serde::Deserialize)]
120#[derive(Clone, PartialEq, ::prost::Message)]
121pub struct ListOperationsResponse {
122    #[prost(enumeration = "super::status_ids::StatusCode", tag = "1")]
123    pub status: i32,
124    #[prost(message, repeated, tag = "2")]
125    pub issues: ::prost::alloc::vec::Vec<super::issue::IssueMessage>,
126    #[prost(message, repeated, tag = "3")]
127    pub operations: ::prost::alloc::vec::Vec<Operation>,
128    #[prost(string, tag = "4")]
129    pub next_page_token: ::prost::alloc::string::String,
130}
131#[derive(serde::Serialize, serde::Deserialize)]
132#[derive(Clone, PartialEq, ::prost::Message)]
133pub struct Operation {
134    /// Identifier of the operation, empty value means no active operation object is present (it was forgotten or
135    /// not created in the first place, as in SYNC operation mode).
136    #[prost(string, tag = "1")]
137    pub id: ::prost::alloc::string::String,
138    /// true - this operation has beed finished (doesn't matter successful or not),
139    /// so Status field has status code, and Result field can contains result data.
140    /// false - this operation still running. You can repeat request using operation Id.
141    #[prost(bool, tag = "2")]
142    pub ready: bool,
143    #[prost(enumeration = "super::status_ids::StatusCode", tag = "3")]
144    pub status: i32,
145    #[prost(message, repeated, tag = "4")]
146    pub issues: ::prost::alloc::vec::Vec<super::issue::IssueMessage>,
147    /// Result data
148    #[prost(message, optional, tag = "5")]
149    pub result: ::core::option::Option<super::super::google::protobuf::Any>,
150    #[prost(message, optional, tag = "6")]
151    pub metadata: ::core::option::Option<super::super::google::protobuf::Any>,
152    /// Contains information about the cost of the operation.
153    /// For completed operations, it shows the final cost of the operation.
154    /// For operations in progress, it might indicate the current cost of the operation (if supported).
155    #[prost(message, optional, tag = "7")]
156    pub cost_info: ::core::option::Option<super::CostInfo>,
157}