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
//!
//! # SC Api Keys
//!
//! Stores Api Keys supported by the SC.
//!

use dataplane::derive::{Decode, Encode};

// Make sure that the ApiVersion variant matches dataplane's API_VERSIONS_KEY
static_assertions::const_assert_eq!(
    dataplane::versions::VERSIONS_API_KEY,
    AdminPublicApiKey::ApiVersion as u16,
);

/// API call from client to SPU
#[fluvio(encode_discriminant)]
#[derive(Encode, Decode, PartialEq, Debug, Clone, Copy)]
#[repr(u16)]
pub enum AdminPublicApiKey {
    ApiVersion = 18, // VERSIONS_API_KEY
    Create = 1001,
    Delete = 1002,
    List = 1003,
    Watch = 1004,
}

impl Default for AdminPublicApiKey {
    fn default() -> Self {
        Self::ApiVersion
    }
}