1 // This file was automatically generated by protocompiler
3 // Compiled from C2Metric.proto
5 #import "SECC2MPCloudKitInfo.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
10 #import "SECC2MPCloudKitOperationGroupInfo.h"
11 #import "SECC2MPCloudKitOperationInfo.h"
13 #if !__has_feature(objc_arc)
14 # error This generated file depends on ARC but it is not enabled; turn on ARC, or use 'objc_use_arc' option to generate non-ARC code.
17 @implementation SECC2MPCloudKitInfo
19 - (BOOL)hasClientProcessVersion
21 return _clientProcessVersion != nil;
23 @synthesize clientProcessVersion = _clientProcessVersion;
24 - (BOOL)hasClientBundleId
26 return _clientBundleId != nil;
28 @synthesize clientBundleId = _clientBundleId;
31 return _container != nil;
33 @synthesize container = _container;
34 - (BOOL)hasEnvironment
36 return _environment != nil;
38 @synthesize environment = _environment;
39 @synthesize anonymous = _anonymous;
40 - (void)setAnonymous:(BOOL)v
45 - (void)setHasAnonymous:(BOOL)f
51 return _has.anonymous;
53 @synthesize operationGroups = _operationGroups;
54 - (void)clearOperationGroups
56 [_operationGroups removeAllObjects];
58 - (void)addOperationGroup:(SECC2MPCloudKitOperationGroupInfo *)i
60 if (!_operationGroups)
62 _operationGroups = [[NSMutableArray alloc] init];
64 [_operationGroups addObject:i];
66 - (NSUInteger)operationGroupsCount
68 return [_operationGroups count];
70 - (SECC2MPCloudKitOperationGroupInfo *)operationGroupAtIndex:(NSUInteger)idx
72 return [_operationGroups objectAtIndex:idx];
74 + (Class)operationGroupType
76 return [SECC2MPCloudKitOperationGroupInfo class];
78 @synthesize reportOperationGroupFrequency = _reportOperationGroupFrequency;
79 - (void)setReportOperationGroupFrequency:(uint64_t)v
81 _has.reportOperationGroupFrequency = YES;
82 _reportOperationGroupFrequency = v;
84 - (void)setHasReportOperationGroupFrequency:(BOOL)f
86 _has.reportOperationGroupFrequency = f;
88 - (BOOL)hasReportOperationGroupFrequency
90 return _has.reportOperationGroupFrequency;
92 @synthesize reportOperationGroupFrequencyBase = _reportOperationGroupFrequencyBase;
93 - (void)setReportOperationGroupFrequencyBase:(uint64_t)v
95 _has.reportOperationGroupFrequencyBase = YES;
96 _reportOperationGroupFrequencyBase = v;
98 - (void)setHasReportOperationGroupFrequencyBase:(BOOL)f
100 _has.reportOperationGroupFrequencyBase = f;
102 - (BOOL)hasReportOperationGroupFrequencyBase
104 return _has.reportOperationGroupFrequencyBase;
106 @synthesize clientOperations = _clientOperations;
107 - (void)clearClientOperations
109 [_clientOperations removeAllObjects];
111 - (void)addClientOperation:(SECC2MPCloudKitOperationInfo *)i
113 if (!_clientOperations)
115 _clientOperations = [[NSMutableArray alloc] init];
117 [_clientOperations addObject:i];
119 - (NSUInteger)clientOperationsCount
121 return [_clientOperations count];
123 - (SECC2MPCloudKitOperationInfo *)clientOperationAtIndex:(NSUInteger)idx
125 return [_clientOperations objectAtIndex:idx];
127 + (Class)clientOperationType
129 return [SECC2MPCloudKitOperationInfo class];
131 @synthesize reportClientOperationFrequency = _reportClientOperationFrequency;
132 - (void)setReportClientOperationFrequency:(uint64_t)v
134 _has.reportClientOperationFrequency = YES;
135 _reportClientOperationFrequency = v;
137 - (void)setHasReportClientOperationFrequency:(BOOL)f
139 _has.reportClientOperationFrequency = f;
141 - (BOOL)hasReportClientOperationFrequency
143 return _has.reportClientOperationFrequency;
145 @synthesize reportClientOperationFrequencyBase = _reportClientOperationFrequencyBase;
146 - (void)setReportClientOperationFrequencyBase:(uint64_t)v
148 _has.reportClientOperationFrequencyBase = YES;
149 _reportClientOperationFrequencyBase = v;
151 - (void)setHasReportClientOperationFrequencyBase:(BOOL)f
153 _has.reportClientOperationFrequencyBase = f;
155 - (BOOL)hasReportClientOperationFrequencyBase
157 return _has.reportClientOperationFrequencyBase;
160 - (NSString *)description
162 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
165 - (NSDictionary *)dictionaryRepresentation
167 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
168 if (self->_clientProcessVersion)
170 [dict setObject:self->_clientProcessVersion forKey:@"client_process_version"];
172 if (self->_clientBundleId)
174 [dict setObject:self->_clientBundleId forKey:@"client_bundle_id"];
176 if (self->_container)
178 [dict setObject:self->_container forKey:@"container"];
180 if (self->_environment)
182 [dict setObject:self->_environment forKey:@"environment"];
184 if (self->_has.anonymous)
186 [dict setObject:[NSNumber numberWithBool:self->_anonymous] forKey:@"anonymous"];
188 if ([self->_operationGroups count])
190 NSMutableArray *operationGroupsDictReprs = [[NSMutableArray alloc] initWithCapacity:[self->_operationGroups count]];
191 for (SECC2MPCloudKitOperationGroupInfo *i_operationGroup in self->_operationGroups)
193 [operationGroupsDictReprs addObject:[i_operationGroup dictionaryRepresentation]];
195 [dict setObject:operationGroupsDictReprs forKey:@"operation_group"];
197 if (self->_has.reportOperationGroupFrequency)
199 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_reportOperationGroupFrequency] forKey:@"report_operation_group_frequency"];
201 if (self->_has.reportOperationGroupFrequencyBase)
203 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_reportOperationGroupFrequencyBase] forKey:@"report_operation_group_frequency_base"];
205 if ([self->_clientOperations count])
207 NSMutableArray *clientOperationsDictReprs = [[NSMutableArray alloc] initWithCapacity:[self->_clientOperations count]];
208 for (SECC2MPCloudKitOperationInfo *i_clientOperation in self->_clientOperations)
210 [clientOperationsDictReprs addObject:[i_clientOperation dictionaryRepresentation]];
212 [dict setObject:clientOperationsDictReprs forKey:@"client_operation"];
214 if (self->_has.reportClientOperationFrequency)
216 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_reportClientOperationFrequency] forKey:@"report_client_operation_frequency"];
218 if (self->_has.reportClientOperationFrequencyBase)
220 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_reportClientOperationFrequencyBase] forKey:@"report_client_operation_frequency_base"];
225 BOOL SECC2MPCloudKitInfoReadFrom(__unsafe_unretained SECC2MPCloudKitInfo *self, __unsafe_unretained PBDataReader *reader) {
226 while (PBReaderHasMoreData(reader)) {
230 PBReaderReadTag32AndType(reader, &tag, &aType);
232 if (PBReaderHasError(reader))
235 if (aType == TYPE_END_GROUP) {
241 case 102 /* clientProcessVersion */:
243 NSString *new_clientProcessVersion = PBReaderReadString(reader);
244 self->_clientProcessVersion = new_clientProcessVersion;
247 case 103 /* clientBundleId */:
249 NSString *new_clientBundleId = PBReaderReadString(reader);
250 self->_clientBundleId = new_clientBundleId;
253 case 201 /* container */:
255 NSString *new_container = PBReaderReadString(reader);
256 self->_container = new_container;
259 case 202 /* environment */:
261 NSString *new_environment = PBReaderReadString(reader);
262 self->_environment = new_environment;
265 case 203 /* anonymous */:
267 self->_has.anonymous = YES;
268 self->_anonymous = PBReaderReadBOOL(reader);
271 case 301 /* operationGroups */:
273 SECC2MPCloudKitOperationGroupInfo *new_operationGroup = [[SECC2MPCloudKitOperationGroupInfo alloc] init];
274 [self addOperationGroup:new_operationGroup];
275 PBDataReaderMark mark_operationGroup;
276 BOOL markError = !PBReaderPlaceMark(reader, &mark_operationGroup);
281 BOOL inError = !SECC2MPCloudKitOperationGroupInfoReadFrom(new_operationGroup, reader);
286 PBReaderRecallMark(reader, &mark_operationGroup);
289 case 302 /* reportOperationGroupFrequency */:
291 self->_has.reportOperationGroupFrequency = YES;
292 self->_reportOperationGroupFrequency = PBReaderReadUint64(reader);
295 case 303 /* reportOperationGroupFrequencyBase */:
297 self->_has.reportOperationGroupFrequencyBase = YES;
298 self->_reportOperationGroupFrequencyBase = PBReaderReadUint64(reader);
301 case 401 /* clientOperations */:
303 SECC2MPCloudKitOperationInfo *new_clientOperation = [[SECC2MPCloudKitOperationInfo alloc] init];
304 [self addClientOperation:new_clientOperation];
305 PBDataReaderMark mark_clientOperation;
306 BOOL markError = !PBReaderPlaceMark(reader, &mark_clientOperation);
311 BOOL inError = !SECC2MPCloudKitOperationInfoReadFrom(new_clientOperation, reader);
316 PBReaderRecallMark(reader, &mark_clientOperation);
319 case 402 /* reportClientOperationFrequency */:
321 self->_has.reportClientOperationFrequency = YES;
322 self->_reportClientOperationFrequency = PBReaderReadUint64(reader);
325 case 403 /* reportClientOperationFrequencyBase */:
327 self->_has.reportClientOperationFrequencyBase = YES;
328 self->_reportClientOperationFrequencyBase = PBReaderReadUint64(reader);
332 if (!PBReaderSkipValueWithTag(reader, tag, aType))
337 return !PBReaderHasError(reader);
340 - (BOOL)readFrom:(PBDataReader *)reader
342 return SECC2MPCloudKitInfoReadFrom(self, reader);
344 - (void)writeTo:(PBDataWriter *)writer
346 /* clientProcessVersion */
348 if (self->_clientProcessVersion)
350 PBDataWriterWriteStringField(writer, self->_clientProcessVersion, 102);
355 if (self->_clientBundleId)
357 PBDataWriterWriteStringField(writer, self->_clientBundleId, 103);
362 if (self->_container)
364 PBDataWriterWriteStringField(writer, self->_container, 201);
369 if (self->_environment)
371 PBDataWriterWriteStringField(writer, self->_environment, 202);
376 if (self->_has.anonymous)
378 PBDataWriterWriteBOOLField(writer, self->_anonymous, 203);
381 /* operationGroups */
383 for (SECC2MPCloudKitOperationGroupInfo *i_operationGroup in self->_operationGroups)
385 PBDataWriterWriteSubmessage(writer, i_operationGroup, 301);
388 /* reportOperationGroupFrequency */
390 if (self->_has.reportOperationGroupFrequency)
392 PBDataWriterWriteUint64Field(writer, self->_reportOperationGroupFrequency, 302);
395 /* reportOperationGroupFrequencyBase */
397 if (self->_has.reportOperationGroupFrequencyBase)
399 PBDataWriterWriteUint64Field(writer, self->_reportOperationGroupFrequencyBase, 303);
402 /* clientOperations */
404 for (SECC2MPCloudKitOperationInfo *i_clientOperation in self->_clientOperations)
406 PBDataWriterWriteSubmessage(writer, i_clientOperation, 401);
409 /* reportClientOperationFrequency */
411 if (self->_has.reportClientOperationFrequency)
413 PBDataWriterWriteUint64Field(writer, self->_reportClientOperationFrequency, 402);
416 /* reportClientOperationFrequencyBase */
418 if (self->_has.reportClientOperationFrequencyBase)
420 PBDataWriterWriteUint64Field(writer, self->_reportClientOperationFrequencyBase, 403);
425 - (void)copyTo:(SECC2MPCloudKitInfo *)other
427 if (_clientProcessVersion)
429 other.clientProcessVersion = _clientProcessVersion;
433 other.clientBundleId = _clientBundleId;
437 other.container = _container;
441 other.environment = _environment;
443 if (self->_has.anonymous)
445 other->_anonymous = _anonymous;
446 other->_has.anonymous = YES;
448 if ([self operationGroupsCount])
450 [other clearOperationGroups];
451 NSUInteger operationGroupsCnt = [self operationGroupsCount];
452 for (NSUInteger i = 0; i < operationGroupsCnt; i++)
454 [other addOperationGroup:[self operationGroupAtIndex:i]];
457 if (self->_has.reportOperationGroupFrequency)
459 other->_reportOperationGroupFrequency = _reportOperationGroupFrequency;
460 other->_has.reportOperationGroupFrequency = YES;
462 if (self->_has.reportOperationGroupFrequencyBase)
464 other->_reportOperationGroupFrequencyBase = _reportOperationGroupFrequencyBase;
465 other->_has.reportOperationGroupFrequencyBase = YES;
467 if ([self clientOperationsCount])
469 [other clearClientOperations];
470 NSUInteger clientOperationsCnt = [self clientOperationsCount];
471 for (NSUInteger i = 0; i < clientOperationsCnt; i++)
473 [other addClientOperation:[self clientOperationAtIndex:i]];
476 if (self->_has.reportClientOperationFrequency)
478 other->_reportClientOperationFrequency = _reportClientOperationFrequency;
479 other->_has.reportClientOperationFrequency = YES;
481 if (self->_has.reportClientOperationFrequencyBase)
483 other->_reportClientOperationFrequencyBase = _reportClientOperationFrequencyBase;
484 other->_has.reportClientOperationFrequencyBase = YES;
488 - (id)copyWithZone:(NSZone *)zone
490 SECC2MPCloudKitInfo *copy = [[[self class] allocWithZone:zone] init];
491 copy->_clientProcessVersion = [_clientProcessVersion copyWithZone:zone];
492 copy->_clientBundleId = [_clientBundleId copyWithZone:zone];
493 copy->_container = [_container copyWithZone:zone];
494 copy->_environment = [_environment copyWithZone:zone];
495 if (self->_has.anonymous)
497 copy->_anonymous = _anonymous;
498 copy->_has.anonymous = YES;
500 for (SECC2MPCloudKitOperationGroupInfo *v in _operationGroups)
502 SECC2MPCloudKitOperationGroupInfo *vCopy = [v copyWithZone:zone];
503 [copy addOperationGroup:vCopy];
505 if (self->_has.reportOperationGroupFrequency)
507 copy->_reportOperationGroupFrequency = _reportOperationGroupFrequency;
508 copy->_has.reportOperationGroupFrequency = YES;
510 if (self->_has.reportOperationGroupFrequencyBase)
512 copy->_reportOperationGroupFrequencyBase = _reportOperationGroupFrequencyBase;
513 copy->_has.reportOperationGroupFrequencyBase = YES;
515 for (SECC2MPCloudKitOperationInfo *v in _clientOperations)
517 SECC2MPCloudKitOperationInfo *vCopy = [v copyWithZone:zone];
518 [copy addClientOperation:vCopy];
520 if (self->_has.reportClientOperationFrequency)
522 copy->_reportClientOperationFrequency = _reportClientOperationFrequency;
523 copy->_has.reportClientOperationFrequency = YES;
525 if (self->_has.reportClientOperationFrequencyBase)
527 copy->_reportClientOperationFrequencyBase = _reportClientOperationFrequencyBase;
528 copy->_has.reportClientOperationFrequencyBase = YES;
533 - (BOOL)isEqual:(id)object
535 SECC2MPCloudKitInfo *other = (SECC2MPCloudKitInfo *)object;
536 return [other isMemberOfClass:[self class]]
538 ((!self->_clientProcessVersion && !other->_clientProcessVersion) || [self->_clientProcessVersion isEqual:other->_clientProcessVersion])
540 ((!self->_clientBundleId && !other->_clientBundleId) || [self->_clientBundleId isEqual:other->_clientBundleId])
542 ((!self->_container && !other->_container) || [self->_container isEqual:other->_container])
544 ((!self->_environment && !other->_environment) || [self->_environment isEqual:other->_environment])
546 ((self->_has.anonymous && other->_has.anonymous && ((self->_anonymous && other->_anonymous) || (!self->_anonymous && !other->_anonymous))) || (!self->_has.anonymous && !other->_has.anonymous))
548 ((!self->_operationGroups && !other->_operationGroups) || [self->_operationGroups isEqual:other->_operationGroups])
550 ((self->_has.reportOperationGroupFrequency && other->_has.reportOperationGroupFrequency && self->_reportOperationGroupFrequency == other->_reportOperationGroupFrequency) || (!self->_has.reportOperationGroupFrequency && !other->_has.reportOperationGroupFrequency))
552 ((self->_has.reportOperationGroupFrequencyBase && other->_has.reportOperationGroupFrequencyBase && self->_reportOperationGroupFrequencyBase == other->_reportOperationGroupFrequencyBase) || (!self->_has.reportOperationGroupFrequencyBase && !other->_has.reportOperationGroupFrequencyBase))
554 ((!self->_clientOperations && !other->_clientOperations) || [self->_clientOperations isEqual:other->_clientOperations])
556 ((self->_has.reportClientOperationFrequency && other->_has.reportClientOperationFrequency && self->_reportClientOperationFrequency == other->_reportClientOperationFrequency) || (!self->_has.reportClientOperationFrequency && !other->_has.reportClientOperationFrequency))
558 ((self->_has.reportClientOperationFrequencyBase && other->_has.reportClientOperationFrequencyBase && self->_reportClientOperationFrequencyBase == other->_reportClientOperationFrequencyBase) || (!self->_has.reportClientOperationFrequencyBase && !other->_has.reportClientOperationFrequencyBase))
566 [self->_clientProcessVersion hash]
568 [self->_clientBundleId hash]
570 [self->_container hash]
572 [self->_environment hash]
574 (self->_has.anonymous ? PBHashInt((NSUInteger)self->_anonymous) : 0)
576 [self->_operationGroups hash]
578 (self->_has.reportOperationGroupFrequency ? PBHashInt((NSUInteger)self->_reportOperationGroupFrequency) : 0)
580 (self->_has.reportOperationGroupFrequencyBase ? PBHashInt((NSUInteger)self->_reportOperationGroupFrequencyBase) : 0)
582 [self->_clientOperations hash]
584 (self->_has.reportClientOperationFrequency ? PBHashInt((NSUInteger)self->_reportClientOperationFrequency) : 0)
586 (self->_has.reportClientOperationFrequencyBase ? PBHashInt((NSUInteger)self->_reportClientOperationFrequencyBase) : 0)
590 - (void)mergeFrom:(SECC2MPCloudKitInfo *)other
592 if (other->_clientProcessVersion)
594 [self setClientProcessVersion:other->_clientProcessVersion];
596 if (other->_clientBundleId)
598 [self setClientBundleId:other->_clientBundleId];
600 if (other->_container)
602 [self setContainer:other->_container];
604 if (other->_environment)
606 [self setEnvironment:other->_environment];
608 if (other->_has.anonymous)
610 self->_anonymous = other->_anonymous;
611 self->_has.anonymous = YES;
613 for (SECC2MPCloudKitOperationGroupInfo *iter_operationGroups in other->_operationGroups)
615 [self addOperationGroup:iter_operationGroups];
617 if (other->_has.reportOperationGroupFrequency)
619 self->_reportOperationGroupFrequency = other->_reportOperationGroupFrequency;
620 self->_has.reportOperationGroupFrequency = YES;
622 if (other->_has.reportOperationGroupFrequencyBase)
624 self->_reportOperationGroupFrequencyBase = other->_reportOperationGroupFrequencyBase;
625 self->_has.reportOperationGroupFrequencyBase = YES;
627 for (SECC2MPCloudKitOperationInfo *iter_clientOperations in other->_clientOperations)
629 [self addClientOperation:iter_clientOperations];
631 if (other->_has.reportClientOperationFrequency)
633 self->_reportClientOperationFrequency = other->_reportClientOperationFrequency;
634 self->_has.reportClientOperationFrequency = YES;
636 if (other->_has.reportClientOperationFrequencyBase)
638 self->_reportClientOperationFrequencyBase = other->_reportClientOperationFrequencyBase;
639 self->_has.reportClientOperationFrequencyBase = YES;