1 // This file was automatically generated by protocompiler
3 // Compiled from OTEscrowRecord.proto
5 #import "OTEscrowRecordMetadataClientMetadata.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 OTEscrowRecordMetadataClientMetadata
16 @synthesize secureBackupMetadataTimestamp = _secureBackupMetadataTimestamp;
17 - (void)setSecureBackupMetadataTimestamp:(uint64_t)v
19 _has.secureBackupMetadataTimestamp = YES;
20 _secureBackupMetadataTimestamp = v;
22 - (void)setHasSecureBackupMetadataTimestamp:(BOOL)f
24 _has.secureBackupMetadataTimestamp = f;
26 - (BOOL)hasSecureBackupMetadataTimestamp
28 return _has.secureBackupMetadataTimestamp != 0;
30 @synthesize secureBackupNumericPassphraseLength = _secureBackupNumericPassphraseLength;
31 - (void)setSecureBackupNumericPassphraseLength:(uint64_t)v
33 _has.secureBackupNumericPassphraseLength = YES;
34 _secureBackupNumericPassphraseLength = v;
36 - (void)setHasSecureBackupNumericPassphraseLength:(BOOL)f
38 _has.secureBackupNumericPassphraseLength = f;
40 - (BOOL)hasSecureBackupNumericPassphraseLength
42 return _has.secureBackupNumericPassphraseLength != 0;
44 @synthesize secureBackupUsesComplexPassphrase = _secureBackupUsesComplexPassphrase;
45 - (void)setSecureBackupUsesComplexPassphrase:(uint64_t)v
47 _has.secureBackupUsesComplexPassphrase = YES;
48 _secureBackupUsesComplexPassphrase = v;
50 - (void)setHasSecureBackupUsesComplexPassphrase:(BOOL)f
52 _has.secureBackupUsesComplexPassphrase = f;
54 - (BOOL)hasSecureBackupUsesComplexPassphrase
56 return _has.secureBackupUsesComplexPassphrase != 0;
58 @synthesize secureBackupUsesNumericPassphrase = _secureBackupUsesNumericPassphrase;
59 - (void)setSecureBackupUsesNumericPassphrase:(uint64_t)v
61 _has.secureBackupUsesNumericPassphrase = YES;
62 _secureBackupUsesNumericPassphrase = v;
64 - (void)setHasSecureBackupUsesNumericPassphrase:(BOOL)f
66 _has.secureBackupUsesNumericPassphrase = f;
68 - (BOOL)hasSecureBackupUsesNumericPassphrase
70 return _has.secureBackupUsesNumericPassphrase != 0;
72 - (BOOL)hasDeviceColor
74 return _deviceColor != nil;
76 @synthesize deviceColor = _deviceColor;
77 - (BOOL)hasDeviceEnclosureColor
79 return _deviceEnclosureColor != nil;
81 @synthesize deviceEnclosureColor = _deviceEnclosureColor;
84 return _deviceMid != nil;
86 @synthesize deviceMid = _deviceMid;
87 - (BOOL)hasDeviceModel
89 return _deviceModel != nil;
91 @synthesize deviceModel = _deviceModel;
92 - (BOOL)hasDeviceModelClass
94 return _deviceModelClass != nil;
96 @synthesize deviceModelClass = _deviceModelClass;
97 - (BOOL)hasDeviceModelVersion
99 return _deviceModelVersion != nil;
101 @synthesize deviceModelVersion = _deviceModelVersion;
102 - (BOOL)hasDeviceName
104 return _deviceName != nil;
106 @synthesize deviceName = _deviceName;
107 @synthesize devicePlatform = _devicePlatform;
108 - (void)setDevicePlatform:(uint64_t)v
110 _has.devicePlatform = YES;
113 - (void)setHasDevicePlatform:(BOOL)f
115 _has.devicePlatform = f;
117 - (BOOL)hasDevicePlatform
119 return _has.devicePlatform != 0;
122 - (NSString *)description
124 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
127 - (NSDictionary *)dictionaryRepresentation
129 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
130 if (self->_has.secureBackupMetadataTimestamp)
132 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_secureBackupMetadataTimestamp] forKey:@"secure_backup_metadata_timestamp"];
134 if (self->_has.secureBackupNumericPassphraseLength)
136 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_secureBackupNumericPassphraseLength] forKey:@"secure_backup_numeric_passphrase_length"];
138 if (self->_has.secureBackupUsesComplexPassphrase)
140 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_secureBackupUsesComplexPassphrase] forKey:@"secure_backup_uses_complex_passphrase"];
142 if (self->_has.secureBackupUsesNumericPassphrase)
144 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_secureBackupUsesNumericPassphrase] forKey:@"secure_backup_uses_numeric_passphrase"];
146 if (self->_deviceColor)
148 [dict setObject:self->_deviceColor forKey:@"device_color"];
150 if (self->_deviceEnclosureColor)
152 [dict setObject:self->_deviceEnclosureColor forKey:@"device_enclosure_color"];
154 if (self->_deviceMid)
156 [dict setObject:self->_deviceMid forKey:@"device_mid"];
158 if (self->_deviceModel)
160 [dict setObject:self->_deviceModel forKey:@"device_model"];
162 if (self->_deviceModelClass)
164 [dict setObject:self->_deviceModelClass forKey:@"device_model_class"];
166 if (self->_deviceModelVersion)
168 [dict setObject:self->_deviceModelVersion forKey:@"device_model_version"];
170 if (self->_deviceName)
172 [dict setObject:self->_deviceName forKey:@"device_name"];
174 if (self->_has.devicePlatform)
176 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_devicePlatform] forKey:@"device_platform"];
181 BOOL OTEscrowRecordMetadataClientMetadataReadFrom(__unsafe_unretained OTEscrowRecordMetadataClientMetadata *self, __unsafe_unretained PBDataReader *reader) {
182 while (PBReaderHasMoreData(reader)) {
186 PBReaderReadTag32AndType(reader, &tag, &aType);
188 if (PBReaderHasError(reader))
191 if (aType == TYPE_END_GROUP) {
197 case 1 /* secureBackupMetadataTimestamp */:
199 self->_has.secureBackupMetadataTimestamp = YES;
200 self->_secureBackupMetadataTimestamp = PBReaderReadUint64(reader);
203 case 2 /* secureBackupNumericPassphraseLength */:
205 self->_has.secureBackupNumericPassphraseLength = YES;
206 self->_secureBackupNumericPassphraseLength = PBReaderReadUint64(reader);
209 case 3 /* secureBackupUsesComplexPassphrase */:
211 self->_has.secureBackupUsesComplexPassphrase = YES;
212 self->_secureBackupUsesComplexPassphrase = PBReaderReadUint64(reader);
215 case 4 /* secureBackupUsesNumericPassphrase */:
217 self->_has.secureBackupUsesNumericPassphrase = YES;
218 self->_secureBackupUsesNumericPassphrase = PBReaderReadUint64(reader);
221 case 5 /* deviceColor */:
223 NSString *new_deviceColor = PBReaderReadString(reader);
224 self->_deviceColor = new_deviceColor;
227 case 6 /* deviceEnclosureColor */:
229 NSString *new_deviceEnclosureColor = PBReaderReadString(reader);
230 self->_deviceEnclosureColor = new_deviceEnclosureColor;
233 case 7 /* deviceMid */:
235 NSString *new_deviceMid = PBReaderReadString(reader);
236 self->_deviceMid = new_deviceMid;
239 case 8 /* deviceModel */:
241 NSString *new_deviceModel = PBReaderReadString(reader);
242 self->_deviceModel = new_deviceModel;
245 case 9 /* deviceModelClass */:
247 NSString *new_deviceModelClass = PBReaderReadString(reader);
248 self->_deviceModelClass = new_deviceModelClass;
251 case 10 /* deviceModelVersion */:
253 NSString *new_deviceModelVersion = PBReaderReadString(reader);
254 self->_deviceModelVersion = new_deviceModelVersion;
257 case 11 /* deviceName */:
259 NSString *new_deviceName = PBReaderReadString(reader);
260 self->_deviceName = new_deviceName;
263 case 12 /* devicePlatform */:
265 self->_has.devicePlatform = YES;
266 self->_devicePlatform = PBReaderReadUint64(reader);
270 if (!PBReaderSkipValueWithTag(reader, tag, aType))
275 return !PBReaderHasError(reader);
278 - (BOOL)readFrom:(PBDataReader *)reader
280 return OTEscrowRecordMetadataClientMetadataReadFrom(self, reader);
282 - (void)writeTo:(PBDataWriter *)writer
284 /* secureBackupMetadataTimestamp */
286 if (self->_has.secureBackupMetadataTimestamp)
288 PBDataWriterWriteUint64Field(writer, self->_secureBackupMetadataTimestamp, 1);
291 /* secureBackupNumericPassphraseLength */
293 if (self->_has.secureBackupNumericPassphraseLength)
295 PBDataWriterWriteUint64Field(writer, self->_secureBackupNumericPassphraseLength, 2);
298 /* secureBackupUsesComplexPassphrase */
300 if (self->_has.secureBackupUsesComplexPassphrase)
302 PBDataWriterWriteUint64Field(writer, self->_secureBackupUsesComplexPassphrase, 3);
305 /* secureBackupUsesNumericPassphrase */
307 if (self->_has.secureBackupUsesNumericPassphrase)
309 PBDataWriterWriteUint64Field(writer, self->_secureBackupUsesNumericPassphrase, 4);
314 if (self->_deviceColor)
316 PBDataWriterWriteStringField(writer, self->_deviceColor, 5);
319 /* deviceEnclosureColor */
321 if (self->_deviceEnclosureColor)
323 PBDataWriterWriteStringField(writer, self->_deviceEnclosureColor, 6);
328 if (self->_deviceMid)
330 PBDataWriterWriteStringField(writer, self->_deviceMid, 7);
335 if (self->_deviceModel)
337 PBDataWriterWriteStringField(writer, self->_deviceModel, 8);
340 /* deviceModelClass */
342 if (self->_deviceModelClass)
344 PBDataWriterWriteStringField(writer, self->_deviceModelClass, 9);
347 /* deviceModelVersion */
349 if (self->_deviceModelVersion)
351 PBDataWriterWriteStringField(writer, self->_deviceModelVersion, 10);
356 if (self->_deviceName)
358 PBDataWriterWriteStringField(writer, self->_deviceName, 11);
363 if (self->_has.devicePlatform)
365 PBDataWriterWriteUint64Field(writer, self->_devicePlatform, 12);
370 - (void)copyTo:(OTEscrowRecordMetadataClientMetadata *)other
372 if (self->_has.secureBackupMetadataTimestamp)
374 other->_secureBackupMetadataTimestamp = _secureBackupMetadataTimestamp;
375 other->_has.secureBackupMetadataTimestamp = YES;
377 if (self->_has.secureBackupNumericPassphraseLength)
379 other->_secureBackupNumericPassphraseLength = _secureBackupNumericPassphraseLength;
380 other->_has.secureBackupNumericPassphraseLength = YES;
382 if (self->_has.secureBackupUsesComplexPassphrase)
384 other->_secureBackupUsesComplexPassphrase = _secureBackupUsesComplexPassphrase;
385 other->_has.secureBackupUsesComplexPassphrase = YES;
387 if (self->_has.secureBackupUsesNumericPassphrase)
389 other->_secureBackupUsesNumericPassphrase = _secureBackupUsesNumericPassphrase;
390 other->_has.secureBackupUsesNumericPassphrase = YES;
394 other.deviceColor = _deviceColor;
396 if (_deviceEnclosureColor)
398 other.deviceEnclosureColor = _deviceEnclosureColor;
402 other.deviceMid = _deviceMid;
406 other.deviceModel = _deviceModel;
408 if (_deviceModelClass)
410 other.deviceModelClass = _deviceModelClass;
412 if (_deviceModelVersion)
414 other.deviceModelVersion = _deviceModelVersion;
418 other.deviceName = _deviceName;
420 if (self->_has.devicePlatform)
422 other->_devicePlatform = _devicePlatform;
423 other->_has.devicePlatform = YES;
427 - (id)copyWithZone:(NSZone *)zone
429 OTEscrowRecordMetadataClientMetadata *copy = [[[self class] allocWithZone:zone] init];
430 if (self->_has.secureBackupMetadataTimestamp)
432 copy->_secureBackupMetadataTimestamp = _secureBackupMetadataTimestamp;
433 copy->_has.secureBackupMetadataTimestamp = YES;
435 if (self->_has.secureBackupNumericPassphraseLength)
437 copy->_secureBackupNumericPassphraseLength = _secureBackupNumericPassphraseLength;
438 copy->_has.secureBackupNumericPassphraseLength = YES;
440 if (self->_has.secureBackupUsesComplexPassphrase)
442 copy->_secureBackupUsesComplexPassphrase = _secureBackupUsesComplexPassphrase;
443 copy->_has.secureBackupUsesComplexPassphrase = YES;
445 if (self->_has.secureBackupUsesNumericPassphrase)
447 copy->_secureBackupUsesNumericPassphrase = _secureBackupUsesNumericPassphrase;
448 copy->_has.secureBackupUsesNumericPassphrase = YES;
450 copy->_deviceColor = [_deviceColor copyWithZone:zone];
451 copy->_deviceEnclosureColor = [_deviceEnclosureColor copyWithZone:zone];
452 copy->_deviceMid = [_deviceMid copyWithZone:zone];
453 copy->_deviceModel = [_deviceModel copyWithZone:zone];
454 copy->_deviceModelClass = [_deviceModelClass copyWithZone:zone];
455 copy->_deviceModelVersion = [_deviceModelVersion copyWithZone:zone];
456 copy->_deviceName = [_deviceName copyWithZone:zone];
457 if (self->_has.devicePlatform)
459 copy->_devicePlatform = _devicePlatform;
460 copy->_has.devicePlatform = YES;
465 - (BOOL)isEqual:(id)object
467 OTEscrowRecordMetadataClientMetadata *other = (OTEscrowRecordMetadataClientMetadata *)object;
468 return [other isMemberOfClass:[self class]]
470 ((self->_has.secureBackupMetadataTimestamp && other->_has.secureBackupMetadataTimestamp && self->_secureBackupMetadataTimestamp == other->_secureBackupMetadataTimestamp) || (!self->_has.secureBackupMetadataTimestamp && !other->_has.secureBackupMetadataTimestamp))
472 ((self->_has.secureBackupNumericPassphraseLength && other->_has.secureBackupNumericPassphraseLength && self->_secureBackupNumericPassphraseLength == other->_secureBackupNumericPassphraseLength) || (!self->_has.secureBackupNumericPassphraseLength && !other->_has.secureBackupNumericPassphraseLength))
474 ((self->_has.secureBackupUsesComplexPassphrase && other->_has.secureBackupUsesComplexPassphrase && self->_secureBackupUsesComplexPassphrase == other->_secureBackupUsesComplexPassphrase) || (!self->_has.secureBackupUsesComplexPassphrase && !other->_has.secureBackupUsesComplexPassphrase))
476 ((self->_has.secureBackupUsesNumericPassphrase && other->_has.secureBackupUsesNumericPassphrase && self->_secureBackupUsesNumericPassphrase == other->_secureBackupUsesNumericPassphrase) || (!self->_has.secureBackupUsesNumericPassphrase && !other->_has.secureBackupUsesNumericPassphrase))
478 ((!self->_deviceColor && !other->_deviceColor) || [self->_deviceColor isEqual:other->_deviceColor])
480 ((!self->_deviceEnclosureColor && !other->_deviceEnclosureColor) || [self->_deviceEnclosureColor isEqual:other->_deviceEnclosureColor])
482 ((!self->_deviceMid && !other->_deviceMid) || [self->_deviceMid isEqual:other->_deviceMid])
484 ((!self->_deviceModel && !other->_deviceModel) || [self->_deviceModel isEqual:other->_deviceModel])
486 ((!self->_deviceModelClass && !other->_deviceModelClass) || [self->_deviceModelClass isEqual:other->_deviceModelClass])
488 ((!self->_deviceModelVersion && !other->_deviceModelVersion) || [self->_deviceModelVersion isEqual:other->_deviceModelVersion])
490 ((!self->_deviceName && !other->_deviceName) || [self->_deviceName isEqual:other->_deviceName])
492 ((self->_has.devicePlatform && other->_has.devicePlatform && self->_devicePlatform == other->_devicePlatform) || (!self->_has.devicePlatform && !other->_has.devicePlatform))
500 (self->_has.secureBackupMetadataTimestamp ? PBHashInt((NSUInteger)self->_secureBackupMetadataTimestamp) : 0)
502 (self->_has.secureBackupNumericPassphraseLength ? PBHashInt((NSUInteger)self->_secureBackupNumericPassphraseLength) : 0)
504 (self->_has.secureBackupUsesComplexPassphrase ? PBHashInt((NSUInteger)self->_secureBackupUsesComplexPassphrase) : 0)
506 (self->_has.secureBackupUsesNumericPassphrase ? PBHashInt((NSUInteger)self->_secureBackupUsesNumericPassphrase) : 0)
508 [self->_deviceColor hash]
510 [self->_deviceEnclosureColor hash]
512 [self->_deviceMid hash]
514 [self->_deviceModel hash]
516 [self->_deviceModelClass hash]
518 [self->_deviceModelVersion hash]
520 [self->_deviceName hash]
522 (self->_has.devicePlatform ? PBHashInt((NSUInteger)self->_devicePlatform) : 0)
526 - (void)mergeFrom:(OTEscrowRecordMetadataClientMetadata *)other
528 if (other->_has.secureBackupMetadataTimestamp)
530 self->_secureBackupMetadataTimestamp = other->_secureBackupMetadataTimestamp;
531 self->_has.secureBackupMetadataTimestamp = YES;
533 if (other->_has.secureBackupNumericPassphraseLength)
535 self->_secureBackupNumericPassphraseLength = other->_secureBackupNumericPassphraseLength;
536 self->_has.secureBackupNumericPassphraseLength = YES;
538 if (other->_has.secureBackupUsesComplexPassphrase)
540 self->_secureBackupUsesComplexPassphrase = other->_secureBackupUsesComplexPassphrase;
541 self->_has.secureBackupUsesComplexPassphrase = YES;
543 if (other->_has.secureBackupUsesNumericPassphrase)
545 self->_secureBackupUsesNumericPassphrase = other->_secureBackupUsesNumericPassphrase;
546 self->_has.secureBackupUsesNumericPassphrase = YES;
548 if (other->_deviceColor)
550 [self setDeviceColor:other->_deviceColor];
552 if (other->_deviceEnclosureColor)
554 [self setDeviceEnclosureColor:other->_deviceEnclosureColor];
556 if (other->_deviceMid)
558 [self setDeviceMid:other->_deviceMid];
560 if (other->_deviceModel)
562 [self setDeviceModel:other->_deviceModel];
564 if (other->_deviceModelClass)
566 [self setDeviceModelClass:other->_deviceModelClass];
568 if (other->_deviceModelVersion)
570 [self setDeviceModelVersion:other->_deviceModelVersion];
572 if (other->_deviceName)
574 [self setDeviceName:other->_deviceName];
576 if (other->_has.devicePlatform)
578 self->_devicePlatform = other->_devicePlatform;
579 self->_has.devicePlatform = YES;