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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
// 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 = "fuchsia";
pub const CUSTOMER_ID: u32 = 1;
pub const PROJECT_NAME: &str = "software_delivery";
pub const PROJECT_ID: u32 = 4247972873;

// Linear bucket constants for cup_write hist
pub const CUP_WRITE_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const CUP_WRITE_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 10;
pub const CUP_WRITE_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for cup_getinfo hist
pub const CUP_GETINFO_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const CUP_GETINFO_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 20;
pub const CUP_GETINFO_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for load_persistent_eager_package hist
pub const LOAD_PERSISTENT_EAGER_PACKAGE_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const LOAD_PERSISTENT_EAGER_PACKAGE_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 20;
pub const LOAD_PERSISTENT_EAGER_PACKAGE_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for ota_start_migrated ota_start_hist
pub const OTA_START_MIGRATED_OTA_START_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const OTA_START_MIGRATED_OTA_START_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 50;
pub const OTA_START_MIGRATED_OTA_START_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for ota_result_attempts_migrated ota_result_attempts_hist
pub const OTA_RESULT_ATTEMPTS_MIGRATED_OTA_RESULT_ATTEMPTS_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const OTA_RESULT_ATTEMPTS_MIGRATED_OTA_RESULT_ATTEMPTS_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 50;
pub const OTA_RESULT_ATTEMPTS_MIGRATED_OTA_RESULT_ATTEMPTS_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Exponential bucket constants for ota_result_duration_migrated ota_result_duration_hist2
pub const OTA_RESULT_DURATION_MIGRATED_OTA_RESULT_DURATION_HIST2_INT_BUCKETS_FLOOR: i64 = 0;
pub const OTA_RESULT_DURATION_MIGRATED_OTA_RESULT_DURATION_HIST2_INT_BUCKETS_NUM_BUCKETS: u32 = 30;
pub const OTA_RESULT_DURATION_MIGRATED_OTA_RESULT_DURATION_HIST2_INT_BUCKETS_INITIAL_STEP: u32 = 1000;
pub const OTA_RESULT_DURATION_MIGRATED_OTA_RESULT_DURATION_HIST2_INT_BUCKETS_STEP_MULTIPLIER: u32 = 2;

// Linear bucket constants for fetch_blob_migrated fetch_blob_hist
pub const FETCH_BLOB_MIGRATED_FETCH_BLOB_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const FETCH_BLOB_MIGRATED_FETCH_BLOB_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 50;
pub const FETCH_BLOB_MIGRATED_FETCH_BLOB_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Exponential bucket constants for pkg_resolver_startup_duration_migrated pkg_resolver_startup_duration_hist2
pub const PKG_RESOLVER_STARTUP_DURATION_MIGRATED_PKG_RESOLVER_STARTUP_DURATION_HIST2_INT_BUCKETS_FLOOR: i64 = 0;
pub const PKG_RESOLVER_STARTUP_DURATION_MIGRATED_PKG_RESOLVER_STARTUP_DURATION_HIST2_INT_BUCKETS_NUM_BUCKETS: u32 = 30;
pub const PKG_RESOLVER_STARTUP_DURATION_MIGRATED_PKG_RESOLVER_STARTUP_DURATION_HIST2_INT_BUCKETS_INITIAL_STEP: u32 = 1000;
pub const PKG_RESOLVER_STARTUP_DURATION_MIGRATED_PKG_RESOLVER_STARTUP_DURATION_HIST2_INT_BUCKETS_STEP_MULTIPLIER: u32 = 2;

// Linear bucket constants for repository_manager_load_static_configs_migrated repository_manager_load_static_configs_hist
pub const REPOSITORY_MANAGER_LOAD_STATIC_CONFIGS_MIGRATED_REPOSITORY_MANAGER_LOAD_STATIC_CONFIGS_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const REPOSITORY_MANAGER_LOAD_STATIC_CONFIGS_MIGRATED_REPOSITORY_MANAGER_LOAD_STATIC_CONFIGS_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 30;
pub const REPOSITORY_MANAGER_LOAD_STATIC_CONFIGS_MIGRATED_REPOSITORY_MANAGER_LOAD_STATIC_CONFIGS_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for create_tuf_client_migrated create_tuf_client_hist
pub const CREATE_TUF_CLIENT_MIGRATED_CREATE_TUF_CLIENT_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const CREATE_TUF_CLIENT_MIGRATED_CREATE_TUF_CLIENT_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 30;
pub const CREATE_TUF_CLIENT_MIGRATED_CREATE_TUF_CLIENT_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for update_tuf_client_migrated update_tuf_client_hist
pub const UPDATE_TUF_CLIENT_MIGRATED_UPDATE_TUF_CLIENT_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const UPDATE_TUF_CLIENT_MIGRATED_UPDATE_TUF_CLIENT_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 50;
pub const UPDATE_TUF_CLIENT_MIGRATED_UPDATE_TUF_CLIENT_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Exponential bucket constants for resolve_duration_migrated resolve_duration_hist2
pub const RESOLVE_DURATION_MIGRATED_RESOLVE_DURATION_HIST2_INT_BUCKETS_FLOOR: i64 = 0;
pub const RESOLVE_DURATION_MIGRATED_RESOLVE_DURATION_HIST2_INT_BUCKETS_NUM_BUCKETS: u32 = 30;
pub const RESOLVE_DURATION_MIGRATED_RESOLVE_DURATION_HIST2_INT_BUCKETS_INITIAL_STEP: u32 = 1000;
pub const RESOLVE_DURATION_MIGRATED_RESOLVE_DURATION_HIST2_INT_BUCKETS_STEP_MULTIPLIER: u32 = 2;

// Linear bucket constants for pkg_cache_open_migrated pkg_cache_open_hist
pub const PKG_CACHE_OPEN_MIGRATED_PKG_CACHE_OPEN_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const PKG_CACHE_OPEN_MIGRATED_PKG_CACHE_OPEN_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 1000;
pub const PKG_CACHE_OPEN_MIGRATED_PKG_CACHE_OPEN_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for merkle_for_url_migrated merkle_for_url_hist
pub const MERKLE_FOR_URL_MIGRATED_MERKLE_FOR_URL_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const MERKLE_FOR_URL_MIGRATED_MERKLE_FOR_URL_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 1000;
pub const MERKLE_FOR_URL_MIGRATED_MERKLE_FOR_URL_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for update_channel_control_set_target_migrated update_channel_control_set_target_histogram
pub const UPDATE_CHANNEL_CONTROL_SET_TARGET_MIGRATED_UPDATE_CHANNEL_CONTROL_SET_TARGET_HISTOGRAM_INT_BUCKETS_FLOOR: i64 = 0;
pub const UPDATE_CHANNEL_CONTROL_SET_TARGET_MIGRATED_UPDATE_CHANNEL_CONTROL_SET_TARGET_HISTOGRAM_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
pub const UPDATE_CHANNEL_CONTROL_SET_TARGET_MIGRATED_UPDATE_CHANNEL_CONTROL_SET_TARGET_HISTOGRAM_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for update_manager_connection_migrated update_manager_connection_histogram
pub const UPDATE_MANAGER_CONNECTION_MIGRATED_UPDATE_MANAGER_CONNECTION_HISTOGRAM_INT_BUCKETS_FLOOR: i64 = 0;
pub const UPDATE_MANAGER_CONNECTION_MIGRATED_UPDATE_MANAGER_CONNECTION_HISTOGRAM_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
pub const UPDATE_MANAGER_CONNECTION_MIGRATED_UPDATE_MANAGER_CONNECTION_HISTOGRAM_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for update_manager_check_now_migrated update_manager_check_now_histogram
pub const UPDATE_MANAGER_CHECK_NOW_MIGRATED_UPDATE_MANAGER_CHECK_NOW_HISTOGRAM_INT_BUCKETS_FLOOR: i64 = 0;
pub const UPDATE_MANAGER_CHECK_NOW_MIGRATED_UPDATE_MANAGER_CHECK_NOW_HISTOGRAM_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
pub const UPDATE_MANAGER_CHECK_NOW_MIGRATED_UPDATE_MANAGER_CHECK_NOW_HISTOGRAM_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Exponential bucket constants for ota_verification_duration_migrated ota_verification_duration_histogram2
pub const OTA_VERIFICATION_DURATION_MIGRATED_OTA_VERIFICATION_DURATION_HISTOGRAM2_INT_BUCKETS_FLOOR: i64 = 0;
pub const OTA_VERIFICATION_DURATION_MIGRATED_OTA_VERIFICATION_DURATION_HISTOGRAM2_INT_BUCKETS_NUM_BUCKETS: u32 = 20;
pub const OTA_VERIFICATION_DURATION_MIGRATED_OTA_VERIFICATION_DURATION_HISTOGRAM2_INT_BUCKETS_INITIAL_STEP: u32 = 10000;
pub const OTA_VERIFICATION_DURATION_MIGRATED_OTA_VERIFICATION_DURATION_HISTOGRAM2_INT_BUCKETS_STEP_MULTIPLIER: u32 = 2;

// Linear bucket constants for ota_verification_failure_migrated per_device_linear_histogram
pub const OTA_VERIFICATION_FAILURE_MIGRATED_PER_DEVICE_LINEAR_HISTOGRAM_INT_BUCKETS_FLOOR: i64 = 0;
pub const OTA_VERIFICATION_FAILURE_MIGRATED_PER_DEVICE_LINEAR_HISTOGRAM_INT_BUCKETS_NUM_BUCKETS: u32 = 10;
pub const OTA_VERIFICATION_FAILURE_MIGRATED_PER_DEVICE_LINEAR_HISTOGRAM_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Linear bucket constants for resolve_status_migrated hist
pub const RESOLVE_STATUS_MIGRATED_HIST_INT_BUCKETS_FLOOR: i64 = 0;
pub const RESOLVE_STATUS_MIGRATED_HIST_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
pub const RESOLVE_STATUS_MIGRATED_HIST_INT_BUCKETS_STEP_SIZE: u32 = 1;

// Metric ID Constants
// cup_write
pub const CUP_WRITE_METRIC_ID: u32 = 25;
// cup_getinfo
pub const CUP_GETINFO_METRIC_ID: u32 = 26;
// load_persistent_eager_package
pub const LOAD_PERSISTENT_EAGER_PACKAGE_METRIC_ID: u32 = 27;
// ota_start_migrated
pub const OTA_START_MIGRATED_METRIC_ID: u32 = 102;
// ota_result_attempts_migrated
pub const OTA_RESULT_ATTEMPTS_MIGRATED_METRIC_ID: u32 = 103;
// ota_result_duration_migrated
pub const OTA_RESULT_DURATION_MIGRATED_METRIC_ID: u32 = 104;
// fetch_blob_migrated
pub const FETCH_BLOB_MIGRATED_METRIC_ID: u32 = 106;
// pkg_resolver_startup_duration_migrated
pub const PKG_RESOLVER_STARTUP_DURATION_MIGRATED_METRIC_ID: u32 = 109;
// repository_manager_load_static_configs_migrated
pub const REPOSITORY_MANAGER_LOAD_STATIC_CONFIGS_MIGRATED_METRIC_ID: u32 = 110;
// create_tuf_client_migrated
pub const CREATE_TUF_CLIENT_MIGRATED_METRIC_ID: u32 = 112;
// update_tuf_client_migrated
pub const UPDATE_TUF_CLIENT_MIGRATED_METRIC_ID: u32 = 113;
// resolve_duration_migrated
pub const RESOLVE_DURATION_MIGRATED_METRIC_ID: u32 = 115;
// pkg_cache_open_migrated
pub const PKG_CACHE_OPEN_MIGRATED_METRIC_ID: u32 = 116;
// merkle_for_url_migrated
pub const MERKLE_FOR_URL_MIGRATED_METRIC_ID: u32 = 117;
// update_channel_control_set_target_migrated
pub const UPDATE_CHANNEL_CONTROL_SET_TARGET_MIGRATED_METRIC_ID: u32 = 118;
// update_manager_connection_migrated
pub const UPDATE_MANAGER_CONNECTION_MIGRATED_METRIC_ID: u32 = 119;
// update_manager_check_now_migrated
pub const UPDATE_MANAGER_CHECK_NOW_MIGRATED_METRIC_ID: u32 = 120;
// ota_verification_duration_migrated
pub const OTA_VERIFICATION_DURATION_MIGRATED_METRIC_ID: u32 = 121;
// ota_verification_failure_migrated
pub const OTA_VERIFICATION_FAILURE_MIGRATED_METRIC_ID: u32 = 122;
// resolve_status_migrated
pub const RESOLVE_STATUS_MIGRATED_METRIC_ID: u32 = 123;

// Enum for cup_write (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum CupWriteMetricDimensionResult {
  Success = 1,
  UnknownUrl = 2,
  Verification = 3,
  Download = 4,
  Storage = 5,
}

impl cobalt_client::traits::AsEventCode for CupWriteMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Enum for cup_getinfo (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum CupGetinfoMetricDimensionResult {
  Success = 1,
  UnknownUrl = 2,
  Verification = 3,
  NotAvailable = 4,
}

impl cobalt_client::traits::AsEventCode for CupGetinfoMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Enum for load_persistent_eager_package (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum LoadPersistentEagerPackageMetricDimensionResult {
  Success = 1,
  SuccessFallback = 2,
  NotAvailable = 3,
  Storage = 4,
  Verification = 5,
  Compatibility = 6,
  Resolve = 7,
}

impl cobalt_client::traits::AsEventCode for LoadPersistentEagerPackageMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Enum for software_delivery (Metric Dimension initiator)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum SoftwareDeliveryMetricDimensionInitiator {
  AutomaticUpdateCheck = 0,
  UserInitiatedCheck = 1,
}

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

// Alias for ota_result_attempts_migrated (Metric Dimension initiator) which has the same event codes
pub use SoftwareDeliveryMetricDimensionInitiator as OtaResultAttemptsMigratedMetricDimensionInitiator;

// Alias for ota_result_duration_migrated (Metric Dimension initiator) which has the same event codes
pub use SoftwareDeliveryMetricDimensionInitiator as OtaResultDurationMigratedMetricDimensionInitiator;

// Enum for software_delivery (Metric Dimension phase)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum SoftwareDeliveryMetricDimensionPhase {
  Tufupdate = 1,
  PackageDownload = 2,
  ImageWrite = 3,
  SuccessPendingReboot = 4,
  Success = 5,
  ImageCommit = 6,
}

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

// Alias for ota_result_duration_migrated (Metric Dimension phase) which has the same event codes
pub use SoftwareDeliveryMetricDimensionPhase as OtaResultDurationMigratedMetricDimensionPhase;

// Enum for software_delivery (Metric Dimension status_code)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum SoftwareDeliveryMetricDimensionStatusCode {
  Success = 0,
  Error = 1,
  ErrorStorage = 2,
  ErrorStorageOutOfSpace = 3,
  ErrorNetworking = 4,
  ErrorUntrustedTufRepo = 5,
  Canceled = 6,
}

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

// Alias for ota_result_duration_migrated (Metric Dimension status_code) which has the same event codes
pub use SoftwareDeliveryMetricDimensionStatusCode as OtaResultDurationMigratedMetricDimensionStatusCode;

// Enum for fetch_blob_migrated (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum FetchBlobMigratedMetricDimensionResult {
  Success = 0,
  CreateBlob = 1,
  BadHttpStatus = 2,
  NoMirrors = 3,
  ContentLengthMismatch = 4,
  UnknownLength = 5,
  BlobTooSmall = 6,
  BlobTooLarge = 7,
  Truncate = 8,
  Write = 9,
  Hyper = 10,
  Http = 11,
  BlobUrl = 12,
  FidlError = 13,
  IoError = 14,
  LocalMirror = 15,
  NoBlobSource = 16,
  ConflictingBlobSources = 17,
  BlobHeaderDeadlineExceeded = 18,
  BlobBodyDeadlineExceeded = 19,
  HttpBadRequest = 20,
  HttpUnauthorized = 21,
  HttpForbidden = 22,
  HttpNotFound = 23,
  HttpMethodNotAllowed = 24,
  HttpRequestTimeout = 25,
  HttpPreconditionFailed = 26,
  HttpRangeNotSatisfiable = 27,
  HttpTooManyRequests = 28,
  HttpInternalServerError = 29,
  HttpBadGateway = 30,
  HttpServiceUnavailable = 31,
  HttpGatewayTimeout = 32,
  Http1xx = 33,
  Http2xx = 34,
  Http3xx = 35,
  Http4xx = 36,
  Http5xx = 37,
  ExpectedHttpStatus206 = 38,
  MissingContentRangeHeader = 39,
  MalformedContentRangeHeader = 40,
  InvalidContentRangeHeader = 41,
  ExceededResumptionAttemptLimit = 42,
  ContentLengthContentRangeMismatch = 43,
  BlobWritten = 44,
}

impl cobalt_client::traits::AsEventCode for FetchBlobMigratedMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Enum for software_delivery (Metric Dimension resumed)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum SoftwareDeliveryMetricDimensionResumed {
  Unset = 0,
  False = 1,
  True = 2,
}

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

// Enum for repository_manager_load_static_configs_migrated (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum RepositoryManagerLoadStaticConfigsMigratedMetricDimensionResult {
  Success = 0,
  Io = 1,
  Parse = 2,
  Overridden = 3,
}

impl cobalt_client::traits::AsEventCode for RepositoryManagerLoadStaticConfigsMigratedMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Enum for create_tuf_client_migrated (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum CreateTufClientMigratedMetricDimensionResult {
  Success = 0,
  BadSignature = 1,
  Encoding = 2,
  ExpiredMetadata = 3,
  IllegalArgument = 4,
  MissingMetadata = 5,
  NoSupportedHashAlgorithm = 6,
  NotFound = 7,
  Opaque = 8,
  Programming = 9,
  TargetUnavailable = 10,
  UnknownHashAlgorithm = 11,
  UnknownKeyType = 12,
  VerificationFailure = 13,
  Http = 14,
  Hyper = 15,
  DeadlineExceeded = 16,
  HttpBadRequest = 17,
  HttpUnauthorized = 18,
  HttpForbidden = 19,
  HttpNotFound = 20,
  HttpMethodNotAllowed = 21,
  HttpRequestTimeout = 22,
  HttpPreconditionFailed = 23,
  HttpRangeNotSatisfiable = 24,
  HttpTooManyRequests = 25,
  HttpInternalServerError = 26,
  HttpBadGateway = 27,
  HttpServiceUnavailable = 28,
  HttpGatewayTimeout = 29,
  Http1xx = 30,
  Http2xx = 31,
  Http3xx = 32,
  Http4xx = 33,
  Http5xx = 34,
  UnexpectedTufErrorVariant = 32767,
}

impl cobalt_client::traits::AsEventCode for CreateTufClientMigratedMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Alias for update_tuf_client_migrated (Metric Dimension result) which has the same event codes
pub use CreateTufClientMigratedMetricDimensionResult as UpdateTufClientMigratedMetricDimensionResult;

// Enum for resolve_duration_migrated (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum ResolveDurationMigratedMetricDimensionResult {
  Success = 0,
  Failure = 1,
}

impl cobalt_client::traits::AsEventCode for ResolveDurationMigratedMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Enum for software_delivery (Metric Dimension resolver_type)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum SoftwareDeliveryMetricDimensionResolverType {
  Regular = 0,
  Font = 1,
}

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

// Enum for pkg_cache_open_migrated (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum PkgCacheOpenMigratedMetricDimensionResult {
  Success = 0,
  NotFound = 1,
  Io = 2,
}

impl cobalt_client::traits::AsEventCode for PkgCacheOpenMigratedMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Enum for merkle_for_url_migrated (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum MerkleForUrlMigratedMetricDimensionResult {
  Success = 0,
  Fidl = 1,
  NotFound = 2,
  UnexpectedStatus = 3,
  TufError = 4,
  ParseError = 5,
  BlobTooLarge = 6,
  InvalidTargetPath = 7,
  NoCustomMetadata = 8,
  SerdeError = 9,
}

impl cobalt_client::traits::AsEventCode for MerkleForUrlMigratedMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Enum for update_channel_control_set_target_migrated (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum UpdateChannelControlSetTargetMigratedMetricDimensionResult {
  Success = 0,
}

impl cobalt_client::traits::AsEventCode for UpdateChannelControlSetTargetMigratedMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Alias for update_manager_connection_migrated (Metric Dimension result) which has the same event codes
pub use UpdateChannelControlSetTargetMigratedMetricDimensionResult as UpdateManagerConnectionMigratedMetricDimensionResult;

// Enum for update_manager_check_now_migrated (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum UpdateManagerCheckNowMigratedMetricDimensionResult {
  Success = 0,
  Internal = 1,
  InvalidOptions = 2,
  AlreadyInProgress = 3,
  Throttled = 4,
}

impl cobalt_client::traits::AsEventCode for UpdateManagerCheckNowMigratedMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Enum for ota_verification_duration_migrated (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum OtaVerificationDurationMigratedMetricDimensionResult {
  Success = 0,
  FailureBlobfs = 1,
  FailureNetstack = 2,
}

impl cobalt_client::traits::AsEventCode for OtaVerificationDurationMigratedMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Alias for ota_verification_failure_migrated (Metric Dimension result) which has the same event codes
pub use OtaVerificationDurationMigratedMetricDimensionResult as OtaVerificationFailureMigratedMetricDimensionResult;

// Enum for software_delivery (Metric Dimension reason)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum SoftwareDeliveryMetricDimensionReason {
  Unreported = 0,
  Verify = 1,
  Fidl = 2,
  Timeout = 3,
}

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

// Enum for resolve_status_migrated (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum ResolveStatusMigratedMetricDimensionResult {
  Unset = 0,
  Success = 1,
  Internal = 2,
  AccessDenied = 3,
  Io = 4,
  BlobNotFound = 5,
  PackageNotFound = 6,
  RepoNotFound = 7,
  NoSpace = 8,
  UnavailableBlob = 9,
  UnavailableRepoMetadata = 10,
  InvalidUrl = 11,
  InvalidContext = 12,
}

impl cobalt_client::traits::AsEventCode for ResolveStatusMigratedMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub struct OtaResultAttemptsMigratedEventCodes {
  pub initiator: OtaResultAttemptsMigratedMetricDimensionInitiator,
  pub phase: OtaResultAttemptsMigratedMetricDimensionPhase,
  pub status_code: OtaResultAttemptsMigratedMetricDimensionStatusCode,
}

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

#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub struct OtaResultDurationMigratedEventCodes {
  pub initiator: OtaResultDurationMigratedMetricDimensionInitiator,
  pub phase: OtaResultDurationMigratedMetricDimensionPhase,
  pub status_code: OtaResultDurationMigratedMetricDimensionStatusCode,
}

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

#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub struct FetchBlobMigratedEventCodes {
  pub result: FetchBlobMigratedMetricDimensionResult,
  pub resumed: FetchBlobMigratedMetricDimensionResumed,
}

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

#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub struct ResolveDurationMigratedEventCodes {
  pub result: ResolveDurationMigratedMetricDimensionResult,
  pub resolver_type: ResolveDurationMigratedMetricDimensionResolverType,
}

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

#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub struct OtaVerificationFailureMigratedEventCodes {
  pub result: OtaVerificationFailureMigratedMetricDimensionResult,
  pub reason: OtaVerificationFailureMigratedMetricDimensionReason,
}

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