]> git.saurik.com Git - apple/security.git/blob - keychain/ot/proto/generated_source/OTEscrowRecordMetadataClientMetadata.m
Security-59754.80.3.tar.gz
[apple/security.git] / keychain / ot / proto / generated_source / OTEscrowRecordMetadataClientMetadata.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from OTEscrowRecord.proto
4
5 #import "OTEscrowRecordMetadataClientMetadata.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 OTEscrowRecordMetadataClientMetadata
15
16 @synthesize secureBackupMetadataTimestamp = _secureBackupMetadataTimestamp;
17 - (void)setSecureBackupMetadataTimestamp:(uint64_t)v
18 {
19 _has.secureBackupMetadataTimestamp = YES;
20 _secureBackupMetadataTimestamp = v;
21 }
22 - (void)setHasSecureBackupMetadataTimestamp:(BOOL)f
23 {
24 _has.secureBackupMetadataTimestamp = f;
25 }
26 - (BOOL)hasSecureBackupMetadataTimestamp
27 {
28 return _has.secureBackupMetadataTimestamp != 0;
29 }
30 @synthesize secureBackupNumericPassphraseLength = _secureBackupNumericPassphraseLength;
31 - (void)setSecureBackupNumericPassphraseLength:(uint64_t)v
32 {
33 _has.secureBackupNumericPassphraseLength = YES;
34 _secureBackupNumericPassphraseLength = v;
35 }
36 - (void)setHasSecureBackupNumericPassphraseLength:(BOOL)f
37 {
38 _has.secureBackupNumericPassphraseLength = f;
39 }
40 - (BOOL)hasSecureBackupNumericPassphraseLength
41 {
42 return _has.secureBackupNumericPassphraseLength != 0;
43 }
44 @synthesize secureBackupUsesComplexPassphrase = _secureBackupUsesComplexPassphrase;
45 - (void)setSecureBackupUsesComplexPassphrase:(uint64_t)v
46 {
47 _has.secureBackupUsesComplexPassphrase = YES;
48 _secureBackupUsesComplexPassphrase = v;
49 }
50 - (void)setHasSecureBackupUsesComplexPassphrase:(BOOL)f
51 {
52 _has.secureBackupUsesComplexPassphrase = f;
53 }
54 - (BOOL)hasSecureBackupUsesComplexPassphrase
55 {
56 return _has.secureBackupUsesComplexPassphrase != 0;
57 }
58 @synthesize secureBackupUsesNumericPassphrase = _secureBackupUsesNumericPassphrase;
59 - (void)setSecureBackupUsesNumericPassphrase:(uint64_t)v
60 {
61 _has.secureBackupUsesNumericPassphrase = YES;
62 _secureBackupUsesNumericPassphrase = v;
63 }
64 - (void)setHasSecureBackupUsesNumericPassphrase:(BOOL)f
65 {
66 _has.secureBackupUsesNumericPassphrase = f;
67 }
68 - (BOOL)hasSecureBackupUsesNumericPassphrase
69 {
70 return _has.secureBackupUsesNumericPassphrase != 0;
71 }
72 - (BOOL)hasDeviceColor
73 {
74 return _deviceColor != nil;
75 }
76 @synthesize deviceColor = _deviceColor;
77 - (BOOL)hasDeviceEnclosureColor
78 {
79 return _deviceEnclosureColor != nil;
80 }
81 @synthesize deviceEnclosureColor = _deviceEnclosureColor;
82 - (BOOL)hasDeviceMid
83 {
84 return _deviceMid != nil;
85 }
86 @synthesize deviceMid = _deviceMid;
87 - (BOOL)hasDeviceModel
88 {
89 return _deviceModel != nil;
90 }
91 @synthesize deviceModel = _deviceModel;
92 - (BOOL)hasDeviceModelClass
93 {
94 return _deviceModelClass != nil;
95 }
96 @synthesize deviceModelClass = _deviceModelClass;
97 - (BOOL)hasDeviceModelVersion
98 {
99 return _deviceModelVersion != nil;
100 }
101 @synthesize deviceModelVersion = _deviceModelVersion;
102 - (BOOL)hasDeviceName
103 {
104 return _deviceName != nil;
105 }
106 @synthesize deviceName = _deviceName;
107 @synthesize devicePlatform = _devicePlatform;
108 - (void)setDevicePlatform:(uint64_t)v
109 {
110 _has.devicePlatform = YES;
111 _devicePlatform = v;
112 }
113 - (void)setHasDevicePlatform:(BOOL)f
114 {
115 _has.devicePlatform = f;
116 }
117 - (BOOL)hasDevicePlatform
118 {
119 return _has.devicePlatform != 0;
120 }
121
122 - (NSString *)description
123 {
124 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
125 }
126
127 - (NSDictionary *)dictionaryRepresentation
128 {
129 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
130 if (self->_has.secureBackupMetadataTimestamp)
131 {
132 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_secureBackupMetadataTimestamp] forKey:@"secure_backup_metadata_timestamp"];
133 }
134 if (self->_has.secureBackupNumericPassphraseLength)
135 {
136 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_secureBackupNumericPassphraseLength] forKey:@"secure_backup_numeric_passphrase_length"];
137 }
138 if (self->_has.secureBackupUsesComplexPassphrase)
139 {
140 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_secureBackupUsesComplexPassphrase] forKey:@"secure_backup_uses_complex_passphrase"];
141 }
142 if (self->_has.secureBackupUsesNumericPassphrase)
143 {
144 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_secureBackupUsesNumericPassphrase] forKey:@"secure_backup_uses_numeric_passphrase"];
145 }
146 if (self->_deviceColor)
147 {
148 [dict setObject:self->_deviceColor forKey:@"device_color"];
149 }
150 if (self->_deviceEnclosureColor)
151 {
152 [dict setObject:self->_deviceEnclosureColor forKey:@"device_enclosure_color"];
153 }
154 if (self->_deviceMid)
155 {
156 [dict setObject:self->_deviceMid forKey:@"device_mid"];
157 }
158 if (self->_deviceModel)
159 {
160 [dict setObject:self->_deviceModel forKey:@"device_model"];
161 }
162 if (self->_deviceModelClass)
163 {
164 [dict setObject:self->_deviceModelClass forKey:@"device_model_class"];
165 }
166 if (self->_deviceModelVersion)
167 {
168 [dict setObject:self->_deviceModelVersion forKey:@"device_model_version"];
169 }
170 if (self->_deviceName)
171 {
172 [dict setObject:self->_deviceName forKey:@"device_name"];
173 }
174 if (self->_has.devicePlatform)
175 {
176 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_devicePlatform] forKey:@"device_platform"];
177 }
178 return dict;
179 }
180
181 BOOL OTEscrowRecordMetadataClientMetadataReadFrom(__unsafe_unretained OTEscrowRecordMetadataClientMetadata *self, __unsafe_unretained PBDataReader *reader) {
182 while (PBReaderHasMoreData(reader)) {
183 uint32_t tag = 0;
184 uint8_t aType = 0;
185
186 PBReaderReadTag32AndType(reader, &tag, &aType);
187
188 if (PBReaderHasError(reader))
189 break;
190
191 if (aType == TYPE_END_GROUP) {
192 break;
193 }
194
195 switch (tag) {
196
197 case 1 /* secureBackupMetadataTimestamp */:
198 {
199 self->_has.secureBackupMetadataTimestamp = YES;
200 self->_secureBackupMetadataTimestamp = PBReaderReadUint64(reader);
201 }
202 break;
203 case 2 /* secureBackupNumericPassphraseLength */:
204 {
205 self->_has.secureBackupNumericPassphraseLength = YES;
206 self->_secureBackupNumericPassphraseLength = PBReaderReadUint64(reader);
207 }
208 break;
209 case 3 /* secureBackupUsesComplexPassphrase */:
210 {
211 self->_has.secureBackupUsesComplexPassphrase = YES;
212 self->_secureBackupUsesComplexPassphrase = PBReaderReadUint64(reader);
213 }
214 break;
215 case 4 /* secureBackupUsesNumericPassphrase */:
216 {
217 self->_has.secureBackupUsesNumericPassphrase = YES;
218 self->_secureBackupUsesNumericPassphrase = PBReaderReadUint64(reader);
219 }
220 break;
221 case 5 /* deviceColor */:
222 {
223 NSString *new_deviceColor = PBReaderReadString(reader);
224 self->_deviceColor = new_deviceColor;
225 }
226 break;
227 case 6 /* deviceEnclosureColor */:
228 {
229 NSString *new_deviceEnclosureColor = PBReaderReadString(reader);
230 self->_deviceEnclosureColor = new_deviceEnclosureColor;
231 }
232 break;
233 case 7 /* deviceMid */:
234 {
235 NSString *new_deviceMid = PBReaderReadString(reader);
236 self->_deviceMid = new_deviceMid;
237 }
238 break;
239 case 8 /* deviceModel */:
240 {
241 NSString *new_deviceModel = PBReaderReadString(reader);
242 self->_deviceModel = new_deviceModel;
243 }
244 break;
245 case 9 /* deviceModelClass */:
246 {
247 NSString *new_deviceModelClass = PBReaderReadString(reader);
248 self->_deviceModelClass = new_deviceModelClass;
249 }
250 break;
251 case 10 /* deviceModelVersion */:
252 {
253 NSString *new_deviceModelVersion = PBReaderReadString(reader);
254 self->_deviceModelVersion = new_deviceModelVersion;
255 }
256 break;
257 case 11 /* deviceName */:
258 {
259 NSString *new_deviceName = PBReaderReadString(reader);
260 self->_deviceName = new_deviceName;
261 }
262 break;
263 case 12 /* devicePlatform */:
264 {
265 self->_has.devicePlatform = YES;
266 self->_devicePlatform = PBReaderReadUint64(reader);
267 }
268 break;
269 default:
270 if (!PBReaderSkipValueWithTag(reader, tag, aType))
271 return NO;
272 break;
273 }
274 }
275 return !PBReaderHasError(reader);
276 }
277
278 - (BOOL)readFrom:(PBDataReader *)reader
279 {
280 return OTEscrowRecordMetadataClientMetadataReadFrom(self, reader);
281 }
282 - (void)writeTo:(PBDataWriter *)writer
283 {
284 /* secureBackupMetadataTimestamp */
285 {
286 if (self->_has.secureBackupMetadataTimestamp)
287 {
288 PBDataWriterWriteUint64Field(writer, self->_secureBackupMetadataTimestamp, 1);
289 }
290 }
291 /* secureBackupNumericPassphraseLength */
292 {
293 if (self->_has.secureBackupNumericPassphraseLength)
294 {
295 PBDataWriterWriteUint64Field(writer, self->_secureBackupNumericPassphraseLength, 2);
296 }
297 }
298 /* secureBackupUsesComplexPassphrase */
299 {
300 if (self->_has.secureBackupUsesComplexPassphrase)
301 {
302 PBDataWriterWriteUint64Field(writer, self->_secureBackupUsesComplexPassphrase, 3);
303 }
304 }
305 /* secureBackupUsesNumericPassphrase */
306 {
307 if (self->_has.secureBackupUsesNumericPassphrase)
308 {
309 PBDataWriterWriteUint64Field(writer, self->_secureBackupUsesNumericPassphrase, 4);
310 }
311 }
312 /* deviceColor */
313 {
314 if (self->_deviceColor)
315 {
316 PBDataWriterWriteStringField(writer, self->_deviceColor, 5);
317 }
318 }
319 /* deviceEnclosureColor */
320 {
321 if (self->_deviceEnclosureColor)
322 {
323 PBDataWriterWriteStringField(writer, self->_deviceEnclosureColor, 6);
324 }
325 }
326 /* deviceMid */
327 {
328 if (self->_deviceMid)
329 {
330 PBDataWriterWriteStringField(writer, self->_deviceMid, 7);
331 }
332 }
333 /* deviceModel */
334 {
335 if (self->_deviceModel)
336 {
337 PBDataWriterWriteStringField(writer, self->_deviceModel, 8);
338 }
339 }
340 /* deviceModelClass */
341 {
342 if (self->_deviceModelClass)
343 {
344 PBDataWriterWriteStringField(writer, self->_deviceModelClass, 9);
345 }
346 }
347 /* deviceModelVersion */
348 {
349 if (self->_deviceModelVersion)
350 {
351 PBDataWriterWriteStringField(writer, self->_deviceModelVersion, 10);
352 }
353 }
354 /* deviceName */
355 {
356 if (self->_deviceName)
357 {
358 PBDataWriterWriteStringField(writer, self->_deviceName, 11);
359 }
360 }
361 /* devicePlatform */
362 {
363 if (self->_has.devicePlatform)
364 {
365 PBDataWriterWriteUint64Field(writer, self->_devicePlatform, 12);
366 }
367 }
368 }
369
370 - (void)copyTo:(OTEscrowRecordMetadataClientMetadata *)other
371 {
372 if (self->_has.secureBackupMetadataTimestamp)
373 {
374 other->_secureBackupMetadataTimestamp = _secureBackupMetadataTimestamp;
375 other->_has.secureBackupMetadataTimestamp = YES;
376 }
377 if (self->_has.secureBackupNumericPassphraseLength)
378 {
379 other->_secureBackupNumericPassphraseLength = _secureBackupNumericPassphraseLength;
380 other->_has.secureBackupNumericPassphraseLength = YES;
381 }
382 if (self->_has.secureBackupUsesComplexPassphrase)
383 {
384 other->_secureBackupUsesComplexPassphrase = _secureBackupUsesComplexPassphrase;
385 other->_has.secureBackupUsesComplexPassphrase = YES;
386 }
387 if (self->_has.secureBackupUsesNumericPassphrase)
388 {
389 other->_secureBackupUsesNumericPassphrase = _secureBackupUsesNumericPassphrase;
390 other->_has.secureBackupUsesNumericPassphrase = YES;
391 }
392 if (_deviceColor)
393 {
394 other.deviceColor = _deviceColor;
395 }
396 if (_deviceEnclosureColor)
397 {
398 other.deviceEnclosureColor = _deviceEnclosureColor;
399 }
400 if (_deviceMid)
401 {
402 other.deviceMid = _deviceMid;
403 }
404 if (_deviceModel)
405 {
406 other.deviceModel = _deviceModel;
407 }
408 if (_deviceModelClass)
409 {
410 other.deviceModelClass = _deviceModelClass;
411 }
412 if (_deviceModelVersion)
413 {
414 other.deviceModelVersion = _deviceModelVersion;
415 }
416 if (_deviceName)
417 {
418 other.deviceName = _deviceName;
419 }
420 if (self->_has.devicePlatform)
421 {
422 other->_devicePlatform = _devicePlatform;
423 other->_has.devicePlatform = YES;
424 }
425 }
426
427 - (id)copyWithZone:(NSZone *)zone
428 {
429 OTEscrowRecordMetadataClientMetadata *copy = [[[self class] allocWithZone:zone] init];
430 if (self->_has.secureBackupMetadataTimestamp)
431 {
432 copy->_secureBackupMetadataTimestamp = _secureBackupMetadataTimestamp;
433 copy->_has.secureBackupMetadataTimestamp = YES;
434 }
435 if (self->_has.secureBackupNumericPassphraseLength)
436 {
437 copy->_secureBackupNumericPassphraseLength = _secureBackupNumericPassphraseLength;
438 copy->_has.secureBackupNumericPassphraseLength = YES;
439 }
440 if (self->_has.secureBackupUsesComplexPassphrase)
441 {
442 copy->_secureBackupUsesComplexPassphrase = _secureBackupUsesComplexPassphrase;
443 copy->_has.secureBackupUsesComplexPassphrase = YES;
444 }
445 if (self->_has.secureBackupUsesNumericPassphrase)
446 {
447 copy->_secureBackupUsesNumericPassphrase = _secureBackupUsesNumericPassphrase;
448 copy->_has.secureBackupUsesNumericPassphrase = YES;
449 }
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)
458 {
459 copy->_devicePlatform = _devicePlatform;
460 copy->_has.devicePlatform = YES;
461 }
462 return copy;
463 }
464
465 - (BOOL)isEqual:(id)object
466 {
467 OTEscrowRecordMetadataClientMetadata *other = (OTEscrowRecordMetadataClientMetadata *)object;
468 return [other isMemberOfClass:[self class]]
469 &&
470 ((self->_has.secureBackupMetadataTimestamp && other->_has.secureBackupMetadataTimestamp && self->_secureBackupMetadataTimestamp == other->_secureBackupMetadataTimestamp) || (!self->_has.secureBackupMetadataTimestamp && !other->_has.secureBackupMetadataTimestamp))
471 &&
472 ((self->_has.secureBackupNumericPassphraseLength && other->_has.secureBackupNumericPassphraseLength && self->_secureBackupNumericPassphraseLength == other->_secureBackupNumericPassphraseLength) || (!self->_has.secureBackupNumericPassphraseLength && !other->_has.secureBackupNumericPassphraseLength))
473 &&
474 ((self->_has.secureBackupUsesComplexPassphrase && other->_has.secureBackupUsesComplexPassphrase && self->_secureBackupUsesComplexPassphrase == other->_secureBackupUsesComplexPassphrase) || (!self->_has.secureBackupUsesComplexPassphrase && !other->_has.secureBackupUsesComplexPassphrase))
475 &&
476 ((self->_has.secureBackupUsesNumericPassphrase && other->_has.secureBackupUsesNumericPassphrase && self->_secureBackupUsesNumericPassphrase == other->_secureBackupUsesNumericPassphrase) || (!self->_has.secureBackupUsesNumericPassphrase && !other->_has.secureBackupUsesNumericPassphrase))
477 &&
478 ((!self->_deviceColor && !other->_deviceColor) || [self->_deviceColor isEqual:other->_deviceColor])
479 &&
480 ((!self->_deviceEnclosureColor && !other->_deviceEnclosureColor) || [self->_deviceEnclosureColor isEqual:other->_deviceEnclosureColor])
481 &&
482 ((!self->_deviceMid && !other->_deviceMid) || [self->_deviceMid isEqual:other->_deviceMid])
483 &&
484 ((!self->_deviceModel && !other->_deviceModel) || [self->_deviceModel isEqual:other->_deviceModel])
485 &&
486 ((!self->_deviceModelClass && !other->_deviceModelClass) || [self->_deviceModelClass isEqual:other->_deviceModelClass])
487 &&
488 ((!self->_deviceModelVersion && !other->_deviceModelVersion) || [self->_deviceModelVersion isEqual:other->_deviceModelVersion])
489 &&
490 ((!self->_deviceName && !other->_deviceName) || [self->_deviceName isEqual:other->_deviceName])
491 &&
492 ((self->_has.devicePlatform && other->_has.devicePlatform && self->_devicePlatform == other->_devicePlatform) || (!self->_has.devicePlatform && !other->_has.devicePlatform))
493 ;
494 }
495
496 - (NSUInteger)hash
497 {
498 return 0
499 ^
500 (self->_has.secureBackupMetadataTimestamp ? PBHashInt((NSUInteger)self->_secureBackupMetadataTimestamp) : 0)
501 ^
502 (self->_has.secureBackupNumericPassphraseLength ? PBHashInt((NSUInteger)self->_secureBackupNumericPassphraseLength) : 0)
503 ^
504 (self->_has.secureBackupUsesComplexPassphrase ? PBHashInt((NSUInteger)self->_secureBackupUsesComplexPassphrase) : 0)
505 ^
506 (self->_has.secureBackupUsesNumericPassphrase ? PBHashInt((NSUInteger)self->_secureBackupUsesNumericPassphrase) : 0)
507 ^
508 [self->_deviceColor hash]
509 ^
510 [self->_deviceEnclosureColor hash]
511 ^
512 [self->_deviceMid hash]
513 ^
514 [self->_deviceModel hash]
515 ^
516 [self->_deviceModelClass hash]
517 ^
518 [self->_deviceModelVersion hash]
519 ^
520 [self->_deviceName hash]
521 ^
522 (self->_has.devicePlatform ? PBHashInt((NSUInteger)self->_devicePlatform) : 0)
523 ;
524 }
525
526 - (void)mergeFrom:(OTEscrowRecordMetadataClientMetadata *)other
527 {
528 if (other->_has.secureBackupMetadataTimestamp)
529 {
530 self->_secureBackupMetadataTimestamp = other->_secureBackupMetadataTimestamp;
531 self->_has.secureBackupMetadataTimestamp = YES;
532 }
533 if (other->_has.secureBackupNumericPassphraseLength)
534 {
535 self->_secureBackupNumericPassphraseLength = other->_secureBackupNumericPassphraseLength;
536 self->_has.secureBackupNumericPassphraseLength = YES;
537 }
538 if (other->_has.secureBackupUsesComplexPassphrase)
539 {
540 self->_secureBackupUsesComplexPassphrase = other->_secureBackupUsesComplexPassphrase;
541 self->_has.secureBackupUsesComplexPassphrase = YES;
542 }
543 if (other->_has.secureBackupUsesNumericPassphrase)
544 {
545 self->_secureBackupUsesNumericPassphrase = other->_secureBackupUsesNumericPassphrase;
546 self->_has.secureBackupUsesNumericPassphrase = YES;
547 }
548 if (other->_deviceColor)
549 {
550 [self setDeviceColor:other->_deviceColor];
551 }
552 if (other->_deviceEnclosureColor)
553 {
554 [self setDeviceEnclosureColor:other->_deviceEnclosureColor];
555 }
556 if (other->_deviceMid)
557 {
558 [self setDeviceMid:other->_deviceMid];
559 }
560 if (other->_deviceModel)
561 {
562 [self setDeviceModel:other->_deviceModel];
563 }
564 if (other->_deviceModelClass)
565 {
566 [self setDeviceModelClass:other->_deviceModelClass];
567 }
568 if (other->_deviceModelVersion)
569 {
570 [self setDeviceModelVersion:other->_deviceModelVersion];
571 }
572 if (other->_deviceName)
573 {
574 [self setDeviceName:other->_deviceName];
575 }
576 if (other->_has.devicePlatform)
577 {
578 self->_devicePlatform = other->_devicePlatform;
579 self->_has.devicePlatform = YES;
580 }
581 }
582
583 @end
584