]> git.saurik.com Git - apple/security.git/blob - keychain/analytics/C2Metric/SECC2MPMetric.h
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / analytics / C2Metric / SECC2MPMetric.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 SECC2MPDeviceInfo;
9 @class SECC2MPCloudKitInfo;
10 @class SECC2MPServerInfo;
11 @class SECC2MPNetworkEvent;
12 @class SECC2MPGenericEvent;
13
14 typedef NS_ENUM(int32_t, SECC2MPMetric_Type) {
15 SECC2MPMetric_Type_none_type = 0,
16 SECC2MPMetric_Type_network_event_type = 200,
17 SECC2MPMetric_Type_generic_event_type = 201,
18 };
19 #ifdef __OBJC__
20 NS_INLINE NSString *SECC2MPMetric_TypeAsString(SECC2MPMetric_Type value)
21 {
22 switch (value)
23 {
24 case SECC2MPMetric_Type_none_type: return @"none_type";
25 case SECC2MPMetric_Type_network_event_type: return @"network_event_type";
26 case SECC2MPMetric_Type_generic_event_type: return @"generic_event_type";
27 default: return [NSString stringWithFormat:@"(unknown: %i)", value];
28 }
29 }
30 #endif /* __OBJC__ */
31 #ifdef __OBJC__
32 NS_INLINE SECC2MPMetric_Type StringAsSECC2MPMetric_Type(NSString *value)
33 {
34 if ([value isEqualToString:@"none_type"]) return SECC2MPMetric_Type_none_type;
35 if ([value isEqualToString:@"network_event_type"]) return SECC2MPMetric_Type_network_event_type;
36 if ([value isEqualToString:@"generic_event_type"]) return SECC2MPMetric_Type_generic_event_type;
37 return SECC2MPMetric_Type_none_type;
38 }
39 #endif /* __OBJC__ */
40 typedef NS_ENUM(int32_t, SECC2MPMetric_Trigger) {
41 SECC2MPMetric_Trigger_none_trigger = 0,
42 SECC2MPMetric_Trigger_user_default_trigger = 1,
43 SECC2MPMetric_Trigger_frequency_trigger = 2,
44 /** Can only trigger NetworkStatistic metrics. */
45 SECC2MPMetric_Trigger_response_header_trigger = 4,
46 SECC2MPMetric_Trigger_client_operation_frequency_trigger = 8,
47 SECC2MPMetric_Trigger_operation_group_frequency_trigger = 16,
48 SECC2MPMetric_Trigger_push_trigger = 32,
49 };
50 #ifdef __OBJC__
51 NS_INLINE NSString *SECC2MPMetric_TriggerAsString(SECC2MPMetric_Trigger value)
52 {
53 switch (value)
54 {
55 case SECC2MPMetric_Trigger_none_trigger: return @"none_trigger";
56 case SECC2MPMetric_Trigger_user_default_trigger: return @"user_default_trigger";
57 case SECC2MPMetric_Trigger_frequency_trigger: return @"frequency_trigger";
58 case SECC2MPMetric_Trigger_response_header_trigger: return @"response_header_trigger";
59 case SECC2MPMetric_Trigger_client_operation_frequency_trigger: return @"client_operation_frequency_trigger";
60 case SECC2MPMetric_Trigger_operation_group_frequency_trigger: return @"operation_group_frequency_trigger";
61 case SECC2MPMetric_Trigger_push_trigger: return @"push_trigger";
62 default: return [NSString stringWithFormat:@"(unknown: %i)", value];
63 }
64 }
65 #endif /* __OBJC__ */
66 #ifdef __OBJC__
67 NS_INLINE SECC2MPMetric_Trigger StringAsSECC2MPMetric_Trigger(NSString *value)
68 {
69 if ([value isEqualToString:@"none_trigger"]) return SECC2MPMetric_Trigger_none_trigger;
70 if ([value isEqualToString:@"user_default_trigger"]) return SECC2MPMetric_Trigger_user_default_trigger;
71 if ([value isEqualToString:@"frequency_trigger"]) return SECC2MPMetric_Trigger_frequency_trigger;
72 if ([value isEqualToString:@"response_header_trigger"]) return SECC2MPMetric_Trigger_response_header_trigger;
73 if ([value isEqualToString:@"client_operation_frequency_trigger"]) return SECC2MPMetric_Trigger_client_operation_frequency_trigger;
74 if ([value isEqualToString:@"operation_group_frequency_trigger"]) return SECC2MPMetric_Trigger_operation_group_frequency_trigger;
75 if ([value isEqualToString:@"push_trigger"]) return SECC2MPMetric_Trigger_push_trigger;
76 return SECC2MPMetric_Trigger_none_trigger;
77 }
78 #endif /* __OBJC__ */
79
80 #ifdef __cplusplus
81 #define SECC2MPMETRIC_FUNCTION extern "C" __attribute__((visibility("hidden")))
82 #else
83 #define SECC2MPMETRIC_FUNCTION extern __attribute__((visibility("hidden")))
84 #endif
85
86 /** Deprecated. Use Metric.Trigger instead. */
87 __attribute__((visibility("hidden")))
88 @interface SECC2MPMetric : PBCodable <NSCopying>
89 {
90 uint64_t _reportFrequency;
91 uint64_t _reportFrequencyBase;
92 uint64_t _triggers;
93 SECC2MPCloudKitInfo *_cloudkitInfo;
94 SECC2MPDeviceInfo *_deviceInfo;
95 SECC2MPGenericEvent *_genericEvent;
96 SECC2MPMetric_Type _metricType;
97 SECC2MPNetworkEvent *_networkEvent;
98 SECC2MPServerInfo *_serverInfo;
99 struct {
100 int reportFrequency:1;
101 int reportFrequencyBase:1;
102 int triggers:1;
103 int metricType:1;
104 } _has;
105 }
106
107
108 @property (nonatomic) BOOL hasMetricType;
109 @property (nonatomic) SECC2MPMetric_Type metricType;
110 - (NSString *)metricTypeAsString:(SECC2MPMetric_Type)value;
111 - (SECC2MPMetric_Type)StringAsMetricType:(NSString *)str;
112
113 @property (nonatomic, readonly) BOOL hasDeviceInfo;
114 @property (nonatomic, retain) SECC2MPDeviceInfo *deviceInfo;
115
116 @property (nonatomic, readonly) BOOL hasCloudkitInfo;
117 @property (nonatomic, retain) SECC2MPCloudKitInfo *cloudkitInfo;
118
119 @property (nonatomic, readonly) BOOL hasServerInfo;
120 @property (nonatomic, retain) SECC2MPServerInfo *serverInfo;
121
122 @property (nonatomic) BOOL hasTriggers;
123 @property (nonatomic) uint64_t triggers;
124
125 @property (nonatomic) BOOL hasReportFrequency;
126 @property (nonatomic) uint64_t reportFrequency;
127
128 @property (nonatomic) BOOL hasReportFrequencyBase;
129 @property (nonatomic) uint64_t reportFrequencyBase;
130
131 @property (nonatomic, readonly) BOOL hasNetworkEvent;
132 @property (nonatomic, retain) SECC2MPNetworkEvent *networkEvent;
133
134 @property (nonatomic, readonly) BOOL hasGenericEvent;
135 @property (nonatomic, retain) SECC2MPGenericEvent *genericEvent;
136
137 // Performs a shallow copy into other
138 - (void)copyTo:(SECC2MPMetric *)other;
139
140 // Performs a deep merge from other into self
141 // If set in other, singular values in self are replaced in self
142 // Singular composite values are recursively merged
143 // Repeated values from other are appended to repeated values in self
144 - (void)mergeFrom:(SECC2MPMetric *)other;
145
146 SECC2MPMETRIC_FUNCTION BOOL SECC2MPMetricReadFrom(__unsafe_unretained SECC2MPMetric *self, __unsafe_unretained PBDataReader *reader);
147
148 @end
149