]> git.saurik.com Git - apple/security.git/blob - keychain/ot/proto/generated_source/OTAccountMetadataClassC.m
Security-59754.41.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 - (BOOL)hasVoucher
164 {
165 return _voucher != nil;
166 }
167 @synthesize voucher = _voucher;
168 - (BOOL)hasVoucherSignature
169 {
170 return _voucherSignature != nil;
171 }
172 @synthesize voucherSignature = _voucherSignature;
173
174 - (NSString *)description
175 {
176 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
177 }
178
179 - (NSDictionary *)dictionaryRepresentation
180 {
181 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
182 if (self->_peerID)
183 {
184 [dict setObject:self->_peerID forKey:@"peerID"];
185 }
186 if (self->_has.icloudAccountState)
187 {
188 [dict setObject:OTAccountMetadataClassC_AccountStateAsString(self->_icloudAccountState) forKey:@"icloudAccountState"];
189 }
190 if (self->_has.epoch)
191 {
192 [dict setObject:[NSNumber numberWithLongLong:self->_epoch] forKey:@"epoch"];
193 }
194 if (self->_altDSID)
195 {
196 [dict setObject:self->_altDSID forKey:@"altDSID"];
197 }
198 if (self->_has.trustState)
199 {
200 [dict setObject:OTAccountMetadataClassC_TrustStateAsString(self->_trustState) forKey:@"trustState"];
201 }
202 if (self->_has.lastHealthCheckup)
203 {
204 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_lastHealthCheckup] forKey:@"lastHealthCheckup"];
205 }
206 if (self->_has.attemptedJoin)
207 {
208 [dict setObject:OTAccountMetadataClassC_AttemptedAJoinStateAsString(self->_attemptedJoin) forKey:@"attemptedJoin"];
209 }
210 if (self->_has.cdpState)
211 {
212 [dict setObject:OTAccountMetadataClassC_CDPStateAsString(self->_cdpState) forKey:@"cdpState"];
213 }
214 if (self->_syncingPolicy)
215 {
216 [dict setObject:self->_syncingPolicy forKey:@"syncingPolicy"];
217 }
218 if (self->_voucher)
219 {
220 [dict setObject:self->_voucher forKey:@"voucher"];
221 }
222 if (self->_voucherSignature)
223 {
224 [dict setObject:self->_voucherSignature forKey:@"voucherSignature"];
225 }
226 return dict;
227 }
228
229 BOOL OTAccountMetadataClassCReadFrom(__unsafe_unretained OTAccountMetadataClassC *self, __unsafe_unretained PBDataReader *reader) {
230 while (PBReaderHasMoreData(reader)) {
231 uint32_t tag = 0;
232 uint8_t aType = 0;
233
234 PBReaderReadTag32AndType(reader, &tag, &aType);
235
236 if (PBReaderHasError(reader))
237 break;
238
239 if (aType == TYPE_END_GROUP) {
240 break;
241 }
242
243 switch (tag) {
244
245 case 1 /* peerID */:
246 {
247 NSString *new_peerID = PBReaderReadString(reader);
248 self->_peerID = new_peerID;
249 }
250 break;
251 case 2 /* icloudAccountState */:
252 {
253 self->_has.icloudAccountState = YES;
254 self->_icloudAccountState = PBReaderReadInt32(reader);
255 }
256 break;
257 case 3 /* epoch */:
258 {
259 self->_has.epoch = YES;
260 self->_epoch = PBReaderReadInt64(reader);
261 }
262 break;
263 case 4 /* altDSID */:
264 {
265 NSString *new_altDSID = PBReaderReadString(reader);
266 self->_altDSID = new_altDSID;
267 }
268 break;
269 case 5 /* trustState */:
270 {
271 self->_has.trustState = YES;
272 self->_trustState = PBReaderReadInt32(reader);
273 }
274 break;
275 case 6 /* lastHealthCheckup */:
276 {
277 self->_has.lastHealthCheckup = YES;
278 self->_lastHealthCheckup = PBReaderReadUint64(reader);
279 }
280 break;
281 case 7 /* attemptedJoin */:
282 {
283 self->_has.attemptedJoin = YES;
284 self->_attemptedJoin = PBReaderReadInt32(reader);
285 }
286 break;
287 case 8 /* cdpState */:
288 {
289 self->_has.cdpState = YES;
290 self->_cdpState = PBReaderReadInt32(reader);
291 }
292 break;
293 case 11 /* syncingPolicy */:
294 {
295 NSData *new_syncingPolicy = PBReaderReadData(reader);
296 self->_syncingPolicy = new_syncingPolicy;
297 }
298 break;
299 case 12 /* voucher */:
300 {
301 NSData *new_voucher = PBReaderReadData(reader);
302 self->_voucher = new_voucher;
303 }
304 break;
305 case 13 /* voucherSignature */:
306 {
307 NSData *new_voucherSignature = PBReaderReadData(reader);
308 self->_voucherSignature = new_voucherSignature;
309 }
310 break;
311 default:
312 if (!PBReaderSkipValueWithTag(reader, tag, aType))
313 return NO;
314 break;
315 }
316 }
317 return !PBReaderHasError(reader);
318 }
319
320 - (BOOL)readFrom:(PBDataReader *)reader
321 {
322 return OTAccountMetadataClassCReadFrom(self, reader);
323 }
324 - (void)writeTo:(PBDataWriter *)writer
325 {
326 /* peerID */
327 {
328 if (self->_peerID)
329 {
330 PBDataWriterWriteStringField(writer, self->_peerID, 1);
331 }
332 }
333 /* icloudAccountState */
334 {
335 if (self->_has.icloudAccountState)
336 {
337 PBDataWriterWriteInt32Field(writer, self->_icloudAccountState, 2);
338 }
339 }
340 /* epoch */
341 {
342 if (self->_has.epoch)
343 {
344 PBDataWriterWriteInt64Field(writer, self->_epoch, 3);
345 }
346 }
347 /* altDSID */
348 {
349 if (self->_altDSID)
350 {
351 PBDataWriterWriteStringField(writer, self->_altDSID, 4);
352 }
353 }
354 /* trustState */
355 {
356 if (self->_has.trustState)
357 {
358 PBDataWriterWriteInt32Field(writer, self->_trustState, 5);
359 }
360 }
361 /* lastHealthCheckup */
362 {
363 if (self->_has.lastHealthCheckup)
364 {
365 PBDataWriterWriteUint64Field(writer, self->_lastHealthCheckup, 6);
366 }
367 }
368 /* attemptedJoin */
369 {
370 if (self->_has.attemptedJoin)
371 {
372 PBDataWriterWriteInt32Field(writer, self->_attemptedJoin, 7);
373 }
374 }
375 /* cdpState */
376 {
377 if (self->_has.cdpState)
378 {
379 PBDataWriterWriteInt32Field(writer, self->_cdpState, 8);
380 }
381 }
382 /* syncingPolicy */
383 {
384 if (self->_syncingPolicy)
385 {
386 PBDataWriterWriteDataField(writer, self->_syncingPolicy, 11);
387 }
388 }
389 /* voucher */
390 {
391 if (self->_voucher)
392 {
393 PBDataWriterWriteDataField(writer, self->_voucher, 12);
394 }
395 }
396 /* voucherSignature */
397 {
398 if (self->_voucherSignature)
399 {
400 PBDataWriterWriteDataField(writer, self->_voucherSignature, 13);
401 }
402 }
403 }
404
405 - (void)copyTo:(OTAccountMetadataClassC *)other
406 {
407 if (_peerID)
408 {
409 other.peerID = _peerID;
410 }
411 if (self->_has.icloudAccountState)
412 {
413 other->_icloudAccountState = _icloudAccountState;
414 other->_has.icloudAccountState = YES;
415 }
416 if (self->_has.epoch)
417 {
418 other->_epoch = _epoch;
419 other->_has.epoch = YES;
420 }
421 if (_altDSID)
422 {
423 other.altDSID = _altDSID;
424 }
425 if (self->_has.trustState)
426 {
427 other->_trustState = _trustState;
428 other->_has.trustState = YES;
429 }
430 if (self->_has.lastHealthCheckup)
431 {
432 other->_lastHealthCheckup = _lastHealthCheckup;
433 other->_has.lastHealthCheckup = YES;
434 }
435 if (self->_has.attemptedJoin)
436 {
437 other->_attemptedJoin = _attemptedJoin;
438 other->_has.attemptedJoin = YES;
439 }
440 if (self->_has.cdpState)
441 {
442 other->_cdpState = _cdpState;
443 other->_has.cdpState = YES;
444 }
445 if (_syncingPolicy)
446 {
447 other.syncingPolicy = _syncingPolicy;
448 }
449 if (_voucher)
450 {
451 other.voucher = _voucher;
452 }
453 if (_voucherSignature)
454 {
455 other.voucherSignature = _voucherSignature;
456 }
457 }
458
459 - (id)copyWithZone:(NSZone *)zone
460 {
461 OTAccountMetadataClassC *copy = [[[self class] allocWithZone:zone] init];
462 copy->_peerID = [_peerID copyWithZone:zone];
463 if (self->_has.icloudAccountState)
464 {
465 copy->_icloudAccountState = _icloudAccountState;
466 copy->_has.icloudAccountState = YES;
467 }
468 if (self->_has.epoch)
469 {
470 copy->_epoch = _epoch;
471 copy->_has.epoch = YES;
472 }
473 copy->_altDSID = [_altDSID copyWithZone:zone];
474 if (self->_has.trustState)
475 {
476 copy->_trustState = _trustState;
477 copy->_has.trustState = YES;
478 }
479 if (self->_has.lastHealthCheckup)
480 {
481 copy->_lastHealthCheckup = _lastHealthCheckup;
482 copy->_has.lastHealthCheckup = YES;
483 }
484 if (self->_has.attemptedJoin)
485 {
486 copy->_attemptedJoin = _attemptedJoin;
487 copy->_has.attemptedJoin = YES;
488 }
489 if (self->_has.cdpState)
490 {
491 copy->_cdpState = _cdpState;
492 copy->_has.cdpState = YES;
493 }
494 copy->_syncingPolicy = [_syncingPolicy copyWithZone:zone];
495 copy->_voucher = [_voucher copyWithZone:zone];
496 copy->_voucherSignature = [_voucherSignature copyWithZone:zone];
497 return copy;
498 }
499
500 - (BOOL)isEqual:(id)object
501 {
502 OTAccountMetadataClassC *other = (OTAccountMetadataClassC *)object;
503 return [other isMemberOfClass:[self class]]
504 &&
505 ((!self->_peerID && !other->_peerID) || [self->_peerID isEqual:other->_peerID])
506 &&
507 ((self->_has.icloudAccountState && other->_has.icloudAccountState && self->_icloudAccountState == other->_icloudAccountState) || (!self->_has.icloudAccountState && !other->_has.icloudAccountState))
508 &&
509 ((self->_has.epoch && other->_has.epoch && self->_epoch == other->_epoch) || (!self->_has.epoch && !other->_has.epoch))
510 &&
511 ((!self->_altDSID && !other->_altDSID) || [self->_altDSID isEqual:other->_altDSID])
512 &&
513 ((self->_has.trustState && other->_has.trustState && self->_trustState == other->_trustState) || (!self->_has.trustState && !other->_has.trustState))
514 &&
515 ((self->_has.lastHealthCheckup && other->_has.lastHealthCheckup && self->_lastHealthCheckup == other->_lastHealthCheckup) || (!self->_has.lastHealthCheckup && !other->_has.lastHealthCheckup))
516 &&
517 ((self->_has.attemptedJoin && other->_has.attemptedJoin && self->_attemptedJoin == other->_attemptedJoin) || (!self->_has.attemptedJoin && !other->_has.attemptedJoin))
518 &&
519 ((self->_has.cdpState && other->_has.cdpState && self->_cdpState == other->_cdpState) || (!self->_has.cdpState && !other->_has.cdpState))
520 &&
521 ((!self->_syncingPolicy && !other->_syncingPolicy) || [self->_syncingPolicy isEqual:other->_syncingPolicy])
522 &&
523 ((!self->_voucher && !other->_voucher) || [self->_voucher isEqual:other->_voucher])
524 &&
525 ((!self->_voucherSignature && !other->_voucherSignature) || [self->_voucherSignature isEqual:other->_voucherSignature])
526 ;
527 }
528
529 - (NSUInteger)hash
530 {
531 return 0
532 ^
533 [self->_peerID hash]
534 ^
535 (self->_has.icloudAccountState ? PBHashInt((NSUInteger)self->_icloudAccountState) : 0)
536 ^
537 (self->_has.epoch ? PBHashInt((NSUInteger)self->_epoch) : 0)
538 ^
539 [self->_altDSID hash]
540 ^
541 (self->_has.trustState ? PBHashInt((NSUInteger)self->_trustState) : 0)
542 ^
543 (self->_has.lastHealthCheckup ? PBHashInt((NSUInteger)self->_lastHealthCheckup) : 0)
544 ^
545 (self->_has.attemptedJoin ? PBHashInt((NSUInteger)self->_attemptedJoin) : 0)
546 ^
547 (self->_has.cdpState ? PBHashInt((NSUInteger)self->_cdpState) : 0)
548 ^
549 [self->_syncingPolicy hash]
550 ^
551 [self->_voucher hash]
552 ^
553 [self->_voucherSignature hash]
554 ;
555 }
556
557 - (void)mergeFrom:(OTAccountMetadataClassC *)other
558 {
559 if (other->_peerID)
560 {
561 [self setPeerID:other->_peerID];
562 }
563 if (other->_has.icloudAccountState)
564 {
565 self->_icloudAccountState = other->_icloudAccountState;
566 self->_has.icloudAccountState = YES;
567 }
568 if (other->_has.epoch)
569 {
570 self->_epoch = other->_epoch;
571 self->_has.epoch = YES;
572 }
573 if (other->_altDSID)
574 {
575 [self setAltDSID:other->_altDSID];
576 }
577 if (other->_has.trustState)
578 {
579 self->_trustState = other->_trustState;
580 self->_has.trustState = YES;
581 }
582 if (other->_has.lastHealthCheckup)
583 {
584 self->_lastHealthCheckup = other->_lastHealthCheckup;
585 self->_has.lastHealthCheckup = YES;
586 }
587 if (other->_has.attemptedJoin)
588 {
589 self->_attemptedJoin = other->_attemptedJoin;
590 self->_has.attemptedJoin = YES;
591 }
592 if (other->_has.cdpState)
593 {
594 self->_cdpState = other->_cdpState;
595 self->_has.cdpState = YES;
596 }
597 if (other->_syncingPolicy)
598 {
599 [self setSyncingPolicy:other->_syncingPolicy];
600 }
601 if (other->_voucher)
602 {
603 [self setVoucher:other->_voucher];
604 }
605 if (other->_voucherSignature)
606 {
607 [self setVoucherSignature:other->_voucherSignature];
608 }
609 }
610
611 @end
612