1 // This file was automatically generated by protocompiler
3 // Compiled from OTAccountMetadataClassC.proto
5 #import <Foundation/Foundation.h>
6 #import <ProtocolBuffer/PBCodable.h>
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
14 typedef NS_ENUM(int32_t, OTAccountMetadataClassC_AccountState
) {
15 OTAccountMetadataClassC_AccountState_UNKNOWN
= 0,
16 OTAccountMetadataClassC_AccountState_NO_ACCOUNT
= 1,
17 OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE
= 2,
18 OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE_UNUSED
= 3,
21 NS_INLINE NSString
*OTAccountMetadataClassC_AccountStateAsString(OTAccountMetadataClassC_AccountState value
)
25 case OTAccountMetadataClassC_AccountState_UNKNOWN
: return @
"UNKNOWN";
26 case OTAccountMetadataClassC_AccountState_NO_ACCOUNT
: return @
"NO_ACCOUNT";
27 case OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE
: return @
"ACCOUNT_AVAILABLE";
28 case OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE_UNUSED
: return @
"ACCOUNT_AVAILABLE_UNUSED";
29 default: return [NSString stringWithFormat
:@
"(unknown: %i)", value
];
34 NS_INLINE OTAccountMetadataClassC_AccountState
StringAsOTAccountMetadataClassC_AccountState(NSString
*value
)
36 if ([value isEqualToString
:@
"UNKNOWN"]) return OTAccountMetadataClassC_AccountState_UNKNOWN
;
37 if ([value isEqualToString
:@
"NO_ACCOUNT"]) return OTAccountMetadataClassC_AccountState_NO_ACCOUNT
;
38 if ([value isEqualToString
:@
"ACCOUNT_AVAILABLE"]) return OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE
;
39 if ([value isEqualToString
:@
"ACCOUNT_AVAILABLE_UNUSED"]) return OTAccountMetadataClassC_AccountState_ACCOUNT_AVAILABLE_UNUSED
;
40 return OTAccountMetadataClassC_AccountState_UNKNOWN
;
43 typedef NS_ENUM(int32_t, OTAccountMetadataClassC_TrustState
) {
44 OTAccountMetadataClassC_TrustState_UNKNOWN
= 0,
45 OTAccountMetadataClassC_TrustState_UNTRUSTED
= 1,
46 OTAccountMetadataClassC_TrustState_TRUSTED
= 2,
49 NS_INLINE NSString
*OTAccountMetadataClassC_TrustStateAsString(OTAccountMetadataClassC_TrustState value
)
53 case OTAccountMetadataClassC_TrustState_UNKNOWN
: return @
"UNKNOWN";
54 case OTAccountMetadataClassC_TrustState_UNTRUSTED
: return @
"UNTRUSTED";
55 case OTAccountMetadataClassC_TrustState_TRUSTED
: return @
"TRUSTED";
56 default: return [NSString stringWithFormat
:@
"(unknown: %i)", value
];
61 NS_INLINE OTAccountMetadataClassC_TrustState
StringAsOTAccountMetadataClassC_TrustState(NSString
*value
)
63 if ([value isEqualToString
:@
"UNKNOWN"]) return OTAccountMetadataClassC_TrustState_UNKNOWN
;
64 if ([value isEqualToString
:@
"UNTRUSTED"]) return OTAccountMetadataClassC_TrustState_UNTRUSTED
;
65 if ([value isEqualToString
:@
"TRUSTED"]) return OTAccountMetadataClassC_TrustState_TRUSTED
;
66 return OTAccountMetadataClassC_TrustState_UNKNOWN
;
69 typedef NS_ENUM(int32_t, OTAccountMetadataClassC_AttemptedAJoinState
) {
70 OTAccountMetadataClassC_AttemptedAJoinState_UNKNOWN
= 0,
71 OTAccountMetadataClassC_AttemptedAJoinState_NOTATTEMPTED
= 1,
72 OTAccountMetadataClassC_AttemptedAJoinState_ATTEMPTED
= 2,
75 NS_INLINE NSString
*OTAccountMetadataClassC_AttemptedAJoinStateAsString(OTAccountMetadataClassC_AttemptedAJoinState value
)
79 case OTAccountMetadataClassC_AttemptedAJoinState_UNKNOWN
: return @
"UNKNOWN";
80 case OTAccountMetadataClassC_AttemptedAJoinState_NOTATTEMPTED
: return @
"NOTATTEMPTED";
81 case OTAccountMetadataClassC_AttemptedAJoinState_ATTEMPTED
: return @
"ATTEMPTED";
82 default: return [NSString stringWithFormat
:@
"(unknown: %i)", value
];
87 NS_INLINE OTAccountMetadataClassC_AttemptedAJoinState
StringAsOTAccountMetadataClassC_AttemptedAJoinState(NSString
*value
)
89 if ([value isEqualToString
:@
"UNKNOWN"]) return OTAccountMetadataClassC_AttemptedAJoinState_UNKNOWN
;
90 if ([value isEqualToString
:@
"NOTATTEMPTED"]) return OTAccountMetadataClassC_AttemptedAJoinState_NOTATTEMPTED
;
91 if ([value isEqualToString
:@
"ATTEMPTED"]) return OTAccountMetadataClassC_AttemptedAJoinState_ATTEMPTED
;
92 return OTAccountMetadataClassC_AttemptedAJoinState_UNKNOWN
;
97 #define OTACCOUNTMETADATACLASSC_FUNCTION extern "C" __attribute__((visibility("hidden")))
99 #define OTACCOUNTMETADATACLASSC_FUNCTION extern __attribute__((visibility("hidden")))
102 __attribute__((visibility("hidden")))
103 @interface OTAccountMetadataClassC
: PBCodable
<NSCopying
>
106 uint64_t _lastHealthCheckup
;
108 OTAccountMetadataClassC_AttemptedAJoinState _attemptedJoin
;
109 OTAccountMetadataClassC_AccountState _icloudAccountState
;
111 OTAccountMetadataClassC_TrustState _trustState
;
114 int lastHealthCheckup
:1;
116 int icloudAccountState
:1;
122 @
property (nonatomic
, readonly
) BOOL hasPeerID
;
123 @
property (nonatomic
, retain
) NSString
*peerID
;
125 @
property (nonatomic
) BOOL hasIcloudAccountState
;
126 @
property (nonatomic
) OTAccountMetadataClassC_AccountState icloudAccountState
;
127 - (NSString
*)icloudAccountStateAsString
:(OTAccountMetadataClassC_AccountState
)value
;
128 - (OTAccountMetadataClassC_AccountState
)StringAsIcloudAccountState
:(NSString
*)str
;
130 @
property (nonatomic
) BOOL hasEpoch
;
131 @
property (nonatomic
) int64_t epoch
;
133 @
property (nonatomic
, readonly
) BOOL hasAltDSID
;
134 @
property (nonatomic
, retain
) NSString
*altDSID
;
136 @
property (nonatomic
) BOOL hasTrustState
;
137 @
property (nonatomic
) OTAccountMetadataClassC_TrustState trustState
;
138 - (NSString
*)trustStateAsString
:(OTAccountMetadataClassC_TrustState
)value
;
139 - (OTAccountMetadataClassC_TrustState
)StringAsTrustState
:(NSString
*)str
;
141 @
property (nonatomic
) BOOL hasLastHealthCheckup
;
142 /** Holds the time, in milliseconds since 1970, that the last health checkup query to Cuttlefish was successfully performed */
143 @
property (nonatomic
) uint64_t lastHealthCheckup
;
145 @
property (nonatomic
) BOOL hasAttemptedJoin
;
146 @
property (nonatomic
) OTAccountMetadataClassC_AttemptedAJoinState attemptedJoin
;
147 - (NSString
*)attemptedJoinAsString
:(OTAccountMetadataClassC_AttemptedAJoinState
)value
;
148 - (OTAccountMetadataClassC_AttemptedAJoinState
)StringAsAttemptedJoin
:(NSString
*)str
;
150 // Performs a shallow copy into other
151 - (void)copyTo
:(OTAccountMetadataClassC
*)other
;
153 // Performs a deep merge from other into self
154 // If set in other, singular values in self are replaced in self
155 // Singular composite values are recursively merged
156 // Repeated values from other are appended to repeated values in self
157 - (void)mergeFrom
:(OTAccountMetadataClassC
*)other
;
159 OTACCOUNTMETADATACLASSC_FUNCTION BOOL
OTAccountMetadataClassCReadFrom(__unsafe_unretained OTAccountMetadataClassC
*self
, __unsafe_unretained PBDataReader
*reader
);