]> git.saurik.com Git - apple/security.git/blob - keychain/analytics/C2Metric/SECC2MPCloudKitOperationGroupInfo.m
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / analytics / C2Metric / SECC2MPCloudKitOperationGroupInfo.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from C2Metric.proto
4
5 #import "SECC2MPCloudKitOperationGroupInfo.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 SECC2MPCloudKitOperationGroupInfo
15
16 - (BOOL)hasOperationGroupId
17 {
18 return _operationGroupId != nil;
19 }
20 @synthesize operationGroupId = _operationGroupId;
21 - (BOOL)hasOperationGroupName
22 {
23 return _operationGroupName != nil;
24 }
25 @synthesize operationGroupName = _operationGroupName;
26 @synthesize operationGroupTriggered = _operationGroupTriggered;
27 - (void)setOperationGroupTriggered:(BOOL)v
28 {
29 _has.operationGroupTriggered = YES;
30 _operationGroupTriggered = v;
31 }
32 - (void)setHasOperationGroupTriggered:(BOOL)f
33 {
34 _has.operationGroupTriggered = f;
35 }
36 - (BOOL)hasOperationGroupTriggered
37 {
38 return _has.operationGroupTriggered;
39 }
40
41 - (NSString *)description
42 {
43 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
44 }
45
46 - (NSDictionary *)dictionaryRepresentation
47 {
48 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
49 if (self->_operationGroupId)
50 {
51 [dict setObject:self->_operationGroupId forKey:@"operation_group_id"];
52 }
53 if (self->_operationGroupName)
54 {
55 [dict setObject:self->_operationGroupName forKey:@"operation_group_name"];
56 }
57 if (self->_has.operationGroupTriggered)
58 {
59 [dict setObject:[NSNumber numberWithBool:self->_operationGroupTriggered] forKey:@"operation_group_triggered"];
60 }
61 return dict;
62 }
63
64 BOOL SECC2MPCloudKitOperationGroupInfoReadFrom(__unsafe_unretained SECC2MPCloudKitOperationGroupInfo *self, __unsafe_unretained PBDataReader *reader) {
65 while (PBReaderHasMoreData(reader)) {
66 uint32_t tag = 0;
67 uint8_t aType = 0;
68
69 PBReaderReadTag32AndType(reader, &tag, &aType);
70
71 if (PBReaderHasError(reader))
72 break;
73
74 if (aType == TYPE_END_GROUP) {
75 break;
76 }
77
78 switch (tag) {
79
80 case 1 /* operationGroupId */:
81 {
82 NSString *new_operationGroupId = PBReaderReadString(reader);
83 self->_operationGroupId = new_operationGroupId;
84 }
85 break;
86 case 2 /* operationGroupName */:
87 {
88 NSString *new_operationGroupName = PBReaderReadString(reader);
89 self->_operationGroupName = new_operationGroupName;
90 }
91 break;
92 case 101 /* operationGroupTriggered */:
93 {
94 self->_has.operationGroupTriggered = YES;
95 self->_operationGroupTriggered = PBReaderReadBOOL(reader);
96 }
97 break;
98 default:
99 if (!PBReaderSkipValueWithTag(reader, tag, aType))
100 return NO;
101 break;
102 }
103 }
104 return !PBReaderHasError(reader);
105 }
106
107 - (BOOL)readFrom:(PBDataReader *)reader
108 {
109 return SECC2MPCloudKitOperationGroupInfoReadFrom(self, reader);
110 }
111 - (void)writeTo:(PBDataWriter *)writer
112 {
113 /* operationGroupId */
114 {
115 if (self->_operationGroupId)
116 {
117 PBDataWriterWriteStringField(writer, self->_operationGroupId, 1);
118 }
119 }
120 /* operationGroupName */
121 {
122 if (self->_operationGroupName)
123 {
124 PBDataWriterWriteStringField(writer, self->_operationGroupName, 2);
125 }
126 }
127 /* operationGroupTriggered */
128 {
129 if (self->_has.operationGroupTriggered)
130 {
131 PBDataWriterWriteBOOLField(writer, self->_operationGroupTriggered, 101);
132 }
133 }
134 }
135
136 - (void)copyTo:(SECC2MPCloudKitOperationGroupInfo *)other
137 {
138 if (_operationGroupId)
139 {
140 other.operationGroupId = _operationGroupId;
141 }
142 if (_operationGroupName)
143 {
144 other.operationGroupName = _operationGroupName;
145 }
146 if (self->_has.operationGroupTriggered)
147 {
148 other->_operationGroupTriggered = _operationGroupTriggered;
149 other->_has.operationGroupTriggered = YES;
150 }
151 }
152
153 - (id)copyWithZone:(NSZone *)zone
154 {
155 SECC2MPCloudKitOperationGroupInfo *copy = [[[self class] allocWithZone:zone] init];
156 copy->_operationGroupId = [_operationGroupId copyWithZone:zone];
157 copy->_operationGroupName = [_operationGroupName copyWithZone:zone];
158 if (self->_has.operationGroupTriggered)
159 {
160 copy->_operationGroupTriggered = _operationGroupTriggered;
161 copy->_has.operationGroupTriggered = YES;
162 }
163 return copy;
164 }
165
166 - (BOOL)isEqual:(id)object
167 {
168 SECC2MPCloudKitOperationGroupInfo *other = (SECC2MPCloudKitOperationGroupInfo *)object;
169 return [other isMemberOfClass:[self class]]
170 &&
171 ((!self->_operationGroupId && !other->_operationGroupId) || [self->_operationGroupId isEqual:other->_operationGroupId])
172 &&
173 ((!self->_operationGroupName && !other->_operationGroupName) || [self->_operationGroupName isEqual:other->_operationGroupName])
174 &&
175 ((self->_has.operationGroupTriggered && other->_has.operationGroupTriggered && ((self->_operationGroupTriggered && other->_operationGroupTriggered) || (!self->_operationGroupTriggered && !other->_operationGroupTriggered))) || (!self->_has.operationGroupTriggered && !other->_has.operationGroupTriggered))
176 ;
177 }
178
179 - (NSUInteger)hash
180 {
181 return 0
182 ^
183 [self->_operationGroupId hash]
184 ^
185 [self->_operationGroupName hash]
186 ^
187 (self->_has.operationGroupTriggered ? PBHashInt((NSUInteger)self->_operationGroupTriggered) : 0)
188 ;
189 }
190
191 - (void)mergeFrom:(SECC2MPCloudKitOperationGroupInfo *)other
192 {
193 if (other->_operationGroupId)
194 {
195 [self setOperationGroupId:other->_operationGroupId];
196 }
197 if (other->_operationGroupName)
198 {
199 [self setOperationGroupName:other->_operationGroupName];
200 }
201 if (other->_has.operationGroupTriggered)
202 {
203 self->_operationGroupTriggered = other->_operationGroupTriggered;
204 self->_has.operationGroupTriggered = YES;
205 }
206 }
207
208 @end
209