]> git.saurik.com Git - apple/security.git/blob - keychain/ot/proto/generated_source/OTAccountMetadataClassC.h
Security-59754.41.1.tar.gz
[apple/security.git] / keychain / ot / proto / generated_source / OTAccountMetadataClassC.h
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from OTAccountMetadataClassC.proto
4
5 #import <Foundation/Foundation.h>
6 #import <ProtocolBuffer/PBCodable.h>
7
8 /**
9 * The state of accounts on the system is complicated. Here's how we handle them:
10 * If there is no account, we will be in NO_ACCOUNT and have no altDSID
11 * If there is an SA account, we will bt in NO_ACCOUNT and have an altDSID
12 * If there is an HSA2 account, we will be in ACCOUNT_AVAILABLE and have an altDSID
13 * Once you're in an HSA2 account, CDP might be enabled or disabled. If it's not enabled,
14 * then Octagon shouldn't be active.
15 */
16 typedef NS_ENUM(int32_t, OTAccountMetadataClassC_AccountState) {
17 OTAccountMetadataClassC_AccountState_UNKNOWN = 0,
18 OTAccountMetadataClassC_AccountState_NO_ACCOUNT = 1,
19 OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE = 2,
20 OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE_UNUSED = 3,
21 };
22 #ifdef __OBJC__
23 NS_INLINE NSString *OTAccountMetadataClassC_AccountStateAsString(OTAccountMetadataClassC_AccountState value)
24 {
25 switch (value)
26 {
27 case OTAccountMetadataClassC_AccountState_UNKNOWN: return @"UNKNOWN";
28 case OTAccountMetadataClassC_AccountState_NO_ACCOUNT: return @"NO_ACCOUNT";
29 case OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE: return @"ACCOUNT_AVAILABLE";
30 case OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE_UNUSED: return @"ACCOUNT_AVAILABLE_UNUSED";
31 default: return [NSString stringWithFormat:@"(unknown: %i)", value];
32 }
33 }
34 #endif /* __OBJC__ */
35 #ifdef __OBJC__
36 NS_INLINE OTAccountMetadataClassC_AccountState StringAsOTAccountMetadataClassC_AccountState(NSString *value)
37 {
38 if ([value isEqualToString:@"UNKNOWN"]) return OTAccountMetadataClassC_AccountState_UNKNOWN;
39 if ([value isEqualToString:@"NO_ACCOUNT"]) return OTAccountMetadataClassC_AccountState_NO_ACCOUNT;
40 if ([value isEqualToString:@"ACCOUNT_AVAILABLE"]) return OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE;
41 if ([value isEqualToString:@"ACCOUNT_AVAILABLE_UNUSED"]) return OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE_UNUSED;
42 return OTAccountMetadataClassC_AccountState_UNKNOWN;
43 }
44 #endif /* __OBJC__ */
45 typedef NS_ENUM(int32_t, OTAccountMetadataClassC_TrustState) {
46 OTAccountMetadataClassC_TrustState_UNKNOWN = 0,
47 OTAccountMetadataClassC_TrustState_UNTRUSTED = 1,
48 OTAccountMetadataClassC_TrustState_TRUSTED = 2,
49 };
50 #ifdef __OBJC__
51 NS_INLINE NSString *OTAccountMetadataClassC_TrustStateAsString(OTAccountMetadataClassC_TrustState value)
52 {
53 switch (value)
54 {
55 case OTAccountMetadataClassC_TrustState_UNKNOWN: return @"UNKNOWN";
56 case OTAccountMetadataClassC_TrustState_UNTRUSTED: return @"UNTRUSTED";
57 case OTAccountMetadataClassC_TrustState_TRUSTED: return @"TRUSTED";
58 default: return [NSString stringWithFormat:@"(unknown: %i)", value];
59 }
60 }
61 #endif /* __OBJC__ */
62 #ifdef __OBJC__
63 NS_INLINE OTAccountMetadataClassC_TrustState StringAsOTAccountMetadataClassC_TrustState(NSString *value)
64 {
65 if ([value isEqualToString:@"UNKNOWN"]) return OTAccountMetadataClassC_TrustState_UNKNOWN;
66 if ([value isEqualToString:@"UNTRUSTED"]) return OTAccountMetadataClassC_TrustState_UNTRUSTED;
67 if ([value isEqualToString:@"TRUSTED"]) return OTAccountMetadataClassC_TrustState_TRUSTED;
68 return OTAccountMetadataClassC_TrustState_UNKNOWN;
69 }
70 #endif /* __OBJC__ */
71 typedef NS_ENUM(int32_t, OTAccountMetadataClassC_AttemptedAJoinState) {
72 OTAccountMetadataClassC_AttemptedAJoinState_UNKNOWN = 0,
73 OTAccountMetadataClassC_AttemptedAJoinState_NOTATTEMPTED = 1,
74 OTAccountMetadataClassC_AttemptedAJoinState_ATTEMPTED = 2,
75 };
76 #ifdef __OBJC__
77 NS_INLINE NSString *OTAccountMetadataClassC_AttemptedAJoinStateAsString(OTAccountMetadataClassC_AttemptedAJoinState value)
78 {
79 switch (value)
80 {
81 case OTAccountMetadataClassC_AttemptedAJoinState_UNKNOWN: return @"UNKNOWN";
82 case OTAccountMetadataClassC_AttemptedAJoinState_NOTATTEMPTED: return @"NOTATTEMPTED";
83 case OTAccountMetadataClassC_AttemptedAJoinState_ATTEMPTED: return @"ATTEMPTED";
84 default: return [NSString stringWithFormat:@"(unknown: %i)", value];
85 }
86 }
87 #endif /* __OBJC__ */
88 #ifdef __OBJC__
89 NS_INLINE OTAccountMetadataClassC_AttemptedAJoinState StringAsOTAccountMetadataClassC_AttemptedAJoinState(NSString *value)
90 {
91 if ([value isEqualToString:@"UNKNOWN"]) return OTAccountMetadataClassC_AttemptedAJoinState_UNKNOWN;
92 if ([value isEqualToString:@"NOTATTEMPTED"]) return OTAccountMetadataClassC_AttemptedAJoinState_NOTATTEMPTED;
93 if ([value isEqualToString:@"ATTEMPTED"]) return OTAccountMetadataClassC_AttemptedAJoinState_ATTEMPTED;
94 return OTAccountMetadataClassC_AttemptedAJoinState_UNKNOWN;
95 }
96 #endif /* __OBJC__ */
97 typedef NS_ENUM(int32_t, OTAccountMetadataClassC_CDPState) {
98 OTAccountMetadataClassC_CDPState_UNKNOWN = 0,
99 OTAccountMetadataClassC_CDPState_DISABLED = 1,
100 OTAccountMetadataClassC_CDPState_ENABLED = 2,
101 };
102 #ifdef __OBJC__
103 NS_INLINE NSString *OTAccountMetadataClassC_CDPStateAsString(OTAccountMetadataClassC_CDPState value)
104 {
105 switch (value)
106 {
107 case OTAccountMetadataClassC_CDPState_UNKNOWN: return @"UNKNOWN";
108 case OTAccountMetadataClassC_CDPState_DISABLED: return @"DISABLED";
109 case OTAccountMetadataClassC_CDPState_ENABLED: return @"ENABLED";
110 default: return [NSString stringWithFormat:@"(unknown: %i)", value];
111 }
112 }
113 #endif /* __OBJC__ */
114 #ifdef __OBJC__
115 NS_INLINE OTAccountMetadataClassC_CDPState StringAsOTAccountMetadataClassC_CDPState(NSString *value)
116 {
117 if ([value isEqualToString:@"UNKNOWN"]) return OTAccountMetadataClassC_CDPState_UNKNOWN;
118 if ([value isEqualToString:@"DISABLED"]) return OTAccountMetadataClassC_CDPState_DISABLED;
119 if ([value isEqualToString:@"ENABLED"]) return OTAccountMetadataClassC_CDPState_ENABLED;
120 return OTAccountMetadataClassC_CDPState_UNKNOWN;
121 }
122 #endif /* __OBJC__ */
123
124 #ifdef __cplusplus
125 #define OTACCOUNTMETADATACLASSC_FUNCTION extern "C" __attribute__((visibility("hidden")))
126 #else
127 #define OTACCOUNTMETADATACLASSC_FUNCTION extern __attribute__((visibility("hidden")))
128 #endif
129
130 __attribute__((visibility("hidden")))
131 @interface OTAccountMetadataClassC : PBCodable <NSCopying>
132 {
133 int64_t _epoch;
134 uint64_t _lastHealthCheckup;
135 NSString *_altDSID;
136 OTAccountMetadataClassC_AttemptedAJoinState _attemptedJoin;
137 OTAccountMetadataClassC_CDPState _cdpState;
138 OTAccountMetadataClassC_AccountState _icloudAccountState;
139 NSString *_peerID;
140 NSData *_syncingPolicy;
141 OTAccountMetadataClassC_TrustState _trustState;
142 NSData *_voucher;
143 NSData *_voucherSignature;
144 struct {
145 int epoch:1;
146 int lastHealthCheckup:1;
147 int attemptedJoin:1;
148 int cdpState:1;
149 int icloudAccountState:1;
150 int trustState:1;
151 } _has;
152 }
153
154
155 @property (nonatomic, readonly) BOOL hasPeerID;
156 @property (nonatomic, retain) NSString *peerID;
157
158 @property (nonatomic) BOOL hasIcloudAccountState;
159 @property (nonatomic) OTAccountMetadataClassC_AccountState icloudAccountState;
160 - (NSString *)icloudAccountStateAsString:(OTAccountMetadataClassC_AccountState)value;
161 - (OTAccountMetadataClassC_AccountState)StringAsIcloudAccountState:(NSString *)str;
162
163 @property (nonatomic) BOOL hasEpoch;
164 @property (nonatomic) int64_t epoch;
165
166 @property (nonatomic, readonly) BOOL hasAltDSID;
167 @property (nonatomic, retain) NSString *altDSID;
168
169 @property (nonatomic) BOOL hasTrustState;
170 @property (nonatomic) OTAccountMetadataClassC_TrustState trustState;
171 - (NSString *)trustStateAsString:(OTAccountMetadataClassC_TrustState)value;
172 - (OTAccountMetadataClassC_TrustState)StringAsTrustState:(NSString *)str;
173
174 @property (nonatomic) BOOL hasLastHealthCheckup;
175 /** Holds the time, in milliseconds since 1970, that the last health checkup query to Cuttlefish was successfully performed */
176 @property (nonatomic) uint64_t lastHealthCheckup;
177
178 @property (nonatomic) BOOL hasAttemptedJoin;
179 @property (nonatomic) OTAccountMetadataClassC_AttemptedAJoinState attemptedJoin;
180 - (NSString *)attemptedJoinAsString:(OTAccountMetadataClassC_AttemptedAJoinState)value;
181 - (OTAccountMetadataClassC_AttemptedAJoinState)StringAsAttemptedJoin:(NSString *)str;
182
183 @property (nonatomic) BOOL hasCdpState;
184 @property (nonatomic) OTAccountMetadataClassC_CDPState cdpState;
185 - (NSString *)cdpStateAsString:(OTAccountMetadataClassC_CDPState)value;
186 - (OTAccountMetadataClassC_CDPState)StringAsCdpState:(NSString *)str;
187
188 @property (nonatomic, readonly) BOOL hasSyncingPolicy;
189 /**
190 * Used during development
191 * reserved 9;
192 * reserved 10;
193 * This holds the current syncing policy for the local peer, including the view list.
194 */
195 @property (nonatomic, retain) NSData *syncingPolicy;
196
197 @property (nonatomic, readonly) BOOL hasVoucher;
198 /** This might contain a voucher for use in joining Octagon. */
199 @property (nonatomic, retain) NSData *voucher;
200
201 @property (nonatomic, readonly) BOOL hasVoucherSignature;
202 @property (nonatomic, retain) NSData *voucherSignature;
203
204 // Performs a shallow copy into other
205 - (void)copyTo:(OTAccountMetadataClassC *)other;
206
207 // Performs a deep merge from other into self
208 // If set in other, singular values in self are replaced in self
209 // Singular composite values are recursively merged
210 // Repeated values from other are appended to repeated values in self
211 - (void)mergeFrom:(OTAccountMetadataClassC *)other;
212
213 OTACCOUNTMETADATACLASSC_FUNCTION BOOL OTAccountMetadataClassCReadFrom(__unsafe_unretained OTAccountMetadataClassC *self, __unsafe_unretained PBDataReader *reader);
214
215 @end
216