]> git.saurik.com Git - apple/security.git/blob - keychain/analytics/C2Metric/SECC2MPCloudKitOperationInfo.m
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / analytics / C2Metric / SECC2MPCloudKitOperationInfo.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from C2Metric.proto
4
5 #import "SECC2MPCloudKitOperationInfo.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 SECC2MPCloudKitOperationInfo
15
16 - (BOOL)hasOperationId
17 {
18 return _operationId != nil;
19 }
20 @synthesize operationId = _operationId;
21 - (BOOL)hasOperationType
22 {
23 return _operationType != nil;
24 }
25 @synthesize operationType = _operationType;
26 @synthesize operationTriggered = _operationTriggered;
27 - (void)setOperationTriggered:(BOOL)v
28 {
29 _has.operationTriggered = YES;
30 _operationTriggered = v;
31 }
32 - (void)setHasOperationTriggered:(BOOL)f
33 {
34 _has.operationTriggered = f;
35 }
36 - (BOOL)hasOperationTriggered
37 {
38 return _has.operationTriggered;
39 }
40 @synthesize operationGroupIndex = _operationGroupIndex;
41 - (void)setOperationGroupIndex:(uint32_t)v
42 {
43 _has.operationGroupIndex = YES;
44 _operationGroupIndex = v;
45 }
46 - (void)setHasOperationGroupIndex:(BOOL)f
47 {
48 _has.operationGroupIndex = f;
49 }
50 - (BOOL)hasOperationGroupIndex
51 {
52 return _has.operationGroupIndex;
53 }
54
55 - (NSString *)description
56 {
57 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
58 }
59
60 - (NSDictionary *)dictionaryRepresentation
61 {
62 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
63 if (self->_operationId)
64 {
65 [dict setObject:self->_operationId forKey:@"operation_id"];
66 }
67 if (self->_operationType)
68 {
69 [dict setObject:self->_operationType forKey:@"operation_type"];
70 }
71 if (self->_has.operationTriggered)
72 {
73 [dict setObject:[NSNumber numberWithBool:self->_operationTriggered] forKey:@"operation_triggered"];
74 }
75 if (self->_has.operationGroupIndex)
76 {
77 [dict setObject:[NSNumber numberWithUnsignedInt:self->_operationGroupIndex] forKey:@"operation_group_index"];
78 }
79 return dict;
80 }
81
82 BOOL SECC2MPCloudKitOperationInfoReadFrom(__unsafe_unretained SECC2MPCloudKitOperationInfo *self, __unsafe_unretained PBDataReader *reader) {
83 while (PBReaderHasMoreData(reader)) {
84 uint32_t tag = 0;
85 uint8_t aType = 0;
86
87 PBReaderReadTag32AndType(reader, &tag, &aType);
88
89 if (PBReaderHasError(reader))
90 break;
91
92 if (aType == TYPE_END_GROUP) {
93 break;
94 }
95
96 switch (tag) {
97
98 case 1 /* operationId */:
99 {
100 NSString *new_operationId = PBReaderReadString(reader);
101 self->_operationId = new_operationId;
102 }
103 break;
104 case 2 /* operationType */:
105 {
106 NSString *new_operationType = PBReaderReadString(reader);
107 self->_operationType = new_operationType;
108 }
109 break;
110 case 101 /* operationTriggered */:
111 {
112 self->_has.operationTriggered = YES;
113 self->_operationTriggered = PBReaderReadBOOL(reader);
114 }
115 break;
116 case 201 /* operationGroupIndex */:
117 {
118 self->_has.operationGroupIndex = YES;
119 self->_operationGroupIndex = PBReaderReadUint32(reader);
120 }
121 break;
122 default:
123 if (!PBReaderSkipValueWithTag(reader, tag, aType))
124 return NO;
125 break;
126 }
127 }
128 return !PBReaderHasError(reader);
129 }
130
131 - (BOOL)readFrom:(PBDataReader *)reader
132 {
133 return SECC2MPCloudKitOperationInfoReadFrom(self, reader);
134 }
135 - (void)writeTo:(PBDataWriter *)writer
136 {
137 /* operationId */
138 {
139 if (self->_operationId)
140 {
141 PBDataWriterWriteStringField(writer, self->_operationId, 1);
142 }
143 }
144 /* operationType */
145 {
146 if (self->_operationType)
147 {
148 PBDataWriterWriteStringField(writer, self->_operationType, 2);
149 }
150 }
151 /* operationTriggered */
152 {
153 if (self->_has.operationTriggered)
154 {
155 PBDataWriterWriteBOOLField(writer, self->_operationTriggered, 101);
156 }
157 }
158 /* operationGroupIndex */
159 {
160 if (self->_has.operationGroupIndex)
161 {
162 PBDataWriterWriteUint32Field(writer, self->_operationGroupIndex, 201);
163 }
164 }
165 }
166
167 - (void)copyTo:(SECC2MPCloudKitOperationInfo *)other
168 {
169 if (_operationId)
170 {
171 other.operationId = _operationId;
172 }
173 if (_operationType)
174 {
175 other.operationType = _operationType;
176 }
177 if (self->_has.operationTriggered)
178 {
179 other->_operationTriggered = _operationTriggered;
180 other->_has.operationTriggered = YES;
181 }
182 if (self->_has.operationGroupIndex)
183 {
184 other->_operationGroupIndex = _operationGroupIndex;
185 other->_has.operationGroupIndex = YES;
186 }
187 }
188
189 - (id)copyWithZone:(NSZone *)zone
190 {
191 SECC2MPCloudKitOperationInfo *copy = [[[self class] allocWithZone:zone] init];
192 copy->_operationId = [_operationId copyWithZone:zone];
193 copy->_operationType = [_operationType copyWithZone:zone];
194 if (self->_has.operationTriggered)
195 {
196 copy->_operationTriggered = _operationTriggered;
197 copy->_has.operationTriggered = YES;
198 }
199 if (self->_has.operationGroupIndex)
200 {
201 copy->_operationGroupIndex = _operationGroupIndex;
202 copy->_has.operationGroupIndex = YES;
203 }
204 return copy;
205 }
206
207 - (BOOL)isEqual:(id)object
208 {
209 SECC2MPCloudKitOperationInfo *other = (SECC2MPCloudKitOperationInfo *)object;
210 return [other isMemberOfClass:[self class]]
211 &&
212 ((!self->_operationId && !other->_operationId) || [self->_operationId isEqual:other->_operationId])
213 &&
214 ((!self->_operationType && !other->_operationType) || [self->_operationType isEqual:other->_operationType])
215 &&
216 ((self->_has.operationTriggered && other->_has.operationTriggered && ((self->_operationTriggered && other->_operationTriggered) || (!self->_operationTriggered && !other->_operationTriggered))) || (!self->_has.operationTriggered && !other->_has.operationTriggered))
217 &&
218 ((self->_has.operationGroupIndex && other->_has.operationGroupIndex && self->_operationGroupIndex == other->_operationGroupIndex) || (!self->_has.operationGroupIndex && !other->_has.operationGroupIndex))
219 ;
220 }
221
222 - (NSUInteger)hash
223 {
224 return 0
225 ^
226 [self->_operationId hash]
227 ^
228 [self->_operationType hash]
229 ^
230 (self->_has.operationTriggered ? PBHashInt((NSUInteger)self->_operationTriggered) : 0)
231 ^
232 (self->_has.operationGroupIndex ? PBHashInt((NSUInteger)self->_operationGroupIndex) : 0)
233 ;
234 }
235
236 - (void)mergeFrom:(SECC2MPCloudKitOperationInfo *)other
237 {
238 if (other->_operationId)
239 {
240 [self setOperationId:other->_operationId];
241 }
242 if (other->_operationType)
243 {
244 [self setOperationType:other->_operationType];
245 }
246 if (other->_has.operationTriggered)
247 {
248 self->_operationTriggered = other->_operationTriggered;
249 self->_has.operationTriggered = YES;
250 }
251 if (other->_has.operationGroupIndex)
252 {
253 self->_operationGroupIndex = other->_operationGroupIndex;
254 self->_has.operationGroupIndex = YES;
255 }
256 }
257
258 @end
259