// This file was automatically generated by protocompiler
// DO NOT EDIT!
// Compiled from C2Metric.proto

#import <Foundation/Foundation.h>
#import <ProtocolBuffer/PBCodable.h>

@class SECC2MPDeviceInfo;
@class SECC2MPCloudKitInfo;
@class SECC2MPServerInfo;
@class SECC2MPNetworkEvent;
@class SECC2MPGenericEvent;

typedef NS_ENUM(int32_t, SECC2MPMetric_Type) {
    SECC2MPMetric_Type_none_type = 0,
    SECC2MPMetric_Type_network_event_type = 200,
    SECC2MPMetric_Type_generic_event_type = 201,
};
#ifdef __OBJC__
NS_INLINE NSString *SECC2MPMetric_TypeAsString(SECC2MPMetric_Type value)
{
    switch (value)
    {
        case SECC2MPMetric_Type_none_type: return @"none_type";
        case SECC2MPMetric_Type_network_event_type: return @"network_event_type";
        case SECC2MPMetric_Type_generic_event_type: return @"generic_event_type";
        default: return [NSString stringWithFormat:@"(unknown: %i)", value];
    }
}
#endif /* __OBJC__ */
#ifdef __OBJC__
NS_INLINE SECC2MPMetric_Type StringAsSECC2MPMetric_Type(NSString *value)
{
    if ([value isEqualToString:@"none_type"]) return SECC2MPMetric_Type_none_type;
    if ([value isEqualToString:@"network_event_type"]) return SECC2MPMetric_Type_network_event_type;
    if ([value isEqualToString:@"generic_event_type"]) return SECC2MPMetric_Type_generic_event_type;
    return SECC2MPMetric_Type_none_type;
}
#endif /* __OBJC__ */
typedef NS_ENUM(int32_t, SECC2MPMetric_Trigger) {
    SECC2MPMetric_Trigger_none_trigger = 0,
    SECC2MPMetric_Trigger_user_default_trigger = 1,
    SECC2MPMetric_Trigger_frequency_trigger = 2,
    /** Can only trigger NetworkStatistic metrics. */
    SECC2MPMetric_Trigger_response_header_trigger = 4,
    SECC2MPMetric_Trigger_client_operation_frequency_trigger = 8,
    SECC2MPMetric_Trigger_operation_group_frequency_trigger = 16,
    SECC2MPMetric_Trigger_push_trigger = 32,
};
#ifdef __OBJC__
NS_INLINE NSString *SECC2MPMetric_TriggerAsString(SECC2MPMetric_Trigger value)
{
    switch (value)
    {
        case SECC2MPMetric_Trigger_none_trigger: return @"none_trigger";
        case SECC2MPMetric_Trigger_user_default_trigger: return @"user_default_trigger";
        case SECC2MPMetric_Trigger_frequency_trigger: return @"frequency_trigger";
        case SECC2MPMetric_Trigger_response_header_trigger: return @"response_header_trigger";
        case SECC2MPMetric_Trigger_client_operation_frequency_trigger: return @"client_operation_frequency_trigger";
        case SECC2MPMetric_Trigger_operation_group_frequency_trigger: return @"operation_group_frequency_trigger";
        case SECC2MPMetric_Trigger_push_trigger: return @"push_trigger";
        default: return [NSString stringWithFormat:@"(unknown: %i)", value];
    }
}
#endif /* __OBJC__ */
#ifdef __OBJC__
NS_INLINE SECC2MPMetric_Trigger StringAsSECC2MPMetric_Trigger(NSString *value)
{
    if ([value isEqualToString:@"none_trigger"]) return SECC2MPMetric_Trigger_none_trigger;
    if ([value isEqualToString:@"user_default_trigger"]) return SECC2MPMetric_Trigger_user_default_trigger;
    if ([value isEqualToString:@"frequency_trigger"]) return SECC2MPMetric_Trigger_frequency_trigger;
    if ([value isEqualToString:@"response_header_trigger"]) return SECC2MPMetric_Trigger_response_header_trigger;
    if ([value isEqualToString:@"client_operation_frequency_trigger"]) return SECC2MPMetric_Trigger_client_operation_frequency_trigger;
    if ([value isEqualToString:@"operation_group_frequency_trigger"]) return SECC2MPMetric_Trigger_operation_group_frequency_trigger;
    if ([value isEqualToString:@"push_trigger"]) return SECC2MPMetric_Trigger_push_trigger;
    return SECC2MPMetric_Trigger_none_trigger;
}
#endif /* __OBJC__ */

#ifdef __cplusplus
#define SECC2MPMETRIC_FUNCTION extern "C" __attribute__((visibility("hidden")))
#else
#define SECC2MPMETRIC_FUNCTION extern __attribute__((visibility("hidden")))
#endif

/** Deprecated. Use Metric.Trigger instead. */
__attribute__((visibility("hidden")))
@interface SECC2MPMetric : PBCodable <NSCopying>
{
    uint64_t _reportFrequency;
    uint64_t _reportFrequencyBase;
    uint64_t _triggers;
    SECC2MPCloudKitInfo *_cloudkitInfo;
    SECC2MPDeviceInfo *_deviceInfo;
    SECC2MPGenericEvent *_genericEvent;
    SECC2MPMetric_Type _metricType;
    SECC2MPNetworkEvent *_networkEvent;
    SECC2MPServerInfo *_serverInfo;
    struct {
        int reportFrequency:1;
        int reportFrequencyBase:1;
        int triggers:1;
        int metricType:1;
    } _has;
}


@property (nonatomic) BOOL hasMetricType;
@property (nonatomic) SECC2MPMetric_Type metricType;
- (NSString *)metricTypeAsString:(SECC2MPMetric_Type)value;
- (SECC2MPMetric_Type)StringAsMetricType:(NSString *)str;

@property (nonatomic, readonly) BOOL hasDeviceInfo;
@property (nonatomic, retain) SECC2MPDeviceInfo *deviceInfo;

@property (nonatomic, readonly) BOOL hasCloudkitInfo;
@property (nonatomic, retain) SECC2MPCloudKitInfo *cloudkitInfo;

@property (nonatomic, readonly) BOOL hasServerInfo;
@property (nonatomic, retain) SECC2MPServerInfo *serverInfo;

@property (nonatomic) BOOL hasTriggers;
@property (nonatomic) uint64_t triggers;

@property (nonatomic) BOOL hasReportFrequency;
@property (nonatomic) uint64_t reportFrequency;

@property (nonatomic) BOOL hasReportFrequencyBase;
@property (nonatomic) uint64_t reportFrequencyBase;

@property (nonatomic, readonly) BOOL hasNetworkEvent;
@property (nonatomic, retain) SECC2MPNetworkEvent *networkEvent;

@property (nonatomic, readonly) BOOL hasGenericEvent;
@property (nonatomic, retain) SECC2MPGenericEvent *genericEvent;

// Performs a shallow copy into other
- (void)copyTo:(SECC2MPMetric *)other;

// Performs a deep merge from other into self
// If set in other, singular values in self are replaced in self
// Singular composite values are recursively merged
// Repeated values from other are appended to repeated values in self
- (void)mergeFrom:(SECC2MPMetric *)other;

SECC2MPMETRIC_FUNCTION BOOL SECC2MPMetricReadFrom(__unsafe_unretained SECC2MPMetric *self, __unsafe_unretained PBDataReader *reader);

@end

