]> git.saurik.com Git - apple/security.git/blob - keychain/analytics/awd/AWDKeychainCKKSRateLimiterOverload.m
Security-58286.20.16.tar.gz
[apple/security.git] / keychain / analytics / awd / AWDKeychainCKKSRateLimiterOverload.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from stdin
4
5 #import <TargetConditionals.h>
6 #if !TARGET_OS_BRIDGE
7
8 #import "AWDKeychainCKKSRateLimiterOverload.h"
9 #import <ProtocolBuffer/PBConstants.h>
10 #import <ProtocolBuffer/PBHashUtil.h>
11 #import <ProtocolBuffer/PBDataReader.h>
12
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.
15 #endif
16
17 @implementation AWDKeychainCKKSRateLimiterOverload
18
19 @synthesize timestamp = _timestamp;
20 - (void)setTimestamp:(uint64_t)v
21 {
22 _has.timestamp = YES;
23 _timestamp = v;
24 }
25 - (void)setHasTimestamp:(BOOL)f
26 {
27 _has.timestamp = f;
28 }
29 - (BOOL)hasTimestamp
30 {
31 return _has.timestamp;
32 }
33 @synthesize durationMsec = _durationMsec;
34 - (void)setDurationMsec:(int64_t)v
35 {
36 _has.durationMsec = YES;
37 _durationMsec = v;
38 }
39 - (void)setHasDurationMsec:(BOOL)f
40 {
41 _has.durationMsec = f;
42 }
43 - (BOOL)hasDurationMsec
44 {
45 return _has.durationMsec;
46 }
47 - (BOOL)hasRatelimitertype
48 {
49 return _ratelimitertype != nil;
50 }
51 @synthesize ratelimitertype = _ratelimitertype;
52
53 - (NSString *)description
54 {
55 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
56 }
57
58 - (NSDictionary *)dictionaryRepresentation
59 {
60 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
61 if (self->_has.timestamp)
62 {
63 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_timestamp] forKey:@"timestamp"];
64 }
65 if (self->_has.durationMsec)
66 {
67 [dict setObject:[NSNumber numberWithLongLong:self->_durationMsec] forKey:@"durationMsec"];
68 }
69 if (self->_ratelimitertype)
70 {
71 [dict setObject:self->_ratelimitertype forKey:@"ratelimitertype"];
72 }
73 return dict;
74 }
75
76 BOOL AWDKeychainCKKSRateLimiterOverloadReadFrom(__unsafe_unretained AWDKeychainCKKSRateLimiterOverload *self, __unsafe_unretained PBDataReader *reader) {
77 while (PBReaderHasMoreData(reader)) {
78 uint32_t tag = 0;
79 uint8_t aType = 0;
80
81 PBReaderReadTag32AndType(reader, &tag, &aType);
82
83 if (PBReaderHasError(reader))
84 break;
85
86 if (aType == TYPE_END_GROUP) {
87 break;
88 }
89
90 switch (tag) {
91
92 case 1 /* timestamp */:
93 {
94 self->_has.timestamp = YES;
95 self->_timestamp = PBReaderReadUint64(reader);
96 }
97 break;
98 case 2 /* durationMsec */:
99 {
100 self->_has.durationMsec = YES;
101 self->_durationMsec = PBReaderReadInt64(reader);
102 }
103 break;
104 case 3 /* ratelimitertype */:
105 {
106 NSString *new_ratelimitertype = PBReaderReadString(reader);
107 self->_ratelimitertype = new_ratelimitertype;
108 }
109 break;
110 default:
111 if (!PBReaderSkipValueWithTag(reader, tag, aType))
112 return NO;
113 break;
114 }
115 }
116 return !PBReaderHasError(reader);
117 }
118
119 - (BOOL)readFrom:(PBDataReader *)reader
120 {
121 return AWDKeychainCKKSRateLimiterOverloadReadFrom(self, reader);
122 }
123 - (void)writeTo:(PBDataWriter *)writer
124 {
125 /* timestamp */
126 {
127 if (self->_has.timestamp)
128 {
129 PBDataWriterWriteUint64Field(writer, self->_timestamp, 1);
130 }
131 }
132 /* durationMsec */
133 {
134 if (self->_has.durationMsec)
135 {
136 PBDataWriterWriteInt64Field(writer, self->_durationMsec, 2);
137 }
138 }
139 /* ratelimitertype */
140 {
141 if (self->_ratelimitertype)
142 {
143 PBDataWriterWriteStringField(writer, self->_ratelimitertype, 3);
144 }
145 }
146 }
147
148 - (void)copyTo:(AWDKeychainCKKSRateLimiterOverload *)other
149 {
150 if (self->_has.timestamp)
151 {
152 other->_timestamp = _timestamp;
153 other->_has.timestamp = YES;
154 }
155 if (self->_has.durationMsec)
156 {
157 other->_durationMsec = _durationMsec;
158 other->_has.durationMsec = YES;
159 }
160 if (_ratelimitertype)
161 {
162 other.ratelimitertype = _ratelimitertype;
163 }
164 }
165
166 - (id)copyWithZone:(NSZone *)zone
167 {
168 AWDKeychainCKKSRateLimiterOverload *copy = [[[self class] allocWithZone:zone] init];
169 if (self->_has.timestamp)
170 {
171 copy->_timestamp = _timestamp;
172 copy->_has.timestamp = YES;
173 }
174 if (self->_has.durationMsec)
175 {
176 copy->_durationMsec = _durationMsec;
177 copy->_has.durationMsec = YES;
178 }
179 copy->_ratelimitertype = [_ratelimitertype copyWithZone:zone];
180 return copy;
181 }
182
183 - (BOOL)isEqual:(id)object
184 {
185 AWDKeychainCKKSRateLimiterOverload *other = (AWDKeychainCKKSRateLimiterOverload *)object;
186 return [other isMemberOfClass:[self class]]
187 &&
188 ((self->_has.timestamp && other->_has.timestamp && self->_timestamp == other->_timestamp) || (!self->_has.timestamp && !other->_has.timestamp))
189 &&
190 ((self->_has.durationMsec && other->_has.durationMsec && self->_durationMsec == other->_durationMsec) || (!self->_has.durationMsec && !other->_has.durationMsec))
191 &&
192 ((!self->_ratelimitertype && !other->_ratelimitertype) || [self->_ratelimitertype isEqual:other->_ratelimitertype])
193 ;
194 }
195
196 - (NSUInteger)hash
197 {
198 return 0
199 ^
200 (self->_has.timestamp ? PBHashInt((NSUInteger)self->_timestamp) : 0)
201 ^
202 (self->_has.durationMsec ? PBHashInt((NSUInteger)self->_durationMsec) : 0)
203 ^
204 [self->_ratelimitertype hash]
205 ;
206 }
207
208 - (void)mergeFrom:(AWDKeychainCKKSRateLimiterOverload *)other
209 {
210 if (other->_has.timestamp)
211 {
212 self->_timestamp = other->_timestamp;
213 self->_has.timestamp = YES;
214 }
215 if (other->_has.durationMsec)
216 {
217 self->_durationMsec = other->_durationMsec;
218 self->_has.durationMsec = YES;
219 }
220 if (other->_ratelimitertype)
221 {
222 [self setRatelimitertype:other->_ratelimitertype];
223 }
224 }
225
226 @end
227 #endif