|
| 1 | +/// Server response on the `/version` endpoint. |
| 2 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 3 | +#[derive(Clone, PartialEq, ::prost::Message)] |
| 4 | +pub struct VersionResponse { |
| 5 | + /// The API version supported by the server. |
| 6 | + #[prost(enumeration = "Version", tag = "1")] |
| 7 | + pub version: i32, |
| 8 | +} |
1 | 9 | /// Request payload to be used for `GetObject` API call to server. |
2 | 10 | #[allow(clippy::derive_partial_eq_without_eq)] |
3 | 11 | #[derive(Clone, PartialEq, ::prost::Message)] |
@@ -331,6 +339,35 @@ pub struct PlaintextBlob { |
331 | 339 | #[prost(int64, tag = "2")] |
332 | 340 | pub version: i64, |
333 | 341 | } |
| 342 | +/// Versions of the VSS API. |
| 343 | +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] |
| 344 | +#[repr(i32)] |
| 345 | +pub enum Version { |
| 346 | + /// Default protobuf Enum value. Will not be used as `Version` by server. |
| 347 | + Vunknown = 0, |
| 348 | + /// The initial version of the VSS API. |
| 349 | + V1 = 1, |
| 350 | +} |
| 351 | +impl Version { |
| 352 | + /// String value of the enum field names used in the ProtoBuf definition. |
| 353 | + /// |
| 354 | + /// The values are not transformed in any way and thus are considered stable |
| 355 | + /// (if the ProtoBuf definition does not change) and safe for programmatic use. |
| 356 | + pub fn as_str_name(&self) -> &'static str { |
| 357 | + match self { |
| 358 | + Version::Vunknown => "VUNKNOWN", |
| 359 | + Version::V1 => "V1", |
| 360 | + } |
| 361 | + } |
| 362 | + /// Creates an enum from field names used in the ProtoBuf definition. |
| 363 | + pub fn from_str_name(value: &str) -> ::core::option::Option<Self> { |
| 364 | + match value { |
| 365 | + "VUNKNOWN" => Some(Self::Vunknown), |
| 366 | + "V1" => Some(Self::V1), |
| 367 | + _ => None, |
| 368 | + } |
| 369 | + } |
| 370 | +} |
334 | 371 | /// ErrorCodes to be used in `ErrorResponse` |
335 | 372 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] |
336 | 373 | #[repr(i32)] |
|
0 commit comments