1 // This file was automatically generated by protocompiler
5 #import <TargetConditionals.h>
8 #import "AWDKeychainCKKSRateLimiterOverload.h"
9 #import <ProtocolBuffer/PBConstants.h>
10 #import <ProtocolBuffer/PBHashUtil.h>
11 #import <ProtocolBuffer/PBDataReader.h>
13 #if !__has_feature(objc_arc)
14 # 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.
17 @implementation AWDKeychainCKKSRateLimiterOverload
19 @synthesize timestamp = _timestamp;
20 - (void)setTimestamp:(uint64_t)v
25 - (void)setHasTimestamp:(BOOL)f
31 return _has.timestamp;
33 @synthesize durationMsec = _durationMsec;
34 - (void)setDurationMsec:(int64_t)v
36 _has.durationMsec = YES;
39 - (void)setHasDurationMsec:(BOOL)f
41 _has.durationMsec = f;
43 - (BOOL)hasDurationMsec
45 return _has.durationMsec;
47 - (BOOL)hasRatelimitertype
49 return _ratelimitertype != nil;
51 @synthesize ratelimitertype = _ratelimitertype;
53 - (NSString *)description
55 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
58 - (NSDictionary *)dictionaryRepresentation
60 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
61 if (self->_has.timestamp)
63 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_timestamp] forKey:@"timestamp"];
65 if (self->_has.durationMsec)
67 [dict setObject:[NSNumber numberWithLongLong:self->_durationMsec] forKey:@"durationMsec"];
69 if (self->_ratelimitertype)
71 [dict setObject:self->_ratelimitertype forKey:@"ratelimitertype"];
76 BOOL AWDKeychainCKKSRateLimiterOverloadReadFrom(__unsafe_unretained AWDKeychainCKKSRateLimiterOverload *self, __unsafe_unretained PBDataReader *reader) {
77 while (PBReaderHasMoreData(reader)) {
81 PBReaderReadTag32AndType(reader, &tag, &aType);
83 if (PBReaderHasError(reader))
86 if (aType == TYPE_END_GROUP) {
92 case 1 /* timestamp */:
94 self->_has.timestamp = YES;
95 self->_timestamp = PBReaderReadUint64(reader);
98 case 2 /* durationMsec */:
100 self->_has.durationMsec = YES;
101 self->_durationMsec = PBReaderReadInt64(reader);
104 case 3 /* ratelimitertype */:
106 NSString *new_ratelimitertype = PBReaderReadString(reader);
107 self->_ratelimitertype = new_ratelimitertype;
111 if (!PBReaderSkipValueWithTag(reader, tag, aType))
116 return !PBReaderHasError(reader);
119 - (BOOL)readFrom:(PBDataReader *)reader
121 return AWDKeychainCKKSRateLimiterOverloadReadFrom(self, reader);
123 - (void)writeTo:(PBDataWriter *)writer
127 if (self->_has.timestamp)
129 PBDataWriterWriteUint64Field(writer, self->_timestamp, 1);
134 if (self->_has.durationMsec)
136 PBDataWriterWriteInt64Field(writer, self->_durationMsec, 2);
139 /* ratelimitertype */
141 if (self->_ratelimitertype)
143 PBDataWriterWriteStringField(writer, self->_ratelimitertype, 3);
148 - (void)copyTo:(AWDKeychainCKKSRateLimiterOverload *)other
150 if (self->_has.timestamp)
152 other->_timestamp = _timestamp;
153 other->_has.timestamp = YES;
155 if (self->_has.durationMsec)
157 other->_durationMsec = _durationMsec;
158 other->_has.durationMsec = YES;
160 if (_ratelimitertype)
162 other.ratelimitertype = _ratelimitertype;
166 - (id)copyWithZone:(NSZone *)zone
168 AWDKeychainCKKSRateLimiterOverload *copy = [[[self class] allocWithZone:zone] init];
169 if (self->_has.timestamp)
171 copy->_timestamp = _timestamp;
172 copy->_has.timestamp = YES;
174 if (self->_has.durationMsec)
176 copy->_durationMsec = _durationMsec;
177 copy->_has.durationMsec = YES;
179 copy->_ratelimitertype = [_ratelimitertype copyWithZone:zone];
183 - (BOOL)isEqual:(id)object
185 AWDKeychainCKKSRateLimiterOverload *other = (AWDKeychainCKKSRateLimiterOverload *)object;
186 return [other isMemberOfClass:[self class]]
188 ((self->_has.timestamp && other->_has.timestamp && self->_timestamp == other->_timestamp) || (!self->_has.timestamp && !other->_has.timestamp))
190 ((self->_has.durationMsec && other->_has.durationMsec && self->_durationMsec == other->_durationMsec) || (!self->_has.durationMsec && !other->_has.durationMsec))
192 ((!self->_ratelimitertype && !other->_ratelimitertype) || [self->_ratelimitertype isEqual:other->_ratelimitertype])
200 (self->_has.timestamp ? PBHashInt((NSUInteger)self->_timestamp) : 0)
202 (self->_has.durationMsec ? PBHashInt((NSUInteger)self->_durationMsec) : 0)
204 [self->_ratelimitertype hash]
208 - (void)mergeFrom:(AWDKeychainCKKSRateLimiterOverload *)other
210 if (other->_has.timestamp)
212 self->_timestamp = other->_timestamp;
213 self->_has.timestamp = YES;
215 if (other->_has.durationMsec)
217 self->_durationMsec = other->_durationMsec;
218 self->_has.durationMsec = YES;
220 if (other->_ratelimitertype)
222 [self setRatelimitertype:other->_ratelimitertype];