]> git.saurik.com Git - apple/security.git/blob - keychain/ot/proto/generated_source/OTAccountMetadataClassC.m
Security-59306.101.1.tar.gz
[apple/security.git] / keychain / ot / proto / generated_source / OTAccountMetadataClassC.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from OTAccountMetadataClassC.proto
4
5 #import "OTAccountMetadataClassC.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
9
10 #if !__has_feature(objc_arc)
11 # 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.
12 #endif
13
14 @implementation OTAccountMetadataClassC
15
16 - (BOOL)hasPeerID
17 {
18 return _peerID != nil;
19 }
20 @synthesize peerID = _peerID;
21 @synthesize icloudAccountState = _icloudAccountState;
22 - (OTAccountMetadataClassC_AccountState)icloudAccountState
23 {
24 return _has.icloudAccountState ? _icloudAccountState : OTAccountMetadataClassC_AccountState_UNKNOWN;
25 }
26 - (void)setIcloudAccountState:(OTAccountMetadataClassC_AccountState)v
27 {
28 _has.icloudAccountState = YES;
29 _icloudAccountState = v;
30 }
31 - (void)setHasIcloudAccountState:(BOOL)f
32 {
33 _has.icloudAccountState = f;
34 }
35 - (BOOL)hasIcloudAccountState
36 {
37 return _has.icloudAccountState != 0;
38 }
39 - (NSString *)icloudAccountStateAsString:(OTAccountMetadataClassC_AccountState)value
40 {
41 return OTAccountMetadataClassC_AccountStateAsString(value);
42 }
43 - (OTAccountMetadataClassC_AccountState)StringAsIcloudAccountState:(NSString *)str
44 {
45 return StringAsOTAccountMetadataClassC_AccountState(str);
46 }
47 @synthesize epoch = _epoch;
48 - (void)setEpoch:(int64_t)v
49 {
50 _has.epoch = YES;
51 _epoch = v;
52 }
53 - (void)setHasEpoch:(BOOL)f
54 {
55 _has.epoch = f;
56 }
57 - (BOOL)hasEpoch
58 {
59 return _has.epoch != 0;
60 }
61 - (BOOL)hasAltDSID
62 {
63 return _altDSID != nil;
64 }
65 @synthesize altDSID = _altDSID;
66 @synthesize trustState = _trustState;
67 - (OTAccountMetadataClassC_TrustState)trustState
68 {
69 return _has.trustState ? _trustState : OTAccountMetadataClassC_TrustState_UNKNOWN;
70 }
71 - (void)setTrustState:(OTAccountMetadataClassC_TrustState)v
72 {
73 _has.trustState = YES;
74 _trustState = v;
75 }
76 - (void)setHasTrustState:(BOOL)f
77 {
78 _has.trustState = f;
79 }
80 - (BOOL)hasTrustState
81 {
82 return _has.trustState != 0;
83 }
84 - (NSString *)trustStateAsString:(OTAccountMetadataClassC_TrustState)value
85 {
86 return OTAccountMetadataClassC_TrustStateAsString(value);
87 }
88 - (OTAccountMetadataClassC_TrustState)StringAsTrustState:(NSString *)str
89 {
90 return StringAsOTAccountMetadataClassC_TrustState(str);
91 }
92 @synthesize lastHealthCheckup = _lastHealthCheckup;
93 - (void)setLastHealthCheckup:(uint64_t)v
94 {
95 _has.lastHealthCheckup = YES;
96 _lastHealthCheckup = v;
97 }
98 - (void)setHasLastHealthCheckup:(BOOL)f
99 {
100 _has.lastHealthCheckup = f;
101 }
102 - (BOOL)hasLastHealthCheckup
103 {
104 return _has.lastHealthCheckup != 0;
105 }
106 @synthesize attemptedJoin = _attemptedJoin;
107 - (OTAccountMetadataClassC_AttemptedAJoinState)attemptedJoin
108 {
109 return _has.attemptedJoin ? _attemptedJoin : OTAccountMetadataClassC_AttemptedAJoinState_UNKNOWN;
110 }
111 - (void)setAttemptedJoin:(OTAccountMetadataClassC_AttemptedAJoinState)v
112 {
113 _has.attemptedJoin = YES;
114 _attemptedJoin = v;
115 }
116 - (void)setHasAttemptedJoin:(BOOL)f
117 {
118 _has.attemptedJoin = f;
119 }
120 - (BOOL)hasAttemptedJoin
121 {
122 return _has.attemptedJoin != 0;
123 }
124 - (NSString *)attemptedJoinAsString:(OTAccountMetadataClassC_AttemptedAJoinState)value
125 {
126 return OTAccountMetadataClassC_AttemptedAJoinStateAsString(value);
127 }
128 - (OTAccountMetadataClassC_AttemptedAJoinState)StringAsAttemptedJoin:(NSString *)str
129 {
130 return StringAsOTAccountMetadataClassC_AttemptedAJoinState(str);
131 }
132 @synthesize cdpState = _cdpState;
133 - (OTAccountMetadataClassC_CDPState)cdpState
134 {
135 return _has.cdpState ? _cdpState : OTAccountMetadataClassC_CDPState_UNKNOWN;
136 }
137 - (void)setCdpState:(OTAccountMetadataClassC_CDPState)v
138 {
139 _has.cdpState = YES;
140 _cdpState = v;
141 }
142 - (void)setHasCdpState:(BOOL)f
143 {
144 _has.cdpState = f;
145 }
146 - (BOOL)hasCdpState
147 {
148 return _has.cdpState != 0;
149 }
150 - (NSString *)cdpStateAsString:(OTAccountMetadataClassC_CDPState)value
151 {
152 return OTAccountMetadataClassC_CDPStateAsString(value);
153 }
154 - (OTAccountMetadataClassC_CDPState)StringAsCdpState:(NSString *)str
155 {
156 return StringAsOTAccountMetadataClassC_CDPState(str);
157 }
158 - (BOOL)hasSyncingPolicy
159 {
160 return _syncingPolicy != nil;
161 }
162 @synthesize syncingPolicy = _syncingPolicy;
163 @synthesize syncingViews = _syncingViews;
164 - (void)clearSyncingViews
165 {
166 [_syncingViews removeAllObjects];
167 }
168 - (void)addSyncingView:(NSString *)i
169 {
170 if (!_syncingViews)
171 {
172 _syncingViews = [[NSMutableArray alloc] init];
173 }
174 [_syncingViews addObject:i];
175 }
176 - (NSUInteger)syncingViewsCount
177 {
178 return [_syncingViews count];
179 }
180 - (NSString *)syncingViewAtIndex:(NSUInteger)idx
181 {
182 return [_syncingViews objectAtIndex:idx];
183 }
184 + (Class)syncingViewType
185 {
186 return [NSString class];
187 }
188
189 - (NSString *)description
190 {
191 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
192 }
193
194 - (NSDictionary *)dictionaryRepresentation
195 {
196 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
197 if (self->_peerID)
198 {
199 [dict setObject:self->_peerID forKey:@"peerID"];
200 }
201 if (self->_has.icloudAccountState)
202 {
203 [dict setObject:OTAccountMetadataClassC_AccountStateAsString(self->_icloudAccountState) forKey:@"icloudAccountState"];
204 }
205 if (self->_has.epoch)
206 {
207 [dict setObject:[NSNumber numberWithLongLong:self->_epoch] forKey:@"epoch"];
208 }
209 if (self->_altDSID)
210 {
211 [dict setObject:self->_altDSID forKey:@"altDSID"];
212 }
213 if (self->_has.trustState)
214 {
215 [dict setObject:OTAccountMetadataClassC_TrustStateAsString(self->_trustState) forKey:@"trustState"];
216 }
217 if (self->_has.lastHealthCheckup)
218 {
219 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_lastHealthCheckup] forKey:@"lastHealthCheckup"];
220 }
221 if (self->_has.attemptedJoin)
222 {
223 [dict setObject:OTAccountMetadataClassC_AttemptedAJoinStateAsString(self->_attemptedJoin) forKey:@"attemptedJoin"];
224 }
225 if (self->_has.cdpState)
226 {
227 [dict setObject:OTAccountMetadataClassC_CDPStateAsString(self->_cdpState) forKey:@"cdpState"];
228 }
229 if (self->_syncingPolicy)
230 {
231 [dict setObject:self->_syncingPolicy forKey:@"syncingPolicy"];
232 }
233 if (self->_syncingViews)
234 {
235 [dict setObject:self->_syncingViews forKey:@"syncingView"];
236 }
237 return dict;
238 }
239
240 BOOL OTAccountMetadataClassCReadFrom(__unsafe_unretained OTAccountMetadataClassC *self, __unsafe_unretained PBDataReader *reader) {
241 while (PBReaderHasMoreData(reader)) {
242 uint32_t tag = 0;
243 uint8_t aType = 0;
244
245 PBReaderReadTag32AndType(reader, &tag, &aType);
246
247 if (PBReaderHasError(reader))
248 break;
249
250 if (aType == TYPE_END_GROUP) {
251 break;
252 }
253
254 switch (tag) {
255
256 case 1 /* peerID */:
257 {
258 NSString *new_peerID = PBReaderReadString(reader);
259 self->_peerID = new_peerID;
260 }
261 break;
262 case 2 /* icloudAccountState */:
263 {
264 self->_has.icloudAccountState = YES;
265 self->_icloudAccountState = PBReaderReadInt32(reader);
266 }
267 break;
268 case 3 /* epoch */:
269 {
270 self->_has.epoch = YES;
271 self->_epoch = PBReaderReadInt64(reader);
272 }
273 break;
274 case 4 /* altDSID */:
275 {
276 NSString *new_altDSID = PBReaderReadString(reader);
277 self->_altDSID = new_altDSID;
278 }
279 break;
280 case 5 /* trustState */:
281 {
282 self->_has.trustState = YES;
283 self->_trustState = PBReaderReadInt32(reader);
284 }
285 break;
286 case 6 /* lastHealthCheckup */:
287 {
288 self->_has.lastHealthCheckup = YES;
289 self->_lastHealthCheckup = PBReaderReadUint64(reader);
290 }
291 break;
292 case 7 /* attemptedJoin */:
293 {
294 self->_has.attemptedJoin = YES;
295 self->_attemptedJoin = PBReaderReadInt32(reader);
296 }
297 break;
298 case 8 /* cdpState */:
299 {
300 self->_has.cdpState = YES;
301 self->_cdpState = PBReaderReadInt32(reader);
302 }
303 break;
304 case 9 /* syncingPolicy */:
305 {
306 NSData *new_syncingPolicy = PBReaderReadData(reader);
307 self->_syncingPolicy = new_syncingPolicy;
308 }
309 break;
310 case 10 /* syncingViews */:
311 {
312 NSString *new_syncingViews = PBReaderReadString(reader);
313 if (new_syncingViews)
314 {
315 [self addSyncingView:new_syncingViews];
316 }
317 }
318 break;
319 default:
320 if (!PBReaderSkipValueWithTag(reader, tag, aType))
321 return NO;
322 break;
323 }
324 }
325 return !PBReaderHasError(reader);
326 }
327
328 - (BOOL)readFrom:(PBDataReader *)reader
329 {
330 return OTAccountMetadataClassCReadFrom(self, reader);
331 }
332 - (void)writeTo:(PBDataWriter *)writer
333 {
334 /* peerID */
335 {
336 if (self->_peerID)
337 {
338 PBDataWriterWriteStringField(writer, self->_peerID, 1);
339 }
340 }
341 /* icloudAccountState */
342 {
343 if (self->_has.icloudAccountState)
344 {
345 PBDataWriterWriteInt32Field(writer, self->_icloudAccountState, 2);
346 }
347 }
348 /* epoch */
349 {
350 if (self->_has.epoch)
351 {
352 PBDataWriterWriteInt64Field(writer, self->_epoch, 3);
353 }
354 }
355 /* altDSID */
356 {
357 if (self->_altDSID)
358 {
359 PBDataWriterWriteStringField(writer, self->_altDSID, 4);
360 }
361 }
362 /* trustState */
363 {
364 if (self->_has.trustState)
365 {
366 PBDataWriterWriteInt32Field(writer, self->_trustState, 5);
367 }
368 }
369 /* lastHealthCheckup */
370 {
371 if (self->_has.lastHealthCheckup)
372 {
373 PBDataWriterWriteUint64Field(writer, self->_lastHealthCheckup, 6);
374 }
375 }
376 /* attemptedJoin */
377 {
378 if (self->_has.attemptedJoin)
379 {
380 PBDataWriterWriteInt32Field(writer, self->_attemptedJoin, 7);
381 }
382 }
383 /* cdpState */
384 {
385 if (self->_has.cdpState)
386 {
387 PBDataWriterWriteInt32Field(writer, self->_cdpState, 8);
388 }
389 }
390 /* syncingPolicy */
391 {
392 if (self->_syncingPolicy)
393 {
394 PBDataWriterWriteDataField(writer, self->_syncingPolicy, 9);
395 }
396 }
397 /* syncingViews */
398 {
399 for (NSString *s_syncingViews in self->_syncingViews)
400 {
401 PBDataWriterWriteStringField(writer, s_syncingViews, 10);
402 }
403 }
404 }
405
406 - (void)copyTo:(OTAccountMetadataClassC *)other
407 {
408 if (_peerID)
409 {
410 other.peerID = _peerID;
411 }
412 if (self->_has.icloudAccountState)
413 {
414 other->_icloudAccountState = _icloudAccountState;
415 other->_has.icloudAccountState = YES;
416 }
417 if (self->_has.epoch)
418 {
419 other->_epoch = _epoch;
420 other->_has.epoch = YES;
421 }
422 if (_altDSID)
423 {
424 other.altDSID = _altDSID;
425 }
426 if (self->_has.trustState)
427 {
428 other->_trustState = _trustState;
429 other->_has.trustState = YES;
430 }
431 if (self->_has.lastHealthCheckup)
432 {
433 other->_lastHealthCheckup = _lastHealthCheckup;
434 other->_has.lastHealthCheckup = YES;
435 }
436 if (self->_has.attemptedJoin)
437 {
438 other->_attemptedJoin = _attemptedJoin;
439 other->_has.attemptedJoin = YES;
440 }
441 if (self->_has.cdpState)
442 {
443 other->_cdpState = _cdpState;
444 other->_has.cdpState = YES;
445 }
446 if (_syncingPolicy)
447 {
448 other.syncingPolicy = _syncingPolicy;
449 }
450 if ([self syncingViewsCount])
451 {
452 [other clearSyncingViews];
453 NSUInteger syncingViewsCnt = [self syncingViewsCount];
454 for (NSUInteger i = 0; i < syncingViewsCnt; i++)
455 {
456 [other addSyncingView:[self syncingViewAtIndex:i]];
457 }
458 }
459 }
460
461 - (id)copyWithZone:(NSZone *)zone
462 {
463 OTAccountMetadataClassC *copy = [[[self class] allocWithZone:zone] init];
464 copy->_peerID = [_peerID copyWithZone:zone];
465 if (self->_has.icloudAccountState)
466 {
467 copy->_icloudAccountState = _icloudAccountState;
468 copy->_has.icloudAccountState = YES;
469 }
470 if (self->_has.epoch)
471 {
472 copy->_epoch = _epoch;
473 copy->_has.epoch = YES;
474 }
475 copy->_altDSID = [_altDSID copyWithZone:zone];
476 if (self->_has.trustState)
477 {
478 copy->_trustState = _trustState;
479 copy->_has.trustState = YES;
480 }
481 if (self->_has.lastHealthCheckup)
482 {
483 copy->_lastHealthCheckup = _lastHealthCheckup;
484 copy->_has.lastHealthCheckup = YES;
485 }
486 if (self->_has.attemptedJoin)
487 {
488 copy->_attemptedJoin = _attemptedJoin;
489 copy->_has.attemptedJoin = YES;
490 }
491 if (self->_has.cdpState)
492 {
493 copy->_cdpState = _cdpState;
494 copy->_has.cdpState = YES;
495 }
496 copy->_syncingPolicy = [_syncingPolicy copyWithZone:zone];
497 for (NSString *v in _syncingViews)
498 {
499 NSString *vCopy = [v copyWithZone:zone];
500 [copy addSyncingView:vCopy];
501 }
502 return copy;
503 }
504
505 - (BOOL)isEqual:(id)object
506 {
507 OTAccountMetadataClassC *other = (OTAccountMetadataClassC *)object;
508 return [other isMemberOfClass:[self class]]
509 &&
510 ((!self->_peerID && !other->_peerID) || [self->_peerID isEqual:other->_peerID])
511 &&
512 ((self->_has.icloudAccountState && other->_has.icloudAccountState && self->_icloudAccountState == other->_icloudAccountState) || (!self->_has.icloudAccountState && !other->_has.icloudAccountState))
513 &&
514 ((self->_has.epoch && other->_has.epoch && self->_epoch == other->_epoch) || (!self->_has.epoch && !other->_has.epoch))
515 &&
516 ((!self->_altDSID && !other->_altDSID) || [self->_altDSID isEqual:other->_altDSID])
517 &&
518 ((self->_has.trustState && other->_has.trustState && self->_trustState == other->_trustState) || (!self->_has.trustState && !other->_has.trustState))
519 &&
520 ((self->_has.lastHealthCheckup && other->_has.lastHealthCheckup && self->_lastHealthCheckup == other->_lastHealthCheckup) || (!self->_has.lastHealthCheckup && !other->_has.lastHealthCheckup))
521 &&
522 ((self->_has.attemptedJoin && other->_has.attemptedJoin && self->_attemptedJoin == other->_attemptedJoin) || (!self->_has.attemptedJoin && !other->_has.attemptedJoin))
523 &&
524 ((self->_has.cdpState && other->_has.cdpState && self->_cdpState == other->_cdpState) || (!self->_has.cdpState && !other->_has.cdpState))
525 &&
526 ((!self->_syncingPolicy && !other->_syncingPolicy) || [self->_syncingPolicy isEqual:other->_syncingPolicy])
527 &&
528 ((!self->_syncingViews && !other->_syncingViews) || [self->_syncingViews isEqual:other->_syncingViews])
529 ;
530 }
531
532 - (NSUInteger)hash
533 {
534 return 0
535 ^
536 [self->_peerID hash]
537 ^
538 (self->_has.icloudAccountState ? PBHashInt((NSUInteger)self->_icloudAccountState) : 0)
539 ^
540 (self->_has.epoch ? PBHashInt((NSUInteger)self->_epoch) : 0)
541 ^
542 [self->_altDSID hash]
543 ^
544 (self->_has.trustState ? PBHashInt((NSUInteger)self->_trustState) : 0)
545 ^
546 (self->_has.lastHealthCheckup ? PBHashInt((NSUInteger)self->_lastHealthCheckup) : 0)
547 ^
548 (self->_has.attemptedJoin ? PBHashInt((NSUInteger)self->_attemptedJoin) : 0)
549 ^
550 (self->_has.cdpState ? PBHashInt((NSUInteger)self->_cdpState) : 0)
551 ^
552 [self->_syncingPolicy hash]
553 ^
554 [self->_syncingViews hash]
555 ;
556 }
557
558 - (void)mergeFrom:(OTAccountMetadataClassC *)other
559 {
560 if (other->_peerID)
561 {
562 [self setPeerID:other->_peerID];
563 }
564 if (other->_has.icloudAccountState)
565 {
566 self->_icloudAccountState = other->_icloudAccountState;
567 self->_has.icloudAccountState = YES;
568 }
569 if (other->_has.epoch)
570 {
571 self->_epoch = other->_epoch;
572 self->_has.epoch = YES;
573 }
574 if (other->_altDSID)
575 {
576 [self setAltDSID:other->_altDSID];
577 }
578 if (other->_has.trustState)
579 {
580 self->_trustState = other->_trustState;
581 self->_has.trustState = YES;
582 }
583 if (other->_has.lastHealthCheckup)
584 {
585 self->_lastHealthCheckup = other->_lastHealthCheckup;
586 self->_has.lastHealthCheckup = YES;
587 }
588 if (other->_has.attemptedJoin)
589 {
590 self->_attemptedJoin = other->_attemptedJoin;
591 self->_has.attemptedJoin = YES;
592 }
593 if (other->_has.cdpState)
594 {
595 self->_cdpState = other->_cdpState;
596 self->_has.cdpState = YES;
597 }
598 if (other->_syncingPolicy)
599 {
600 [self setSyncingPolicy:other->_syncingPolicy];
601 }
602 for (NSString *iter_syncingViews in other->_syncingViews)
603 {
604 [self addSyncingView:iter_syncingViews];
605 }
606 }
607
608 @end
609