1 // This file was automatically generated by protocompiler
3 // Compiled from OTCDPRecoveryInformation.proto
5 #import "OTEscrowAuthenticationInformation.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 OTEscrowAuthenticationInformation
16 - (BOOL)hasAuthenticationPassword
18 return _authenticationPassword != nil;
20 @synthesize authenticationPassword = _authenticationPassword;
21 - (BOOL)hasAuthenticationDsid
23 return _authenticationDsid != nil;
25 @synthesize authenticationDsid = _authenticationDsid;
26 - (BOOL)hasAuthenticationAppleid
28 return _authenticationAppleid != nil;
30 @synthesize authenticationAppleid = _authenticationAppleid;
33 return _fmipUuid != nil;
35 @synthesize fmipUuid = _fmipUuid;
36 @synthesize fmipRecovery = _fmipRecovery;
37 - (void)setFmipRecovery:(BOOL)v
39 _has.fmipRecovery = YES;
42 - (void)setHasFmipRecovery:(BOOL)f
44 _has.fmipRecovery = f;
46 - (BOOL)hasFmipRecovery
48 return _has.fmipRecovery != 0;
50 @synthesize idmsRecovery = _idmsRecovery;
51 - (void)setIdmsRecovery:(BOOL)v
53 _has.idmsRecovery = YES;
56 - (void)setHasIdmsRecovery:(BOOL)f
58 _has.idmsRecovery = f;
60 - (BOOL)hasIdmsRecovery
62 return _has.idmsRecovery != 0;
64 - (BOOL)hasAuthenticationAuthToken
66 return _authenticationAuthToken != nil;
68 @synthesize authenticationAuthToken = _authenticationAuthToken;
69 - (BOOL)hasAuthenticationEscrowproxyUrl
71 return _authenticationEscrowproxyUrl != nil;
73 @synthesize authenticationEscrowproxyUrl = _authenticationEscrowproxyUrl;
74 - (BOOL)hasAuthenticationIcloudEnvironment
76 return _authenticationIcloudEnvironment != nil;
78 @synthesize authenticationIcloudEnvironment = _authenticationIcloudEnvironment;
80 - (NSString *)description
82 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
85 - (NSDictionary *)dictionaryRepresentation
87 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
88 if (self->_authenticationPassword)
90 [dict setObject:self->_authenticationPassword forKey:@"authentication_password"];
92 if (self->_authenticationDsid)
94 [dict setObject:self->_authenticationDsid forKey:@"authentication_dsid"];
96 if (self->_authenticationAppleid)
98 [dict setObject:self->_authenticationAppleid forKey:@"authentication_appleid"];
102 [dict setObject:self->_fmipUuid forKey:@"fmip_uuid"];
104 if (self->_has.fmipRecovery)
106 [dict setObject:[NSNumber numberWithBool:self->_fmipRecovery] forKey:@"fmip_recovery"];
108 if (self->_has.idmsRecovery)
110 [dict setObject:[NSNumber numberWithBool:self->_idmsRecovery] forKey:@"idms_recovery"];
112 if (self->_authenticationAuthToken)
114 [dict setObject:self->_authenticationAuthToken forKey:@"authentication_auth_token"];
116 if (self->_authenticationEscrowproxyUrl)
118 [dict setObject:self->_authenticationEscrowproxyUrl forKey:@"authentication_escrowproxy_url"];
120 if (self->_authenticationIcloudEnvironment)
122 [dict setObject:self->_authenticationIcloudEnvironment forKey:@"authentication_icloud_environment"];
127 BOOL OTEscrowAuthenticationInformationReadFrom(__unsafe_unretained OTEscrowAuthenticationInformation *self, __unsafe_unretained PBDataReader *reader) {
128 while (PBReaderHasMoreData(reader)) {
132 PBReaderReadTag32AndType(reader, &tag, &aType);
134 if (PBReaderHasError(reader))
137 if (aType == TYPE_END_GROUP) {
143 case 1 /* authenticationPassword */:
145 NSString *new_authenticationPassword = PBReaderReadString(reader);
146 self->_authenticationPassword = new_authenticationPassword;
149 case 2 /* authenticationDsid */:
151 NSString *new_authenticationDsid = PBReaderReadString(reader);
152 self->_authenticationDsid = new_authenticationDsid;
155 case 3 /* authenticationAppleid */:
157 NSString *new_authenticationAppleid = PBReaderReadString(reader);
158 self->_authenticationAppleid = new_authenticationAppleid;
161 case 4 /* fmipUuid */:
163 NSString *new_fmipUuid = PBReaderReadString(reader);
164 self->_fmipUuid = new_fmipUuid;
167 case 5 /* fmipRecovery */:
169 self->_has.fmipRecovery = YES;
170 self->_fmipRecovery = PBReaderReadBOOL(reader);
173 case 6 /* idmsRecovery */:
175 self->_has.idmsRecovery = YES;
176 self->_idmsRecovery = PBReaderReadBOOL(reader);
179 case 7 /* authenticationAuthToken */:
181 NSString *new_authenticationAuthToken = PBReaderReadString(reader);
182 self->_authenticationAuthToken = new_authenticationAuthToken;
185 case 8 /* authenticationEscrowproxyUrl */:
187 NSString *new_authenticationEscrowproxyUrl = PBReaderReadString(reader);
188 self->_authenticationEscrowproxyUrl = new_authenticationEscrowproxyUrl;
191 case 9 /* authenticationIcloudEnvironment */:
193 NSString *new_authenticationIcloudEnvironment = PBReaderReadString(reader);
194 self->_authenticationIcloudEnvironment = new_authenticationIcloudEnvironment;
198 if (!PBReaderSkipValueWithTag(reader, tag, aType))
203 return !PBReaderHasError(reader);
206 - (BOOL)readFrom:(PBDataReader *)reader
208 return OTEscrowAuthenticationInformationReadFrom(self, reader);
210 - (void)writeTo:(PBDataWriter *)writer
212 /* authenticationPassword */
214 if (self->_authenticationPassword)
216 PBDataWriterWriteStringField(writer, self->_authenticationPassword, 1);
219 /* authenticationDsid */
221 if (self->_authenticationDsid)
223 PBDataWriterWriteStringField(writer, self->_authenticationDsid, 2);
226 /* authenticationAppleid */
228 if (self->_authenticationAppleid)
230 PBDataWriterWriteStringField(writer, self->_authenticationAppleid, 3);
237 PBDataWriterWriteStringField(writer, self->_fmipUuid, 4);
242 if (self->_has.fmipRecovery)
244 PBDataWriterWriteBOOLField(writer, self->_fmipRecovery, 5);
249 if (self->_has.idmsRecovery)
251 PBDataWriterWriteBOOLField(writer, self->_idmsRecovery, 6);
254 /* authenticationAuthToken */
256 if (self->_authenticationAuthToken)
258 PBDataWriterWriteStringField(writer, self->_authenticationAuthToken, 7);
261 /* authenticationEscrowproxyUrl */
263 if (self->_authenticationEscrowproxyUrl)
265 PBDataWriterWriteStringField(writer, self->_authenticationEscrowproxyUrl, 8);
268 /* authenticationIcloudEnvironment */
270 if (self->_authenticationIcloudEnvironment)
272 PBDataWriterWriteStringField(writer, self->_authenticationIcloudEnvironment, 9);
277 - (void)copyTo:(OTEscrowAuthenticationInformation *)other
279 if (_authenticationPassword)
281 other.authenticationPassword = _authenticationPassword;
283 if (_authenticationDsid)
285 other.authenticationDsid = _authenticationDsid;
287 if (_authenticationAppleid)
289 other.authenticationAppleid = _authenticationAppleid;
293 other.fmipUuid = _fmipUuid;
295 if (self->_has.fmipRecovery)
297 other->_fmipRecovery = _fmipRecovery;
298 other->_has.fmipRecovery = YES;
300 if (self->_has.idmsRecovery)
302 other->_idmsRecovery = _idmsRecovery;
303 other->_has.idmsRecovery = YES;
305 if (_authenticationAuthToken)
307 other.authenticationAuthToken = _authenticationAuthToken;
309 if (_authenticationEscrowproxyUrl)
311 other.authenticationEscrowproxyUrl = _authenticationEscrowproxyUrl;
313 if (_authenticationIcloudEnvironment)
315 other.authenticationIcloudEnvironment = _authenticationIcloudEnvironment;
319 - (id)copyWithZone:(NSZone *)zone
321 OTEscrowAuthenticationInformation *copy = [[[self class] allocWithZone:zone] init];
322 copy->_authenticationPassword = [_authenticationPassword copyWithZone:zone];
323 copy->_authenticationDsid = [_authenticationDsid copyWithZone:zone];
324 copy->_authenticationAppleid = [_authenticationAppleid copyWithZone:zone];
325 copy->_fmipUuid = [_fmipUuid copyWithZone:zone];
326 if (self->_has.fmipRecovery)
328 copy->_fmipRecovery = _fmipRecovery;
329 copy->_has.fmipRecovery = YES;
331 if (self->_has.idmsRecovery)
333 copy->_idmsRecovery = _idmsRecovery;
334 copy->_has.idmsRecovery = YES;
336 copy->_authenticationAuthToken = [_authenticationAuthToken copyWithZone:zone];
337 copy->_authenticationEscrowproxyUrl = [_authenticationEscrowproxyUrl copyWithZone:zone];
338 copy->_authenticationIcloudEnvironment = [_authenticationIcloudEnvironment copyWithZone:zone];
342 - (BOOL)isEqual:(id)object
344 OTEscrowAuthenticationInformation *other = (OTEscrowAuthenticationInformation *)object;
345 return [other isMemberOfClass:[self class]]
347 ((!self->_authenticationPassword && !other->_authenticationPassword) || [self->_authenticationPassword isEqual:other->_authenticationPassword])
349 ((!self->_authenticationDsid && !other->_authenticationDsid) || [self->_authenticationDsid isEqual:other->_authenticationDsid])
351 ((!self->_authenticationAppleid && !other->_authenticationAppleid) || [self->_authenticationAppleid isEqual:other->_authenticationAppleid])
353 ((!self->_fmipUuid && !other->_fmipUuid) || [self->_fmipUuid isEqual:other->_fmipUuid])
355 ((self->_has.fmipRecovery && other->_has.fmipRecovery && ((self->_fmipRecovery && other->_fmipRecovery) || (!self->_fmipRecovery && !other->_fmipRecovery))) || (!self->_has.fmipRecovery && !other->_has.fmipRecovery))
357 ((self->_has.idmsRecovery && other->_has.idmsRecovery && ((self->_idmsRecovery && other->_idmsRecovery) || (!self->_idmsRecovery && !other->_idmsRecovery))) || (!self->_has.idmsRecovery && !other->_has.idmsRecovery))
359 ((!self->_authenticationAuthToken && !other->_authenticationAuthToken) || [self->_authenticationAuthToken isEqual:other->_authenticationAuthToken])
361 ((!self->_authenticationEscrowproxyUrl && !other->_authenticationEscrowproxyUrl) || [self->_authenticationEscrowproxyUrl isEqual:other->_authenticationEscrowproxyUrl])
363 ((!self->_authenticationIcloudEnvironment && !other->_authenticationIcloudEnvironment) || [self->_authenticationIcloudEnvironment isEqual:other->_authenticationIcloudEnvironment])
371 [self->_authenticationPassword hash]
373 [self->_authenticationDsid hash]
375 [self->_authenticationAppleid hash]
377 [self->_fmipUuid hash]
379 (self->_has.fmipRecovery ? PBHashInt((NSUInteger)self->_fmipRecovery) : 0)
381 (self->_has.idmsRecovery ? PBHashInt((NSUInteger)self->_idmsRecovery) : 0)
383 [self->_authenticationAuthToken hash]
385 [self->_authenticationEscrowproxyUrl hash]
387 [self->_authenticationIcloudEnvironment hash]
391 - (void)mergeFrom:(OTEscrowAuthenticationInformation *)other
393 if (other->_authenticationPassword)
395 [self setAuthenticationPassword:other->_authenticationPassword];
397 if (other->_authenticationDsid)
399 [self setAuthenticationDsid:other->_authenticationDsid];
401 if (other->_authenticationAppleid)
403 [self setAuthenticationAppleid:other->_authenticationAppleid];
405 if (other->_fmipUuid)
407 [self setFmipUuid:other->_fmipUuid];
409 if (other->_has.fmipRecovery)
411 self->_fmipRecovery = other->_fmipRecovery;
412 self->_has.fmipRecovery = YES;
414 if (other->_has.idmsRecovery)
416 self->_idmsRecovery = other->_idmsRecovery;
417 self->_has.idmsRecovery = YES;
419 if (other->_authenticationAuthToken)
421 [self setAuthenticationAuthToken:other->_authenticationAuthToken];
423 if (other->_authenticationEscrowproxyUrl)
425 [self setAuthenticationEscrowproxyUrl:other->_authenticationEscrowproxyUrl];
427 if (other->_authenticationIcloudEnvironment)
429 [self setAuthenticationIcloudEnvironment:other->_authenticationIcloudEnvironment];