]> git.saurik.com Git - apple/security.git/blob - keychain/analytics/C2Metric/SECC2MPCloudKitInfo.m
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / analytics / C2Metric / SECC2MPCloudKitInfo.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from C2Metric.proto
4
5 #import "SECC2MPCloudKitInfo.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
9
10 #import "SECC2MPCloudKitOperationGroupInfo.h"
11 #import "SECC2MPCloudKitOperationInfo.h"
12
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.
15 #endif
16
17 @implementation SECC2MPCloudKitInfo
18
19 - (BOOL)hasClientProcessVersion
20 {
21 return _clientProcessVersion != nil;
22 }
23 @synthesize clientProcessVersion = _clientProcessVersion;
24 - (BOOL)hasClientBundleId
25 {
26 return _clientBundleId != nil;
27 }
28 @synthesize clientBundleId = _clientBundleId;
29 - (BOOL)hasContainer
30 {
31 return _container != nil;
32 }
33 @synthesize container = _container;
34 - (BOOL)hasEnvironment
35 {
36 return _environment != nil;
37 }
38 @synthesize environment = _environment;
39 @synthesize anonymous = _anonymous;
40 - (void)setAnonymous:(BOOL)v
41 {
42 _has.anonymous = YES;
43 _anonymous = v;
44 }
45 - (void)setHasAnonymous:(BOOL)f
46 {
47 _has.anonymous = f;
48 }
49 - (BOOL)hasAnonymous
50 {
51 return _has.anonymous;
52 }
53 @synthesize operationGroups = _operationGroups;
54 - (void)clearOperationGroups
55 {
56 [_operationGroups removeAllObjects];
57 }
58 - (void)addOperationGroup:(SECC2MPCloudKitOperationGroupInfo *)i
59 {
60 if (!_operationGroups)
61 {
62 _operationGroups = [[NSMutableArray alloc] init];
63 }
64 [_operationGroups addObject:i];
65 }
66 - (NSUInteger)operationGroupsCount
67 {
68 return [_operationGroups count];
69 }
70 - (SECC2MPCloudKitOperationGroupInfo *)operationGroupAtIndex:(NSUInteger)idx
71 {
72 return [_operationGroups objectAtIndex:idx];
73 }
74 + (Class)operationGroupType
75 {
76 return [SECC2MPCloudKitOperationGroupInfo class];
77 }
78 @synthesize reportOperationGroupFrequency = _reportOperationGroupFrequency;
79 - (void)setReportOperationGroupFrequency:(uint64_t)v
80 {
81 _has.reportOperationGroupFrequency = YES;
82 _reportOperationGroupFrequency = v;
83 }
84 - (void)setHasReportOperationGroupFrequency:(BOOL)f
85 {
86 _has.reportOperationGroupFrequency = f;
87 }
88 - (BOOL)hasReportOperationGroupFrequency
89 {
90 return _has.reportOperationGroupFrequency;
91 }
92 @synthesize reportOperationGroupFrequencyBase = _reportOperationGroupFrequencyBase;
93 - (void)setReportOperationGroupFrequencyBase:(uint64_t)v
94 {
95 _has.reportOperationGroupFrequencyBase = YES;
96 _reportOperationGroupFrequencyBase = v;
97 }
98 - (void)setHasReportOperationGroupFrequencyBase:(BOOL)f
99 {
100 _has.reportOperationGroupFrequencyBase = f;
101 }
102 - (BOOL)hasReportOperationGroupFrequencyBase
103 {
104 return _has.reportOperationGroupFrequencyBase;
105 }
106 @synthesize clientOperations = _clientOperations;
107 - (void)clearClientOperations
108 {
109 [_clientOperations removeAllObjects];
110 }
111 - (void)addClientOperation:(SECC2MPCloudKitOperationInfo *)i
112 {
113 if (!_clientOperations)
114 {
115 _clientOperations = [[NSMutableArray alloc] init];
116 }
117 [_clientOperations addObject:i];
118 }
119 - (NSUInteger)clientOperationsCount
120 {
121 return [_clientOperations count];
122 }
123 - (SECC2MPCloudKitOperationInfo *)clientOperationAtIndex:(NSUInteger)idx
124 {
125 return [_clientOperations objectAtIndex:idx];
126 }
127 + (Class)clientOperationType
128 {
129 return [SECC2MPCloudKitOperationInfo class];
130 }
131 @synthesize reportClientOperationFrequency = _reportClientOperationFrequency;
132 - (void)setReportClientOperationFrequency:(uint64_t)v
133 {
134 _has.reportClientOperationFrequency = YES;
135 _reportClientOperationFrequency = v;
136 }
137 - (void)setHasReportClientOperationFrequency:(BOOL)f
138 {
139 _has.reportClientOperationFrequency = f;
140 }
141 - (BOOL)hasReportClientOperationFrequency
142 {
143 return _has.reportClientOperationFrequency;
144 }
145 @synthesize reportClientOperationFrequencyBase = _reportClientOperationFrequencyBase;
146 - (void)setReportClientOperationFrequencyBase:(uint64_t)v
147 {
148 _has.reportClientOperationFrequencyBase = YES;
149 _reportClientOperationFrequencyBase = v;
150 }
151 - (void)setHasReportClientOperationFrequencyBase:(BOOL)f
152 {
153 _has.reportClientOperationFrequencyBase = f;
154 }
155 - (BOOL)hasReportClientOperationFrequencyBase
156 {
157 return _has.reportClientOperationFrequencyBase;
158 }
159
160 - (NSString *)description
161 {
162 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
163 }
164
165 - (NSDictionary *)dictionaryRepresentation
166 {
167 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
168 if (self->_clientProcessVersion)
169 {
170 [dict setObject:self->_clientProcessVersion forKey:@"client_process_version"];
171 }
172 if (self->_clientBundleId)
173 {
174 [dict setObject:self->_clientBundleId forKey:@"client_bundle_id"];
175 }
176 if (self->_container)
177 {
178 [dict setObject:self->_container forKey:@"container"];
179 }
180 if (self->_environment)
181 {
182 [dict setObject:self->_environment forKey:@"environment"];
183 }
184 if (self->_has.anonymous)
185 {
186 [dict setObject:[NSNumber numberWithBool:self->_anonymous] forKey:@"anonymous"];
187 }
188 if ([self->_operationGroups count])
189 {
190 NSMutableArray *operationGroupsDictReprs = [[NSMutableArray alloc] initWithCapacity:[self->_operationGroups count]];
191 for (SECC2MPCloudKitOperationGroupInfo *i_operationGroup in self->_operationGroups)
192 {
193 [operationGroupsDictReprs addObject:[i_operationGroup dictionaryRepresentation]];
194 }
195 [dict setObject:operationGroupsDictReprs forKey:@"operation_group"];
196 }
197 if (self->_has.reportOperationGroupFrequency)
198 {
199 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_reportOperationGroupFrequency] forKey:@"report_operation_group_frequency"];
200 }
201 if (self->_has.reportOperationGroupFrequencyBase)
202 {
203 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_reportOperationGroupFrequencyBase] forKey:@"report_operation_group_frequency_base"];
204 }
205 if ([self->_clientOperations count])
206 {
207 NSMutableArray *clientOperationsDictReprs = [[NSMutableArray alloc] initWithCapacity:[self->_clientOperations count]];
208 for (SECC2MPCloudKitOperationInfo *i_clientOperation in self->_clientOperations)
209 {
210 [clientOperationsDictReprs addObject:[i_clientOperation dictionaryRepresentation]];
211 }
212 [dict setObject:clientOperationsDictReprs forKey:@"client_operation"];
213 }
214 if (self->_has.reportClientOperationFrequency)
215 {
216 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_reportClientOperationFrequency] forKey:@"report_client_operation_frequency"];
217 }
218 if (self->_has.reportClientOperationFrequencyBase)
219 {
220 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_reportClientOperationFrequencyBase] forKey:@"report_client_operation_frequency_base"];
221 }
222 return dict;
223 }
224
225 BOOL SECC2MPCloudKitInfoReadFrom(__unsafe_unretained SECC2MPCloudKitInfo *self, __unsafe_unretained PBDataReader *reader) {
226 while (PBReaderHasMoreData(reader)) {
227 uint32_t tag = 0;
228 uint8_t aType = 0;
229
230 PBReaderReadTag32AndType(reader, &tag, &aType);
231
232 if (PBReaderHasError(reader))
233 break;
234
235 if (aType == TYPE_END_GROUP) {
236 break;
237 }
238
239 switch (tag) {
240
241 case 102 /* clientProcessVersion */:
242 {
243 NSString *new_clientProcessVersion = PBReaderReadString(reader);
244 self->_clientProcessVersion = new_clientProcessVersion;
245 }
246 break;
247 case 103 /* clientBundleId */:
248 {
249 NSString *new_clientBundleId = PBReaderReadString(reader);
250 self->_clientBundleId = new_clientBundleId;
251 }
252 break;
253 case 201 /* container */:
254 {
255 NSString *new_container = PBReaderReadString(reader);
256 self->_container = new_container;
257 }
258 break;
259 case 202 /* environment */:
260 {
261 NSString *new_environment = PBReaderReadString(reader);
262 self->_environment = new_environment;
263 }
264 break;
265 case 203 /* anonymous */:
266 {
267 self->_has.anonymous = YES;
268 self->_anonymous = PBReaderReadBOOL(reader);
269 }
270 break;
271 case 301 /* operationGroups */:
272 {
273 SECC2MPCloudKitOperationGroupInfo *new_operationGroup = [[SECC2MPCloudKitOperationGroupInfo alloc] init];
274 [self addOperationGroup:new_operationGroup];
275 PBDataReaderMark mark_operationGroup;
276 BOOL markError = !PBReaderPlaceMark(reader, &mark_operationGroup);
277 if (markError)
278 {
279 return NO;
280 }
281 BOOL inError = !SECC2MPCloudKitOperationGroupInfoReadFrom(new_operationGroup, reader);
282 if (inError)
283 {
284 return NO;
285 }
286 PBReaderRecallMark(reader, &mark_operationGroup);
287 }
288 break;
289 case 302 /* reportOperationGroupFrequency */:
290 {
291 self->_has.reportOperationGroupFrequency = YES;
292 self->_reportOperationGroupFrequency = PBReaderReadUint64(reader);
293 }
294 break;
295 case 303 /* reportOperationGroupFrequencyBase */:
296 {
297 self->_has.reportOperationGroupFrequencyBase = YES;
298 self->_reportOperationGroupFrequencyBase = PBReaderReadUint64(reader);
299 }
300 break;
301 case 401 /* clientOperations */:
302 {
303 SECC2MPCloudKitOperationInfo *new_clientOperation = [[SECC2MPCloudKitOperationInfo alloc] init];
304 [self addClientOperation:new_clientOperation];
305 PBDataReaderMark mark_clientOperation;
306 BOOL markError = !PBReaderPlaceMark(reader, &mark_clientOperation);
307 if (markError)
308 {
309 return NO;
310 }
311 BOOL inError = !SECC2MPCloudKitOperationInfoReadFrom(new_clientOperation, reader);
312 if (inError)
313 {
314 return NO;
315 }
316 PBReaderRecallMark(reader, &mark_clientOperation);
317 }
318 break;
319 case 402 /* reportClientOperationFrequency */:
320 {
321 self->_has.reportClientOperationFrequency = YES;
322 self->_reportClientOperationFrequency = PBReaderReadUint64(reader);
323 }
324 break;
325 case 403 /* reportClientOperationFrequencyBase */:
326 {
327 self->_has.reportClientOperationFrequencyBase = YES;
328 self->_reportClientOperationFrequencyBase = PBReaderReadUint64(reader);
329 }
330 break;
331 default:
332 if (!PBReaderSkipValueWithTag(reader, tag, aType))
333 return NO;
334 break;
335 }
336 }
337 return !PBReaderHasError(reader);
338 }
339
340 - (BOOL)readFrom:(PBDataReader *)reader
341 {
342 return SECC2MPCloudKitInfoReadFrom(self, reader);
343 }
344 - (void)writeTo:(PBDataWriter *)writer
345 {
346 /* clientProcessVersion */
347 {
348 if (self->_clientProcessVersion)
349 {
350 PBDataWriterWriteStringField(writer, self->_clientProcessVersion, 102);
351 }
352 }
353 /* clientBundleId */
354 {
355 if (self->_clientBundleId)
356 {
357 PBDataWriterWriteStringField(writer, self->_clientBundleId, 103);
358 }
359 }
360 /* container */
361 {
362 if (self->_container)
363 {
364 PBDataWriterWriteStringField(writer, self->_container, 201);
365 }
366 }
367 /* environment */
368 {
369 if (self->_environment)
370 {
371 PBDataWriterWriteStringField(writer, self->_environment, 202);
372 }
373 }
374 /* anonymous */
375 {
376 if (self->_has.anonymous)
377 {
378 PBDataWriterWriteBOOLField(writer, self->_anonymous, 203);
379 }
380 }
381 /* operationGroups */
382 {
383 for (SECC2MPCloudKitOperationGroupInfo *i_operationGroup in self->_operationGroups)
384 {
385 PBDataWriterWriteSubmessage(writer, i_operationGroup, 301);
386 }
387 }
388 /* reportOperationGroupFrequency */
389 {
390 if (self->_has.reportOperationGroupFrequency)
391 {
392 PBDataWriterWriteUint64Field(writer, self->_reportOperationGroupFrequency, 302);
393 }
394 }
395 /* reportOperationGroupFrequencyBase */
396 {
397 if (self->_has.reportOperationGroupFrequencyBase)
398 {
399 PBDataWriterWriteUint64Field(writer, self->_reportOperationGroupFrequencyBase, 303);
400 }
401 }
402 /* clientOperations */
403 {
404 for (SECC2MPCloudKitOperationInfo *i_clientOperation in self->_clientOperations)
405 {
406 PBDataWriterWriteSubmessage(writer, i_clientOperation, 401);
407 }
408 }
409 /* reportClientOperationFrequency */
410 {
411 if (self->_has.reportClientOperationFrequency)
412 {
413 PBDataWriterWriteUint64Field(writer, self->_reportClientOperationFrequency, 402);
414 }
415 }
416 /* reportClientOperationFrequencyBase */
417 {
418 if (self->_has.reportClientOperationFrequencyBase)
419 {
420 PBDataWriterWriteUint64Field(writer, self->_reportClientOperationFrequencyBase, 403);
421 }
422 }
423 }
424
425 - (void)copyTo:(SECC2MPCloudKitInfo *)other
426 {
427 if (_clientProcessVersion)
428 {
429 other.clientProcessVersion = _clientProcessVersion;
430 }
431 if (_clientBundleId)
432 {
433 other.clientBundleId = _clientBundleId;
434 }
435 if (_container)
436 {
437 other.container = _container;
438 }
439 if (_environment)
440 {
441 other.environment = _environment;
442 }
443 if (self->_has.anonymous)
444 {
445 other->_anonymous = _anonymous;
446 other->_has.anonymous = YES;
447 }
448 if ([self operationGroupsCount])
449 {
450 [other clearOperationGroups];
451 NSUInteger operationGroupsCnt = [self operationGroupsCount];
452 for (NSUInteger i = 0; i < operationGroupsCnt; i++)
453 {
454 [other addOperationGroup:[self operationGroupAtIndex:i]];
455 }
456 }
457 if (self->_has.reportOperationGroupFrequency)
458 {
459 other->_reportOperationGroupFrequency = _reportOperationGroupFrequency;
460 other->_has.reportOperationGroupFrequency = YES;
461 }
462 if (self->_has.reportOperationGroupFrequencyBase)
463 {
464 other->_reportOperationGroupFrequencyBase = _reportOperationGroupFrequencyBase;
465 other->_has.reportOperationGroupFrequencyBase = YES;
466 }
467 if ([self clientOperationsCount])
468 {
469 [other clearClientOperations];
470 NSUInteger clientOperationsCnt = [self clientOperationsCount];
471 for (NSUInteger i = 0; i < clientOperationsCnt; i++)
472 {
473 [other addClientOperation:[self clientOperationAtIndex:i]];
474 }
475 }
476 if (self->_has.reportClientOperationFrequency)
477 {
478 other->_reportClientOperationFrequency = _reportClientOperationFrequency;
479 other->_has.reportClientOperationFrequency = YES;
480 }
481 if (self->_has.reportClientOperationFrequencyBase)
482 {
483 other->_reportClientOperationFrequencyBase = _reportClientOperationFrequencyBase;
484 other->_has.reportClientOperationFrequencyBase = YES;
485 }
486 }
487
488 - (id)copyWithZone:(NSZone *)zone
489 {
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)
496 {
497 copy->_anonymous = _anonymous;
498 copy->_has.anonymous = YES;
499 }
500 for (SECC2MPCloudKitOperationGroupInfo *v in _operationGroups)
501 {
502 SECC2MPCloudKitOperationGroupInfo *vCopy = [v copyWithZone:zone];
503 [copy addOperationGroup:vCopy];
504 }
505 if (self->_has.reportOperationGroupFrequency)
506 {
507 copy->_reportOperationGroupFrequency = _reportOperationGroupFrequency;
508 copy->_has.reportOperationGroupFrequency = YES;
509 }
510 if (self->_has.reportOperationGroupFrequencyBase)
511 {
512 copy->_reportOperationGroupFrequencyBase = _reportOperationGroupFrequencyBase;
513 copy->_has.reportOperationGroupFrequencyBase = YES;
514 }
515 for (SECC2MPCloudKitOperationInfo *v in _clientOperations)
516 {
517 SECC2MPCloudKitOperationInfo *vCopy = [v copyWithZone:zone];
518 [copy addClientOperation:vCopy];
519 }
520 if (self->_has.reportClientOperationFrequency)
521 {
522 copy->_reportClientOperationFrequency = _reportClientOperationFrequency;
523 copy->_has.reportClientOperationFrequency = YES;
524 }
525 if (self->_has.reportClientOperationFrequencyBase)
526 {
527 copy->_reportClientOperationFrequencyBase = _reportClientOperationFrequencyBase;
528 copy->_has.reportClientOperationFrequencyBase = YES;
529 }
530 return copy;
531 }
532
533 - (BOOL)isEqual:(id)object
534 {
535 SECC2MPCloudKitInfo *other = (SECC2MPCloudKitInfo *)object;
536 return [other isMemberOfClass:[self class]]
537 &&
538 ((!self->_clientProcessVersion && !other->_clientProcessVersion) || [self->_clientProcessVersion isEqual:other->_clientProcessVersion])
539 &&
540 ((!self->_clientBundleId && !other->_clientBundleId) || [self->_clientBundleId isEqual:other->_clientBundleId])
541 &&
542 ((!self->_container && !other->_container) || [self->_container isEqual:other->_container])
543 &&
544 ((!self->_environment && !other->_environment) || [self->_environment isEqual:other->_environment])
545 &&
546 ((self->_has.anonymous && other->_has.anonymous && ((self->_anonymous && other->_anonymous) || (!self->_anonymous && !other->_anonymous))) || (!self->_has.anonymous && !other->_has.anonymous))
547 &&
548 ((!self->_operationGroups && !other->_operationGroups) || [self->_operationGroups isEqual:other->_operationGroups])
549 &&
550 ((self->_has.reportOperationGroupFrequency && other->_has.reportOperationGroupFrequency && self->_reportOperationGroupFrequency == other->_reportOperationGroupFrequency) || (!self->_has.reportOperationGroupFrequency && !other->_has.reportOperationGroupFrequency))
551 &&
552 ((self->_has.reportOperationGroupFrequencyBase && other->_has.reportOperationGroupFrequencyBase && self->_reportOperationGroupFrequencyBase == other->_reportOperationGroupFrequencyBase) || (!self->_has.reportOperationGroupFrequencyBase && !other->_has.reportOperationGroupFrequencyBase))
553 &&
554 ((!self->_clientOperations && !other->_clientOperations) || [self->_clientOperations isEqual:other->_clientOperations])
555 &&
556 ((self->_has.reportClientOperationFrequency && other->_has.reportClientOperationFrequency && self->_reportClientOperationFrequency == other->_reportClientOperationFrequency) || (!self->_has.reportClientOperationFrequency && !other->_has.reportClientOperationFrequency))
557 &&
558 ((self->_has.reportClientOperationFrequencyBase && other->_has.reportClientOperationFrequencyBase && self->_reportClientOperationFrequencyBase == other->_reportClientOperationFrequencyBase) || (!self->_has.reportClientOperationFrequencyBase && !other->_has.reportClientOperationFrequencyBase))
559 ;
560 }
561
562 - (NSUInteger)hash
563 {
564 return 0
565 ^
566 [self->_clientProcessVersion hash]
567 ^
568 [self->_clientBundleId hash]
569 ^
570 [self->_container hash]
571 ^
572 [self->_environment hash]
573 ^
574 (self->_has.anonymous ? PBHashInt((NSUInteger)self->_anonymous) : 0)
575 ^
576 [self->_operationGroups hash]
577 ^
578 (self->_has.reportOperationGroupFrequency ? PBHashInt((NSUInteger)self->_reportOperationGroupFrequency) : 0)
579 ^
580 (self->_has.reportOperationGroupFrequencyBase ? PBHashInt((NSUInteger)self->_reportOperationGroupFrequencyBase) : 0)
581 ^
582 [self->_clientOperations hash]
583 ^
584 (self->_has.reportClientOperationFrequency ? PBHashInt((NSUInteger)self->_reportClientOperationFrequency) : 0)
585 ^
586 (self->_has.reportClientOperationFrequencyBase ? PBHashInt((NSUInteger)self->_reportClientOperationFrequencyBase) : 0)
587 ;
588 }
589
590 - (void)mergeFrom:(SECC2MPCloudKitInfo *)other
591 {
592 if (other->_clientProcessVersion)
593 {
594 [self setClientProcessVersion:other->_clientProcessVersion];
595 }
596 if (other->_clientBundleId)
597 {
598 [self setClientBundleId:other->_clientBundleId];
599 }
600 if (other->_container)
601 {
602 [self setContainer:other->_container];
603 }
604 if (other->_environment)
605 {
606 [self setEnvironment:other->_environment];
607 }
608 if (other->_has.anonymous)
609 {
610 self->_anonymous = other->_anonymous;
611 self->_has.anonymous = YES;
612 }
613 for (SECC2MPCloudKitOperationGroupInfo *iter_operationGroups in other->_operationGroups)
614 {
615 [self addOperationGroup:iter_operationGroups];
616 }
617 if (other->_has.reportOperationGroupFrequency)
618 {
619 self->_reportOperationGroupFrequency = other->_reportOperationGroupFrequency;
620 self->_has.reportOperationGroupFrequency = YES;
621 }
622 if (other->_has.reportOperationGroupFrequencyBase)
623 {
624 self->_reportOperationGroupFrequencyBase = other->_reportOperationGroupFrequencyBase;
625 self->_has.reportOperationGroupFrequencyBase = YES;
626 }
627 for (SECC2MPCloudKitOperationInfo *iter_clientOperations in other->_clientOperations)
628 {
629 [self addClientOperation:iter_clientOperations];
630 }
631 if (other->_has.reportClientOperationFrequency)
632 {
633 self->_reportClientOperationFrequency = other->_reportClientOperationFrequency;
634 self->_has.reportClientOperationFrequency = YES;
635 }
636 if (other->_has.reportClientOperationFrequencyBase)
637 {
638 self->_reportClientOperationFrequencyBase = other->_reportClientOperationFrequencyBase;
639 self->_has.reportClientOperationFrequencyBase = YES;
640 }
641 }
642
643 @end
644