ydb_grpc_bindings/generated/
ydb.operations.rs

1#[allow(clippy::derive_partial_eq_without_eq)]
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(
37        Clone,
38        Copy,
39        Debug,
40        PartialEq,
41        Eq,
42        Hash,
43        PartialOrd,
44        Ord,
45        ::prost::Enumeration
46    )]
47    #[repr(i32)]
48    pub enum OperationMode {
49        Unspecified = 0,
50        /// Server will only reply once operation is finished (ready=true), and operation object won't be
51        /// accessible after the reply. This is a basic request-response mode.
52        Sync = 1,
53        Async = 2,
54    }
55    impl OperationMode {
56        /// String value of the enum field names used in the ProtoBuf definition.
57        ///
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        /// Creates an enum from field names used in the ProtoBuf definition.
68        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
69            match value {
70                "OPERATION_MODE_UNSPECIFIED" => Some(Self::Unspecified),
71                "SYNC" => Some(Self::Sync),
72                "ASYNC" => Some(Self::Async),
73                _ => None,
74            }
75        }
76    }
77}
78#[allow(clippy::derive_partial_eq_without_eq)]
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct GetOperationRequest {
81    #[prost(string, tag = "1")]
82    pub id: ::prost::alloc::string::String,
83}
84#[allow(clippy::derive_partial_eq_without_eq)]
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct GetOperationResponse {
87    #[prost(message, optional, tag = "1")]
88    pub operation: ::core::option::Option<Operation>,
89}
90#[allow(clippy::derive_partial_eq_without_eq)]
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct CancelOperationRequest {
93    #[prost(string, tag = "1")]
94    pub id: ::prost::alloc::string::String,
95}
96#[allow(clippy::derive_partial_eq_without_eq)]
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct CancelOperationResponse {
99    #[prost(enumeration = "super::status_ids::StatusCode", tag = "1")]
100    pub status: i32,
101    #[prost(message, repeated, tag = "2")]
102    pub issues: ::prost::alloc::vec::Vec<super::issue::IssueMessage>,
103}
104#[allow(clippy::derive_partial_eq_without_eq)]
105#[derive(Clone, PartialEq, ::prost::Message)]
106pub struct ForgetOperationRequest {
107    #[prost(string, tag = "1")]
108    pub id: ::prost::alloc::string::String,
109}
110#[allow(clippy::derive_partial_eq_without_eq)]
111#[derive(Clone, PartialEq, ::prost::Message)]
112pub struct ForgetOperationResponse {
113    #[prost(enumeration = "super::status_ids::StatusCode", tag = "1")]
114    pub status: i32,
115    #[prost(message, repeated, tag = "2")]
116    pub issues: ::prost::alloc::vec::Vec<super::issue::IssueMessage>,
117}
118#[allow(clippy::derive_partial_eq_without_eq)]
119#[derive(Clone, PartialEq, ::prost::Message)]
120pub struct ListOperationsRequest {
121    #[prost(string, tag = "1")]
122    pub kind: ::prost::alloc::string::String,
123    #[prost(uint64, tag = "2")]
124    pub page_size: u64,
125    #[prost(string, tag = "3")]
126    pub page_token: ::prost::alloc::string::String,
127}
128#[allow(clippy::derive_partial_eq_without_eq)]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct ListOperationsResponse {
131    #[prost(enumeration = "super::status_ids::StatusCode", tag = "1")]
132    pub status: i32,
133    #[prost(message, repeated, tag = "2")]
134    pub issues: ::prost::alloc::vec::Vec<super::issue::IssueMessage>,
135    #[prost(message, repeated, tag = "3")]
136    pub operations: ::prost::alloc::vec::Vec<Operation>,
137    #[prost(string, tag = "4")]
138    pub next_page_token: ::prost::alloc::string::String,
139}
140#[allow(clippy::derive_partial_eq_without_eq)]
141#[derive(Clone, PartialEq, ::prost::Message)]
142pub struct Operation {
143    /// Identifier of the operation, empty value means no active operation object is present (it was forgotten or
144    /// not created in the first place, as in SYNC operation mode).
145    #[prost(string, tag = "1")]
146    pub id: ::prost::alloc::string::String,
147    /// true - this operation has beed finished (doesn't matter successful or not),
148    /// so Status field has status code, and Result field can contains result data.
149    /// false - this operation still running. You can repeat request using operation Id.
150    #[prost(bool, tag = "2")]
151    pub ready: bool,
152    #[prost(enumeration = "super::status_ids::StatusCode", tag = "3")]
153    pub status: i32,
154    #[prost(message, repeated, tag = "4")]
155    pub issues: ::prost::alloc::vec::Vec<super::issue::IssueMessage>,
156    /// Result data
157    #[prost(message, optional, tag = "5")]
158    pub result: ::core::option::Option<super::super::google::protobuf::Any>,
159    #[prost(message, optional, tag = "6")]
160    pub metadata: ::core::option::Option<super::super::google::protobuf::Any>,
161    /// Contains information about the cost of the operation.
162    /// For completed operations, it shows the final cost of the operation.
163    /// For operations in progress, it might indicate the current cost of the operation (if supported).
164    #[prost(message, optional, tag = "7")]
165    pub cost_info: ::core::option::Option<super::CostInfo>,
166}