1 // This file was automatically generated by protocompiler
3 // Compiled from OTEscrowRecord.proto
5 #import "OTEscrowRecord.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
10 #import "OTEscrowRecordMetadata.h"
12 #if !__has_feature(objc_arc)
13 # 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.
16 @implementation OTEscrowRecord
18 @synthesize creationDate = _creationDate;
19 - (void)setCreationDate:(uint64_t)v
21 _has.creationDate = YES;
24 - (void)setHasCreationDate:(BOOL)f
26 _has.creationDate = f;
28 - (BOOL)hasCreationDate
30 return _has.creationDate != 0;
32 @synthesize remainingAttempts = _remainingAttempts;
33 - (void)setRemainingAttempts:(uint64_t)v
35 _has.remainingAttempts = YES;
36 _remainingAttempts = v;
38 - (void)setHasRemainingAttempts:(BOOL)f
40 _has.remainingAttempts = f;
42 - (BOOL)hasRemainingAttempts
44 return _has.remainingAttempts != 0;
46 - (BOOL)hasEscrowInformationMetadata
48 return _escrowInformationMetadata != nil;
50 @synthesize escrowInformationMetadata = _escrowInformationMetadata;
55 @synthesize label = _label;
56 @synthesize silentAttemptAllowed = _silentAttemptAllowed;
57 - (void)setSilentAttemptAllowed:(uint64_t)v
59 _has.silentAttemptAllowed = YES;
60 _silentAttemptAllowed = v;
62 - (void)setHasSilentAttemptAllowed:(BOOL)f
64 _has.silentAttemptAllowed = f;
66 - (BOOL)hasSilentAttemptAllowed
68 return _has.silentAttemptAllowed != 0;
70 @synthesize recordStatus = _recordStatus;
71 - (OTEscrowRecord_RecordStatus)recordStatus
73 return _has.recordStatus ? _recordStatus : OTEscrowRecord_RecordStatus_RECORD_STATUS_VALID;
75 - (void)setRecordStatus:(OTEscrowRecord_RecordStatus)v
77 _has.recordStatus = YES;
80 - (void)setHasRecordStatus:(BOOL)f
82 _has.recordStatus = f;
84 - (BOOL)hasRecordStatus
86 return _has.recordStatus != 0;
88 - (NSString *)recordStatusAsString:(OTEscrowRecord_RecordStatus)value
90 return OTEscrowRecord_RecordStatusAsString(value);
92 - (OTEscrowRecord_RecordStatus)StringAsRecordStatus:(NSString *)str
94 return StringAsOTEscrowRecord_RecordStatus(str);
98 return _recordId != nil;
100 @synthesize recordId = _recordId;
101 @synthesize recoveryStatus = _recoveryStatus;
102 - (OTEscrowRecord_RecoveryStatus)recoveryStatus
104 return _has.recoveryStatus ? _recoveryStatus : OTEscrowRecord_RecoveryStatus_RECOVERY_STATUS_VALID;
106 - (void)setRecoveryStatus:(OTEscrowRecord_RecoveryStatus)v
108 _has.recoveryStatus = YES;
111 - (void)setHasRecoveryStatus:(BOOL)f
113 _has.recoveryStatus = f;
115 - (BOOL)hasRecoveryStatus
117 return _has.recoveryStatus != 0;
119 - (NSString *)recoveryStatusAsString:(OTEscrowRecord_RecoveryStatus)value
121 return OTEscrowRecord_RecoveryStatusAsString(value);
123 - (OTEscrowRecord_RecoveryStatus)StringAsRecoveryStatus:(NSString *)str
125 return StringAsOTEscrowRecord_RecoveryStatus(str);
127 @synthesize coolOffEnd = _coolOffEnd;
128 - (void)setCoolOffEnd:(uint64_t)v
130 _has.coolOffEnd = YES;
133 - (void)setHasCoolOffEnd:(BOOL)f
137 - (BOOL)hasCoolOffEnd
139 return _has.coolOffEnd != 0;
141 - (BOOL)hasSerialNumber
143 return _serialNumber != nil;
145 @synthesize serialNumber = _serialNumber;
146 @synthesize recordViability = _recordViability;
147 - (OTEscrowRecord_RecordViability)recordViability
149 return _has.recordViability ? _recordViability : OTEscrowRecord_RecordViability_RECORD_VIABILITY_FULLY_VIABLE;
151 - (void)setRecordViability:(OTEscrowRecord_RecordViability)v
153 _has.recordViability = YES;
154 _recordViability = v;
156 - (void)setHasRecordViability:(BOOL)f
158 _has.recordViability = f;
160 - (BOOL)hasRecordViability
162 return _has.recordViability != 0;
164 - (NSString *)recordViabilityAsString:(OTEscrowRecord_RecordViability)value
166 return OTEscrowRecord_RecordViabilityAsString(value);
168 - (OTEscrowRecord_RecordViability)StringAsRecordViability:(NSString *)str
170 return StringAsOTEscrowRecord_RecordViability(str);
172 @synthesize viabilityStatus = _viabilityStatus;
173 - (OTEscrowRecord_SOSViability)viabilityStatus
175 return _has.viabilityStatus ? _viabilityStatus : OTEscrowRecord_SOSViability_SOS_VIABLE_UNKNOWN;
177 - (void)setViabilityStatus:(OTEscrowRecord_SOSViability)v
179 _has.viabilityStatus = YES;
180 _viabilityStatus = v;
182 - (void)setHasViabilityStatus:(BOOL)f
184 _has.viabilityStatus = f;
186 - (BOOL)hasViabilityStatus
188 return _has.viabilityStatus != 0;
190 - (NSString *)viabilityStatusAsString:(OTEscrowRecord_SOSViability)value
192 return OTEscrowRecord_SOSViabilityAsString(value);
194 - (OTEscrowRecord_SOSViability)StringAsViabilityStatus:(NSString *)str
196 return StringAsOTEscrowRecord_SOSViability(str);
199 - (NSString *)description
201 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
204 - (NSDictionary *)dictionaryRepresentation
206 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
207 if (self->_has.creationDate)
209 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_creationDate] forKey:@"creation_date"];
211 if (self->_has.remainingAttempts)
213 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_remainingAttempts] forKey:@"remaining_attempts"];
215 if (self->_escrowInformationMetadata)
217 [dict setObject:[_escrowInformationMetadata dictionaryRepresentation] forKey:@"escrow_information_metadata"];
221 [dict setObject:self->_label forKey:@"label"];
223 if (self->_has.silentAttemptAllowed)
225 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_silentAttemptAllowed] forKey:@"silent_attempt_allowed"];
227 if (self->_has.recordStatus)
229 [dict setObject:OTEscrowRecord_RecordStatusAsString(self->_recordStatus) forKey:@"record_status"];
233 [dict setObject:self->_recordId forKey:@"record_id"];
235 if (self->_has.recoveryStatus)
237 [dict setObject:OTEscrowRecord_RecoveryStatusAsString(self->_recoveryStatus) forKey:@"recovery_status"];
239 if (self->_has.coolOffEnd)
241 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_coolOffEnd] forKey:@"cool_off_end"];
243 if (self->_serialNumber)
245 [dict setObject:self->_serialNumber forKey:@"serial_number"];
247 if (self->_has.recordViability)
249 [dict setObject:OTEscrowRecord_RecordViabilityAsString(self->_recordViability) forKey:@"record_viability"];
251 if (self->_has.viabilityStatus)
253 [dict setObject:OTEscrowRecord_SOSViabilityAsString(self->_viabilityStatus) forKey:@"viability_status"];
258 BOOL OTEscrowRecordReadFrom(__unsafe_unretained OTEscrowRecord *self, __unsafe_unretained PBDataReader *reader) {
259 while (PBReaderHasMoreData(reader)) {
263 PBReaderReadTag32AndType(reader, &tag, &aType);
265 if (PBReaderHasError(reader))
268 if (aType == TYPE_END_GROUP) {
274 case 1 /* creationDate */:
276 self->_has.creationDate = YES;
277 self->_creationDate = PBReaderReadUint64(reader);
280 case 2 /* remainingAttempts */:
282 self->_has.remainingAttempts = YES;
283 self->_remainingAttempts = PBReaderReadUint64(reader);
286 case 3 /* escrowInformationMetadata */:
288 OTEscrowRecordMetadata *new_escrowInformationMetadata = [[OTEscrowRecordMetadata alloc] init];
289 self->_escrowInformationMetadata = new_escrowInformationMetadata;
290 PBDataReaderMark mark_escrowInformationMetadata;
291 BOOL markError = !PBReaderPlaceMark(reader, &mark_escrowInformationMetadata);
296 BOOL inError = !OTEscrowRecordMetadataReadFrom(new_escrowInformationMetadata, reader);
301 PBReaderRecallMark(reader, &mark_escrowInformationMetadata);
306 NSString *new_label = PBReaderReadString(reader);
307 self->_label = new_label;
310 case 9 /* silentAttemptAllowed */:
312 self->_has.silentAttemptAllowed = YES;
313 self->_silentAttemptAllowed = PBReaderReadUint64(reader);
316 case 10 /* recordStatus */:
318 self->_has.recordStatus = YES;
319 self->_recordStatus = PBReaderReadInt32(reader);
322 case 11 /* recordId */:
324 NSString *new_recordId = PBReaderReadString(reader);
325 self->_recordId = new_recordId;
328 case 12 /* recoveryStatus */:
330 self->_has.recoveryStatus = YES;
331 self->_recoveryStatus = PBReaderReadInt32(reader);
334 case 13 /* coolOffEnd */:
336 self->_has.coolOffEnd = YES;
337 self->_coolOffEnd = PBReaderReadUint64(reader);
340 case 14 /* serialNumber */:
342 NSString *new_serialNumber = PBReaderReadString(reader);
343 self->_serialNumber = new_serialNumber;
346 case 15 /* recordViability */:
348 self->_has.recordViability = YES;
349 self->_recordViability = PBReaderReadInt32(reader);
352 case 16 /* viabilityStatus */:
354 self->_has.viabilityStatus = YES;
355 self->_viabilityStatus = PBReaderReadInt32(reader);
359 if (!PBReaderSkipValueWithTag(reader, tag, aType))
364 return !PBReaderHasError(reader);
367 - (BOOL)readFrom:(PBDataReader *)reader
369 return OTEscrowRecordReadFrom(self, reader);
371 - (void)writeTo:(PBDataWriter *)writer
375 if (self->_has.creationDate)
377 PBDataWriterWriteUint64Field(writer, self->_creationDate, 1);
380 /* remainingAttempts */
382 if (self->_has.remainingAttempts)
384 PBDataWriterWriteUint64Field(writer, self->_remainingAttempts, 2);
387 /* escrowInformationMetadata */
389 if (self->_escrowInformationMetadata != nil)
391 PBDataWriterWriteSubmessage(writer, self->_escrowInformationMetadata, 3);
398 PBDataWriterWriteStringField(writer, self->_label, 4);
401 /* silentAttemptAllowed */
403 if (self->_has.silentAttemptAllowed)
405 PBDataWriterWriteUint64Field(writer, self->_silentAttemptAllowed, 9);
410 if (self->_has.recordStatus)
412 PBDataWriterWriteInt32Field(writer, self->_recordStatus, 10);
419 PBDataWriterWriteStringField(writer, self->_recordId, 11);
424 if (self->_has.recoveryStatus)
426 PBDataWriterWriteInt32Field(writer, self->_recoveryStatus, 12);
431 if (self->_has.coolOffEnd)
433 PBDataWriterWriteUint64Field(writer, self->_coolOffEnd, 13);
438 if (self->_serialNumber)
440 PBDataWriterWriteStringField(writer, self->_serialNumber, 14);
443 /* recordViability */
445 if (self->_has.recordViability)
447 PBDataWriterWriteInt32Field(writer, self->_recordViability, 15);
450 /* viabilityStatus */
452 if (self->_has.viabilityStatus)
454 PBDataWriterWriteInt32Field(writer, self->_viabilityStatus, 16);
459 - (void)copyTo:(OTEscrowRecord *)other
461 if (self->_has.creationDate)
463 other->_creationDate = _creationDate;
464 other->_has.creationDate = YES;
466 if (self->_has.remainingAttempts)
468 other->_remainingAttempts = _remainingAttempts;
469 other->_has.remainingAttempts = YES;
471 if (_escrowInformationMetadata)
473 other.escrowInformationMetadata = _escrowInformationMetadata;
477 other.label = _label;
479 if (self->_has.silentAttemptAllowed)
481 other->_silentAttemptAllowed = _silentAttemptAllowed;
482 other->_has.silentAttemptAllowed = YES;
484 if (self->_has.recordStatus)
486 other->_recordStatus = _recordStatus;
487 other->_has.recordStatus = YES;
491 other.recordId = _recordId;
493 if (self->_has.recoveryStatus)
495 other->_recoveryStatus = _recoveryStatus;
496 other->_has.recoveryStatus = YES;
498 if (self->_has.coolOffEnd)
500 other->_coolOffEnd = _coolOffEnd;
501 other->_has.coolOffEnd = YES;
505 other.serialNumber = _serialNumber;
507 if (self->_has.recordViability)
509 other->_recordViability = _recordViability;
510 other->_has.recordViability = YES;
512 if (self->_has.viabilityStatus)
514 other->_viabilityStatus = _viabilityStatus;
515 other->_has.viabilityStatus = YES;
519 - (id)copyWithZone:(NSZone *)zone
521 OTEscrowRecord *copy = [[[self class] allocWithZone:zone] init];
522 if (self->_has.creationDate)
524 copy->_creationDate = _creationDate;
525 copy->_has.creationDate = YES;
527 if (self->_has.remainingAttempts)
529 copy->_remainingAttempts = _remainingAttempts;
530 copy->_has.remainingAttempts = YES;
532 copy->_escrowInformationMetadata = [_escrowInformationMetadata copyWithZone:zone];
533 copy->_label = [_label copyWithZone:zone];
534 if (self->_has.silentAttemptAllowed)
536 copy->_silentAttemptAllowed = _silentAttemptAllowed;
537 copy->_has.silentAttemptAllowed = YES;
539 if (self->_has.recordStatus)
541 copy->_recordStatus = _recordStatus;
542 copy->_has.recordStatus = YES;
544 copy->_recordId = [_recordId copyWithZone:zone];
545 if (self->_has.recoveryStatus)
547 copy->_recoveryStatus = _recoveryStatus;
548 copy->_has.recoveryStatus = YES;
550 if (self->_has.coolOffEnd)
552 copy->_coolOffEnd = _coolOffEnd;
553 copy->_has.coolOffEnd = YES;
555 copy->_serialNumber = [_serialNumber copyWithZone:zone];
556 if (self->_has.recordViability)
558 copy->_recordViability = _recordViability;
559 copy->_has.recordViability = YES;
561 if (self->_has.viabilityStatus)
563 copy->_viabilityStatus = _viabilityStatus;
564 copy->_has.viabilityStatus = YES;
569 - (BOOL)isEqual:(id)object
571 OTEscrowRecord *other = (OTEscrowRecord *)object;
572 return [other isMemberOfClass:[self class]]
574 ((self->_has.creationDate && other->_has.creationDate && self->_creationDate == other->_creationDate) || (!self->_has.creationDate && !other->_has.creationDate))
576 ((self->_has.remainingAttempts && other->_has.remainingAttempts && self->_remainingAttempts == other->_remainingAttempts) || (!self->_has.remainingAttempts && !other->_has.remainingAttempts))
578 ((!self->_escrowInformationMetadata && !other->_escrowInformationMetadata) || [self->_escrowInformationMetadata isEqual:other->_escrowInformationMetadata])
580 ((!self->_label && !other->_label) || [self->_label isEqual:other->_label])
582 ((self->_has.silentAttemptAllowed && other->_has.silentAttemptAllowed && self->_silentAttemptAllowed == other->_silentAttemptAllowed) || (!self->_has.silentAttemptAllowed && !other->_has.silentAttemptAllowed))
584 ((self->_has.recordStatus && other->_has.recordStatus && self->_recordStatus == other->_recordStatus) || (!self->_has.recordStatus && !other->_has.recordStatus))
586 ((!self->_recordId && !other->_recordId) || [self->_recordId isEqual:other->_recordId])
588 ((self->_has.recoveryStatus && other->_has.recoveryStatus && self->_recoveryStatus == other->_recoveryStatus) || (!self->_has.recoveryStatus && !other->_has.recoveryStatus))
590 ((self->_has.coolOffEnd && other->_has.coolOffEnd && self->_coolOffEnd == other->_coolOffEnd) || (!self->_has.coolOffEnd && !other->_has.coolOffEnd))
592 ((!self->_serialNumber && !other->_serialNumber) || [self->_serialNumber isEqual:other->_serialNumber])
594 ((self->_has.recordViability && other->_has.recordViability && self->_recordViability == other->_recordViability) || (!self->_has.recordViability && !other->_has.recordViability))
596 ((self->_has.viabilityStatus && other->_has.viabilityStatus && self->_viabilityStatus == other->_viabilityStatus) || (!self->_has.viabilityStatus && !other->_has.viabilityStatus))
604 (self->_has.creationDate ? PBHashInt((NSUInteger)self->_creationDate) : 0)
606 (self->_has.remainingAttempts ? PBHashInt((NSUInteger)self->_remainingAttempts) : 0)
608 [self->_escrowInformationMetadata hash]
612 (self->_has.silentAttemptAllowed ? PBHashInt((NSUInteger)self->_silentAttemptAllowed) : 0)
614 (self->_has.recordStatus ? PBHashInt((NSUInteger)self->_recordStatus) : 0)
616 [self->_recordId hash]
618 (self->_has.recoveryStatus ? PBHashInt((NSUInteger)self->_recoveryStatus) : 0)
620 (self->_has.coolOffEnd ? PBHashInt((NSUInteger)self->_coolOffEnd) : 0)
622 [self->_serialNumber hash]
624 (self->_has.recordViability ? PBHashInt((NSUInteger)self->_recordViability) : 0)
626 (self->_has.viabilityStatus ? PBHashInt((NSUInteger)self->_viabilityStatus) : 0)
630 - (void)mergeFrom:(OTEscrowRecord *)other
632 if (other->_has.creationDate)
634 self->_creationDate = other->_creationDate;
635 self->_has.creationDate = YES;
637 if (other->_has.remainingAttempts)
639 self->_remainingAttempts = other->_remainingAttempts;
640 self->_has.remainingAttempts = YES;
642 if (self->_escrowInformationMetadata && other->_escrowInformationMetadata)
644 [self->_escrowInformationMetadata mergeFrom:other->_escrowInformationMetadata];
646 else if (!self->_escrowInformationMetadata && other->_escrowInformationMetadata)
648 [self setEscrowInformationMetadata:other->_escrowInformationMetadata];
652 [self setLabel:other->_label];
654 if (other->_has.silentAttemptAllowed)
656 self->_silentAttemptAllowed = other->_silentAttemptAllowed;
657 self->_has.silentAttemptAllowed = YES;
659 if (other->_has.recordStatus)
661 self->_recordStatus = other->_recordStatus;
662 self->_has.recordStatus = YES;
664 if (other->_recordId)
666 [self setRecordId:other->_recordId];
668 if (other->_has.recoveryStatus)
670 self->_recoveryStatus = other->_recoveryStatus;
671 self->_has.recoveryStatus = YES;
673 if (other->_has.coolOffEnd)
675 self->_coolOffEnd = other->_coolOffEnd;
676 self->_has.coolOffEnd = YES;
678 if (other->_serialNumber)
680 [self setSerialNumber:other->_serialNumber];
682 if (other->_has.recordViability)
684 self->_recordViability = other->_recordViability;
685 self->_has.recordViability = YES;
687 if (other->_has.viabilityStatus)
689 self->_viabilityStatus = other->_viabilityStatus;
690 self->_has.viabilityStatus = YES;