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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// This file was generated by Cobalt's Registry parser based on the registry YAML
// in the cobalt_config repository. Edit the YAML there to make changes.
pub const CUSTOMER_NAME: &str = "test";
pub const CUSTOMER_ID: u32 = 1;
pub const PROJECT_NAME: &str = "test";
pub const PROJECT_ID: u32 = 1;

// Metric ID Constants
// a_test_metric
pub const A_TEST_METRIC_METRIC_ID: u32 = 1;

// Enum for test (Metric Dimension dim_1)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum TestMetricDimensionDim1 {
  Unknown = 1,
  Known = 2,
}

impl cobalt_client::traits::AsEventCode for TestMetricDimensionDim1 {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}
// Alias for a_test_metric (Metric Dimension dim_1) which has the same event codes
pub use TestMetricDimensionDim1 as ATestMetricMetricDimensionDim1;

// Enum for test (Metric Dimension dim_2)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum TestMetricDimensionDim2 {
  A = 1,
  B = 2,
  C = 3,
}

impl cobalt_client::traits::AsEventCode for TestMetricDimensionDim2 {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}
// Alias for a_test_metric (Metric Dimension dim_2) which has the same event codes
pub use TestMetricDimensionDim2 as ATestMetricMetricDimensionDim2;

#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub struct ATestMetricEventCodes {
  pub dim_1: ATestMetricMetricDimensionDim1,
  pub dim_2: ATestMetricMetricDimensionDim2,
}

impl cobalt_client::traits::AsEventCodes for ATestMetricEventCodes {
  fn as_event_codes(&self) -> Vec<u32> {
    use cobalt_client::traits::AsEventCode;
    vec![
      self.dim_1.as_event_code(),
      self.dim_2.as_event_code(),
    ]
  }
}