ydb_grpc/generated/
ydb.operations.rs

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