1 // This file was automatically generated by protocompiler
3 // Compiled from C2Metric.proto
5 #import <Foundation/Foundation.h>
6 #import <ProtocolBuffer/PBCodable.h>
8 @
class SECC2MPDeviceInfo
;
9 @
class SECC2MPCloudKitInfo
;
10 @
class SECC2MPServerInfo
;
11 @
class SECC2MPNetworkEvent
;
12 @
class SECC2MPGenericEvent
;
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,
20 NS_INLINE NSString
*SECC2MPMetric_TypeAsString(SECC2MPMetric_Type value
)
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
];
32 NS_INLINE SECC2MPMetric_Type
StringAsSECC2MPMetric_Type(NSString
*value
)
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
;
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,
51 NS_INLINE NSString
*SECC2MPMetric_TriggerAsString(SECC2MPMetric_Trigger value
)
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
];
67 NS_INLINE SECC2MPMetric_Trigger
StringAsSECC2MPMetric_Trigger(NSString
*value
)
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
;
81 #define SECC2MPMETRIC_FUNCTION extern "C" __attribute__((visibility("hidden")))
83 #define SECC2MPMETRIC_FUNCTION extern __attribute__((visibility("hidden")))
86 /** Deprecated. Use Metric.Trigger instead. */
87 __attribute__((visibility("hidden")))
88 @interface SECC2MPMetric
: PBCodable
<NSCopying
>
90 uint64_t _reportFrequency
;
91 uint64_t _reportFrequencyBase
;
93 SECC2MPCloudKitInfo
*_cloudkitInfo
;
94 SECC2MPDeviceInfo
*_deviceInfo
;
95 SECC2MPGenericEvent
*_genericEvent
;
96 SECC2MPMetric_Type _metricType
;
97 SECC2MPNetworkEvent
*_networkEvent
;
98 SECC2MPServerInfo
*_serverInfo
;
100 int reportFrequency
:1;
101 int reportFrequencyBase
:1;
108 @
property (nonatomic
) BOOL hasMetricType
;
109 @
property (nonatomic
) SECC2MPMetric_Type metricType
;
110 - (NSString
*)metricTypeAsString
:(SECC2MPMetric_Type
)value
;
111 - (SECC2MPMetric_Type
)StringAsMetricType
:(NSString
*)str
;
113 @
property (nonatomic
, readonly
) BOOL hasDeviceInfo
;
114 @
property (nonatomic
, retain
) SECC2MPDeviceInfo
*deviceInfo
;
116 @
property (nonatomic
, readonly
) BOOL hasCloudkitInfo
;
117 @
property (nonatomic
, retain
) SECC2MPCloudKitInfo
*cloudkitInfo
;
119 @
property (nonatomic
, readonly
) BOOL hasServerInfo
;
120 @
property (nonatomic
, retain
) SECC2MPServerInfo
*serverInfo
;
122 @
property (nonatomic
) BOOL hasTriggers
;
123 @
property (nonatomic
) uint64_t triggers
;
125 @
property (nonatomic
) BOOL hasReportFrequency
;
126 @
property (nonatomic
) uint64_t reportFrequency
;
128 @
property (nonatomic
) BOOL hasReportFrequencyBase
;
129 @
property (nonatomic
) uint64_t reportFrequencyBase
;
131 @
property (nonatomic
, readonly
) BOOL hasNetworkEvent
;
132 @
property (nonatomic
, retain
) SECC2MPNetworkEvent
*networkEvent
;
134 @
property (nonatomic
, readonly
) BOOL hasGenericEvent
;
135 @
property (nonatomic
, retain
) SECC2MPGenericEvent
*genericEvent
;
137 // Performs a shallow copy into other
138 - (void)copyTo
:(SECC2MPMetric
*)other
;
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
;
146 SECC2MPMETRIC_FUNCTION BOOL
SECC2MPMetricReadFrom(__unsafe_unretained SECC2MPMetric
*self
, __unsafe_unretained PBDataReader
*reader
);