]> git.saurik.com Git - apple/security.git/blob - keychain/analytics/C2Metric/SECC2MPGenericEvent.h
Security-59754.60.13.tar.gz
[apple/security.git] / keychain / analytics / C2Metric / SECC2MPGenericEvent.h
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from C2Metric.proto
4
5 #import <Foundation/Foundation.h>
6 #import <ProtocolBuffer/PBCodable.h>
7
8 @class SECC2MPGenericEventMetric;
9
10 typedef NS_ENUM(int32_t, SECC2MPGenericEvent_Type) {
11 SECC2MPGenericEvent_Type_none = 0,
12 SECC2MPGenericEvent_Type_cloudkit = 101,
13 SECC2MPGenericEvent_Type_cloudkit_client = 201,
14 SECC2MPGenericEvent_Type_server = 301,
15 };
16 #ifdef __OBJC__
17 NS_INLINE NSString *SECC2MPGenericEvent_TypeAsString(SECC2MPGenericEvent_Type value)
18 {
19 switch (value)
20 {
21 case SECC2MPGenericEvent_Type_none: return @"none";
22 case SECC2MPGenericEvent_Type_cloudkit: return @"cloudkit";
23 case SECC2MPGenericEvent_Type_cloudkit_client: return @"cloudkit_client";
24 case SECC2MPGenericEvent_Type_server: return @"server";
25 default: return [NSString stringWithFormat:@"(unknown: %i)", value];
26 }
27 }
28 #endif /* __OBJC__ */
29 #ifdef __OBJC__
30 NS_INLINE SECC2MPGenericEvent_Type StringAsSECC2MPGenericEvent_Type(NSString *value)
31 {
32 if ([value isEqualToString:@"none"]) return SECC2MPGenericEvent_Type_none;
33 if ([value isEqualToString:@"cloudkit"]) return SECC2MPGenericEvent_Type_cloudkit;
34 if ([value isEqualToString:@"cloudkit_client"]) return SECC2MPGenericEvent_Type_cloudkit_client;
35 if ([value isEqualToString:@"server"]) return SECC2MPGenericEvent_Type_server;
36 return SECC2MPGenericEvent_Type_none;
37 }
38 #endif /* __OBJC__ */
39
40 #ifdef __cplusplus
41 #define SECC2MPGENERICEVENT_FUNCTION extern "C" __attribute__((visibility("hidden")))
42 #else
43 #define SECC2MPGENERICEVENT_FUNCTION extern __attribute__((visibility("hidden")))
44 #endif
45
46 __attribute__((visibility("hidden")))
47 @interface SECC2MPGenericEvent : PBCodable <NSCopying>
48 {
49 uint64_t _timestampEnd;
50 uint64_t _timestampStart;
51 NSMutableArray<SECC2MPGenericEventMetric *> *_metrics;
52 NSString *_name;
53 SECC2MPGenericEvent_Type _type;
54 struct {
55 int timestampEnd:1;
56 int timestampStart:1;
57 int type:1;
58 } _has;
59 }
60
61
62 @property (nonatomic) BOOL hasType;
63 @property (nonatomic) SECC2MPGenericEvent_Type type;
64 - (NSString *)typeAsString:(SECC2MPGenericEvent_Type)value;
65 - (SECC2MPGenericEvent_Type)StringAsType:(NSString *)str;
66
67 @property (nonatomic, readonly) BOOL hasName;
68 @property (nonatomic, retain) NSString *name;
69
70 @property (nonatomic) BOOL hasTimestampStart;
71 @property (nonatomic) uint64_t timestampStart;
72
73 @property (nonatomic) BOOL hasTimestampEnd;
74 @property (nonatomic) uint64_t timestampEnd;
75
76 @property (nonatomic, retain) NSMutableArray<SECC2MPGenericEventMetric *> *metrics;
77 - (void)clearMetrics;
78 - (void)addMetric:(SECC2MPGenericEventMetric *)i;
79 - (NSUInteger)metricsCount;
80 - (SECC2MPGenericEventMetric *)metricAtIndex:(NSUInteger)idx;
81 + (Class)metricType;
82
83 // Performs a shallow copy into other
84 - (void)copyTo:(SECC2MPGenericEvent *)other;
85
86 // Performs a deep merge from other into self
87 // If set in other, singular values in self are replaced in self
88 // Singular composite values are recursively merged
89 // Repeated values from other are appended to repeated values in self
90 - (void)mergeFrom:(SECC2MPGenericEvent *)other;
91
92 SECC2MPGENERICEVENT_FUNCTION BOOL SECC2MPGenericEventReadFrom(__unsafe_unretained SECC2MPGenericEvent *self, __unsafe_unretained PBDataReader *reader);
93
94 @end
95