1 // This file was automatically generated by protocompiler
3 // Compiled from SecEscrowPendingRecord.proto
5 #import "SecEscrowPendingRecord.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
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.
14 @implementation SecEscrowPendingRecord
20 @synthesize uuid = _uuid;
21 @synthesize certCached = _certCached;
22 - (void)setCertCached:(BOOL)v
24 _has.certCached = YES;
27 - (void)setHasCertCached:(BOOL)f
33 return _has.certCached != 0;
35 - (BOOL)hasSerializedPrerecord
37 return _serializedPrerecord != nil;
39 @synthesize serializedPrerecord = _serializedPrerecord;
40 @synthesize lastCloudServicesTriggerTime = _lastCloudServicesTriggerTime;
41 - (void)setLastCloudServicesTriggerTime:(uint64_t)v
43 _has.lastCloudServicesTriggerTime = YES;
44 _lastCloudServicesTriggerTime = v;
46 - (void)setHasLastCloudServicesTriggerTime:(BOOL)f
48 _has.lastCloudServicesTriggerTime = f;
50 - (BOOL)hasLastCloudServicesTriggerTime
52 return _has.lastCloudServicesTriggerTime != 0;
54 @synthesize lastEscrowAttemptTime = _lastEscrowAttemptTime;
55 - (void)setLastEscrowAttemptTime:(uint64_t)v
57 _has.lastEscrowAttemptTime = YES;
58 _lastEscrowAttemptTime = v;
60 - (void)setHasLastEscrowAttemptTime:(BOOL)f
62 _has.lastEscrowAttemptTime = f;
64 - (BOOL)hasLastEscrowAttemptTime
66 return _has.lastEscrowAttemptTime != 0;
68 @synthesize uploadCompleted = _uploadCompleted;
69 - (void)setUploadCompleted:(BOOL)v
71 _has.uploadCompleted = YES;
74 - (void)setHasUploadCompleted:(BOOL)f
76 _has.uploadCompleted = f;
78 - (BOOL)hasUploadCompleted
80 return _has.uploadCompleted != 0;
82 @synthesize uploadRetries = _uploadRetries;
83 - (void)setUploadRetries:(uint64_t)v
85 _has.uploadRetries = YES;
88 - (void)setHasUploadRetries:(BOOL)f
90 _has.uploadRetries = f;
92 - (BOOL)hasUploadRetries
94 return _has.uploadRetries != 0;
98 return _altDSID != nil;
100 @synthesize altDSID = _altDSID;
101 @synthesize triggerRequestTime = _triggerRequestTime;
102 - (void)setTriggerRequestTime:(uint64_t)v
104 _has.triggerRequestTime = YES;
105 _triggerRequestTime = v;
107 - (void)setHasTriggerRequestTime:(BOOL)f
109 _has.triggerRequestTime = f;
111 - (BOOL)hasTriggerRequestTime
113 return _has.triggerRequestTime != 0;
116 - (NSString *)description
118 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
121 - (NSDictionary *)dictionaryRepresentation
123 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
126 [dict setObject:self->_uuid forKey:@"uuid"];
128 if (self->_has.certCached)
130 [dict setObject:[NSNumber numberWithBool:self->_certCached] forKey:@"certCached"];
132 if (self->_serializedPrerecord)
134 [dict setObject:self->_serializedPrerecord forKey:@"serializedPrerecord"];
136 if (self->_has.lastCloudServicesTriggerTime)
138 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_lastCloudServicesTriggerTime] forKey:@"lastCloudServicesTriggerTime"];
140 if (self->_has.lastEscrowAttemptTime)
142 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_lastEscrowAttemptTime] forKey:@"lastEscrowAttemptTime"];
144 if (self->_has.uploadCompleted)
146 [dict setObject:[NSNumber numberWithBool:self->_uploadCompleted] forKey:@"uploadCompleted"];
148 if (self->_has.uploadRetries)
150 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_uploadRetries] forKey:@"uploadRetries"];
154 [dict setObject:self->_altDSID forKey:@"altDSID"];
156 if (self->_has.triggerRequestTime)
158 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_triggerRequestTime] forKey:@"triggerRequestTime"];
163 BOOL SecEscrowPendingRecordReadFrom(__unsafe_unretained SecEscrowPendingRecord *self, __unsafe_unretained PBDataReader *reader) {
164 while (PBReaderHasMoreData(reader)) {
168 PBReaderReadTag32AndType(reader, &tag, &aType);
170 if (PBReaderHasError(reader))
173 if (aType == TYPE_END_GROUP) {
181 NSString *new_uuid = PBReaderReadString(reader);
182 self->_uuid = new_uuid;
185 case 2 /* certCached */:
187 self->_has.certCached = YES;
188 self->_certCached = PBReaderReadBOOL(reader);
191 case 3 /* serializedPrerecord */:
193 NSData *new_serializedPrerecord = PBReaderReadData(reader);
194 self->_serializedPrerecord = new_serializedPrerecord;
197 case 4 /* lastCloudServicesTriggerTime */:
199 self->_has.lastCloudServicesTriggerTime = YES;
200 self->_lastCloudServicesTriggerTime = PBReaderReadUint64(reader);
203 case 5 /* lastEscrowAttemptTime */:
205 self->_has.lastEscrowAttemptTime = YES;
206 self->_lastEscrowAttemptTime = PBReaderReadUint64(reader);
209 case 6 /* uploadCompleted */:
211 self->_has.uploadCompleted = YES;
212 self->_uploadCompleted = PBReaderReadBOOL(reader);
215 case 7 /* uploadRetries */:
217 self->_has.uploadRetries = YES;
218 self->_uploadRetries = PBReaderReadUint64(reader);
221 case 8 /* altDSID */:
223 NSString *new_altDSID = PBReaderReadString(reader);
224 self->_altDSID = new_altDSID;
227 case 9 /* triggerRequestTime */:
229 self->_has.triggerRequestTime = YES;
230 self->_triggerRequestTime = PBReaderReadUint64(reader);
234 if (!PBReaderSkipValueWithTag(reader, tag, aType))
239 return !PBReaderHasError(reader);
242 - (BOOL)readFrom:(PBDataReader *)reader
244 return SecEscrowPendingRecordReadFrom(self, reader);
246 - (void)writeTo:(PBDataWriter *)writer
252 PBDataWriterWriteStringField(writer, self->_uuid, 1);
257 if (self->_has.certCached)
259 PBDataWriterWriteBOOLField(writer, self->_certCached, 2);
262 /* serializedPrerecord */
264 if (self->_serializedPrerecord)
266 PBDataWriterWriteDataField(writer, self->_serializedPrerecord, 3);
269 /* lastCloudServicesTriggerTime */
271 if (self->_has.lastCloudServicesTriggerTime)
273 PBDataWriterWriteUint64Field(writer, self->_lastCloudServicesTriggerTime, 4);
276 /* lastEscrowAttemptTime */
278 if (self->_has.lastEscrowAttemptTime)
280 PBDataWriterWriteUint64Field(writer, self->_lastEscrowAttemptTime, 5);
283 /* uploadCompleted */
285 if (self->_has.uploadCompleted)
287 PBDataWriterWriteBOOLField(writer, self->_uploadCompleted, 6);
292 if (self->_has.uploadRetries)
294 PBDataWriterWriteUint64Field(writer, self->_uploadRetries, 7);
301 PBDataWriterWriteStringField(writer, self->_altDSID, 8);
304 /* triggerRequestTime */
306 if (self->_has.triggerRequestTime)
308 PBDataWriterWriteUint64Field(writer, self->_triggerRequestTime, 9);
313 - (void)copyTo:(SecEscrowPendingRecord *)other
319 if (self->_has.certCached)
321 other->_certCached = _certCached;
322 other->_has.certCached = YES;
324 if (_serializedPrerecord)
326 other.serializedPrerecord = _serializedPrerecord;
328 if (self->_has.lastCloudServicesTriggerTime)
330 other->_lastCloudServicesTriggerTime = _lastCloudServicesTriggerTime;
331 other->_has.lastCloudServicesTriggerTime = YES;
333 if (self->_has.lastEscrowAttemptTime)
335 other->_lastEscrowAttemptTime = _lastEscrowAttemptTime;
336 other->_has.lastEscrowAttemptTime = YES;
338 if (self->_has.uploadCompleted)
340 other->_uploadCompleted = _uploadCompleted;
341 other->_has.uploadCompleted = YES;
343 if (self->_has.uploadRetries)
345 other->_uploadRetries = _uploadRetries;
346 other->_has.uploadRetries = YES;
350 other.altDSID = _altDSID;
352 if (self->_has.triggerRequestTime)
354 other->_triggerRequestTime = _triggerRequestTime;
355 other->_has.triggerRequestTime = YES;
359 - (id)copyWithZone:(NSZone *)zone
361 SecEscrowPendingRecord *copy = [[[self class] allocWithZone:zone] init];
362 copy->_uuid = [_uuid copyWithZone:zone];
363 if (self->_has.certCached)
365 copy->_certCached = _certCached;
366 copy->_has.certCached = YES;
368 copy->_serializedPrerecord = [_serializedPrerecord copyWithZone:zone];
369 if (self->_has.lastCloudServicesTriggerTime)
371 copy->_lastCloudServicesTriggerTime = _lastCloudServicesTriggerTime;
372 copy->_has.lastCloudServicesTriggerTime = YES;
374 if (self->_has.lastEscrowAttemptTime)
376 copy->_lastEscrowAttemptTime = _lastEscrowAttemptTime;
377 copy->_has.lastEscrowAttemptTime = YES;
379 if (self->_has.uploadCompleted)
381 copy->_uploadCompleted = _uploadCompleted;
382 copy->_has.uploadCompleted = YES;
384 if (self->_has.uploadRetries)
386 copy->_uploadRetries = _uploadRetries;
387 copy->_has.uploadRetries = YES;
389 copy->_altDSID = [_altDSID copyWithZone:zone];
390 if (self->_has.triggerRequestTime)
392 copy->_triggerRequestTime = _triggerRequestTime;
393 copy->_has.triggerRequestTime = YES;
398 - (BOOL)isEqual:(id)object
400 SecEscrowPendingRecord *other = (SecEscrowPendingRecord *)object;
401 return [other isMemberOfClass:[self class]]
403 ((!self->_uuid && !other->_uuid) || [self->_uuid isEqual:other->_uuid])
405 ((self->_has.certCached && other->_has.certCached && ((self->_certCached && other->_certCached) || (!self->_certCached && !other->_certCached))) || (!self->_has.certCached && !other->_has.certCached))
407 ((!self->_serializedPrerecord && !other->_serializedPrerecord) || [self->_serializedPrerecord isEqual:other->_serializedPrerecord])
409 ((self->_has.lastCloudServicesTriggerTime && other->_has.lastCloudServicesTriggerTime && self->_lastCloudServicesTriggerTime == other->_lastCloudServicesTriggerTime) || (!self->_has.lastCloudServicesTriggerTime && !other->_has.lastCloudServicesTriggerTime))
411 ((self->_has.lastEscrowAttemptTime && other->_has.lastEscrowAttemptTime && self->_lastEscrowAttemptTime == other->_lastEscrowAttemptTime) || (!self->_has.lastEscrowAttemptTime && !other->_has.lastEscrowAttemptTime))
413 ((self->_has.uploadCompleted && other->_has.uploadCompleted && ((self->_uploadCompleted && other->_uploadCompleted) || (!self->_uploadCompleted && !other->_uploadCompleted))) || (!self->_has.uploadCompleted && !other->_has.uploadCompleted))
415 ((self->_has.uploadRetries && other->_has.uploadRetries && self->_uploadRetries == other->_uploadRetries) || (!self->_has.uploadRetries && !other->_has.uploadRetries))
417 ((!self->_altDSID && !other->_altDSID) || [self->_altDSID isEqual:other->_altDSID])
419 ((self->_has.triggerRequestTime && other->_has.triggerRequestTime && self->_triggerRequestTime == other->_triggerRequestTime) || (!self->_has.triggerRequestTime && !other->_has.triggerRequestTime))
429 (self->_has.certCached ? PBHashInt((NSUInteger)self->_certCached) : 0)
431 [self->_serializedPrerecord hash]
433 (self->_has.lastCloudServicesTriggerTime ? PBHashInt((NSUInteger)self->_lastCloudServicesTriggerTime) : 0)
435 (self->_has.lastEscrowAttemptTime ? PBHashInt((NSUInteger)self->_lastEscrowAttemptTime) : 0)
437 (self->_has.uploadCompleted ? PBHashInt((NSUInteger)self->_uploadCompleted) : 0)
439 (self->_has.uploadRetries ? PBHashInt((NSUInteger)self->_uploadRetries) : 0)
441 [self->_altDSID hash]
443 (self->_has.triggerRequestTime ? PBHashInt((NSUInteger)self->_triggerRequestTime) : 0)
447 - (void)mergeFrom:(SecEscrowPendingRecord *)other
451 [self setUuid:other->_uuid];
453 if (other->_has.certCached)
455 self->_certCached = other->_certCached;
456 self->_has.certCached = YES;
458 if (other->_serializedPrerecord)
460 [self setSerializedPrerecord:other->_serializedPrerecord];
462 if (other->_has.lastCloudServicesTriggerTime)
464 self->_lastCloudServicesTriggerTime = other->_lastCloudServicesTriggerTime;
465 self->_has.lastCloudServicesTriggerTime = YES;
467 if (other->_has.lastEscrowAttemptTime)
469 self->_lastEscrowAttemptTime = other->_lastEscrowAttemptTime;
470 self->_has.lastEscrowAttemptTime = YES;
472 if (other->_has.uploadCompleted)
474 self->_uploadCompleted = other->_uploadCompleted;
475 self->_has.uploadCompleted = YES;
477 if (other->_has.uploadRetries)
479 self->_uploadRetries = other->_uploadRetries;
480 self->_has.uploadRetries = YES;
484 [self setAltDSID:other->_altDSID];
486 if (other->_has.triggerRequestTime)
488 self->_triggerRequestTime = other->_triggerRequestTime;
489 self->_has.triggerRequestTime = YES;