]> git.saurik.com Git - apple/security.git/blob - keychain/ot/proto/generated_source/OTAccountMetadataClassC.m
Security-59306.11.20.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;
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;
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;
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;
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;
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
133 - (NSString *)description
134 {
135 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
136 }
137
138 - (NSDictionary *)dictionaryRepresentation
139 {
140 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
141 if (self->_peerID)
142 {
143 [dict setObject:self->_peerID forKey:@"peerID"];
144 }
145 if (self->_has.icloudAccountState)
146 {
147 [dict setObject:OTAccountMetadataClassC_AccountStateAsString(self->_icloudAccountState) forKey:@"icloudAccountState"];
148 }
149 if (self->_has.epoch)
150 {
151 [dict setObject:[NSNumber numberWithLongLong:self->_epoch] forKey:@"epoch"];
152 }
153 if (self->_altDSID)
154 {
155 [dict setObject:self->_altDSID forKey:@"altDSID"];
156 }
157 if (self->_has.trustState)
158 {
159 [dict setObject:OTAccountMetadataClassC_TrustStateAsString(self->_trustState) forKey:@"trustState"];
160 }
161 if (self->_has.lastHealthCheckup)
162 {
163 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_lastHealthCheckup] forKey:@"lastHealthCheckup"];
164 }
165 if (self->_has.attemptedJoin)
166 {
167 [dict setObject:OTAccountMetadataClassC_AttemptedAJoinStateAsString(self->_attemptedJoin) forKey:@"attemptedJoin"];
168 }
169 return dict;
170 }
171
172 BOOL OTAccountMetadataClassCReadFrom(__unsafe_unretained OTAccountMetadataClassC *self, __unsafe_unretained PBDataReader *reader) {
173 while (PBReaderHasMoreData(reader)) {
174 uint32_t tag = 0;
175 uint8_t aType = 0;
176
177 PBReaderReadTag32AndType(reader, &tag, &aType);
178
179 if (PBReaderHasError(reader))
180 break;
181
182 if (aType == TYPE_END_GROUP) {
183 break;
184 }
185
186 switch (tag) {
187
188 case 1 /* peerID */:
189 {
190 NSString *new_peerID = PBReaderReadString(reader);
191 self->_peerID = new_peerID;
192 }
193 break;
194 case 2 /* icloudAccountState */:
195 {
196 self->_has.icloudAccountState = YES;
197 self->_icloudAccountState = PBReaderReadInt32(reader);
198 }
199 break;
200 case 3 /* epoch */:
201 {
202 self->_has.epoch = YES;
203 self->_epoch = PBReaderReadInt64(reader);
204 }
205 break;
206 case 4 /* altDSID */:
207 {
208 NSString *new_altDSID = PBReaderReadString(reader);
209 self->_altDSID = new_altDSID;
210 }
211 break;
212 case 5 /* trustState */:
213 {
214 self->_has.trustState = YES;
215 self->_trustState = PBReaderReadInt32(reader);
216 }
217 break;
218 case 6 /* lastHealthCheckup */:
219 {
220 self->_has.lastHealthCheckup = YES;
221 self->_lastHealthCheckup = PBReaderReadUint64(reader);
222 }
223 break;
224 case 7 /* attemptedJoin */:
225 {
226 self->_has.attemptedJoin = YES;
227 self->_attemptedJoin = PBReaderReadInt32(reader);
228 }
229 break;
230 default:
231 if (!PBReaderSkipValueWithTag(reader, tag, aType))
232 return NO;
233 break;
234 }
235 }
236 return !PBReaderHasError(reader);
237 }
238
239 - (BOOL)readFrom:(PBDataReader *)reader
240 {
241 return OTAccountMetadataClassCReadFrom(self, reader);
242 }
243 - (void)writeTo:(PBDataWriter *)writer
244 {
245 /* peerID */
246 {
247 if (self->_peerID)
248 {
249 PBDataWriterWriteStringField(writer, self->_peerID, 1);
250 }
251 }
252 /* icloudAccountState */
253 {
254 if (self->_has.icloudAccountState)
255 {
256 PBDataWriterWriteInt32Field(writer, self->_icloudAccountState, 2);
257 }
258 }
259 /* epoch */
260 {
261 if (self->_has.epoch)
262 {
263 PBDataWriterWriteInt64Field(writer, self->_epoch, 3);
264 }
265 }
266 /* altDSID */
267 {
268 if (self->_altDSID)
269 {
270 PBDataWriterWriteStringField(writer, self->_altDSID, 4);
271 }
272 }
273 /* trustState */
274 {
275 if (self->_has.trustState)
276 {
277 PBDataWriterWriteInt32Field(writer, self->_trustState, 5);
278 }
279 }
280 /* lastHealthCheckup */
281 {
282 if (self->_has.lastHealthCheckup)
283 {
284 PBDataWriterWriteUint64Field(writer, self->_lastHealthCheckup, 6);
285 }
286 }
287 /* attemptedJoin */
288 {
289 if (self->_has.attemptedJoin)
290 {
291 PBDataWriterWriteInt32Field(writer, self->_attemptedJoin, 7);
292 }
293 }
294 }
295
296 - (void)copyTo:(OTAccountMetadataClassC *)other
297 {
298 if (_peerID)
299 {
300 other.peerID = _peerID;
301 }
302 if (self->_has.icloudAccountState)
303 {
304 other->_icloudAccountState = _icloudAccountState;
305 other->_has.icloudAccountState = YES;
306 }
307 if (self->_has.epoch)
308 {
309 other->_epoch = _epoch;
310 other->_has.epoch = YES;
311 }
312 if (_altDSID)
313 {
314 other.altDSID = _altDSID;
315 }
316 if (self->_has.trustState)
317 {
318 other->_trustState = _trustState;
319 other->_has.trustState = YES;
320 }
321 if (self->_has.lastHealthCheckup)
322 {
323 other->_lastHealthCheckup = _lastHealthCheckup;
324 other->_has.lastHealthCheckup = YES;
325 }
326 if (self->_has.attemptedJoin)
327 {
328 other->_attemptedJoin = _attemptedJoin;
329 other->_has.attemptedJoin = YES;
330 }
331 }
332
333 - (id)copyWithZone:(NSZone *)zone
334 {
335 OTAccountMetadataClassC *copy = [[[self class] allocWithZone:zone] init];
336 copy->_peerID = [_peerID copyWithZone:zone];
337 if (self->_has.icloudAccountState)
338 {
339 copy->_icloudAccountState = _icloudAccountState;
340 copy->_has.icloudAccountState = YES;
341 }
342 if (self->_has.epoch)
343 {
344 copy->_epoch = _epoch;
345 copy->_has.epoch = YES;
346 }
347 copy->_altDSID = [_altDSID copyWithZone:zone];
348 if (self->_has.trustState)
349 {
350 copy->_trustState = _trustState;
351 copy->_has.trustState = YES;
352 }
353 if (self->_has.lastHealthCheckup)
354 {
355 copy->_lastHealthCheckup = _lastHealthCheckup;
356 copy->_has.lastHealthCheckup = YES;
357 }
358 if (self->_has.attemptedJoin)
359 {
360 copy->_attemptedJoin = _attemptedJoin;
361 copy->_has.attemptedJoin = YES;
362 }
363 return copy;
364 }
365
366 - (BOOL)isEqual:(id)object
367 {
368 OTAccountMetadataClassC *other = (OTAccountMetadataClassC *)object;
369 return [other isMemberOfClass:[self class]]
370 &&
371 ((!self->_peerID && !other->_peerID) || [self->_peerID isEqual:other->_peerID])
372 &&
373 ((self->_has.icloudAccountState && other->_has.icloudAccountState && self->_icloudAccountState == other->_icloudAccountState) || (!self->_has.icloudAccountState && !other->_has.icloudAccountState))
374 &&
375 ((self->_has.epoch && other->_has.epoch && self->_epoch == other->_epoch) || (!self->_has.epoch && !other->_has.epoch))
376 &&
377 ((!self->_altDSID && !other->_altDSID) || [self->_altDSID isEqual:other->_altDSID])
378 &&
379 ((self->_has.trustState && other->_has.trustState && self->_trustState == other->_trustState) || (!self->_has.trustState && !other->_has.trustState))
380 &&
381 ((self->_has.lastHealthCheckup && other->_has.lastHealthCheckup && self->_lastHealthCheckup == other->_lastHealthCheckup) || (!self->_has.lastHealthCheckup && !other->_has.lastHealthCheckup))
382 &&
383 ((self->_has.attemptedJoin && other->_has.attemptedJoin && self->_attemptedJoin == other->_attemptedJoin) || (!self->_has.attemptedJoin && !other->_has.attemptedJoin))
384 ;
385 }
386
387 - (NSUInteger)hash
388 {
389 return 0
390 ^
391 [self->_peerID hash]
392 ^
393 (self->_has.icloudAccountState ? PBHashInt((NSUInteger)self->_icloudAccountState) : 0)
394 ^
395 (self->_has.epoch ? PBHashInt((NSUInteger)self->_epoch) : 0)
396 ^
397 [self->_altDSID hash]
398 ^
399 (self->_has.trustState ? PBHashInt((NSUInteger)self->_trustState) : 0)
400 ^
401 (self->_has.lastHealthCheckup ? PBHashInt((NSUInteger)self->_lastHealthCheckup) : 0)
402 ^
403 (self->_has.attemptedJoin ? PBHashInt((NSUInteger)self->_attemptedJoin) : 0)
404 ;
405 }
406
407 - (void)mergeFrom:(OTAccountMetadataClassC *)other
408 {
409 if (other->_peerID)
410 {
411 [self setPeerID:other->_peerID];
412 }
413 if (other->_has.icloudAccountState)
414 {
415 self->_icloudAccountState = other->_icloudAccountState;
416 self->_has.icloudAccountState = YES;
417 }
418 if (other->_has.epoch)
419 {
420 self->_epoch = other->_epoch;
421 self->_has.epoch = YES;
422 }
423 if (other->_altDSID)
424 {
425 [self setAltDSID:other->_altDSID];
426 }
427 if (other->_has.trustState)
428 {
429 self->_trustState = other->_trustState;
430 self->_has.trustState = YES;
431 }
432 if (other->_has.lastHealthCheckup)
433 {
434 self->_lastHealthCheckup = other->_lastHealthCheckup;
435 self->_has.lastHealthCheckup = YES;
436 }
437 if (other->_has.attemptedJoin)
438 {
439 self->_attemptedJoin = other->_attemptedJoin;
440 self->_has.attemptedJoin = YES;
441 }
442 }
443
444 @end
445