commit | author | age
|
655e66
|
1 |
/* |
H |
2 |
* Copyright (C) 2017 Twitter, Inc. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
* |
|
16 |
*/ |
|
17 |
|
|
18 |
/** |
|
19 |
This header is private to the Twitter Core SDK and not exposed for public SDK consumption |
|
20 |
*/ |
a0a843
|
21 |
|
H |
22 |
#import <Foundation/Foundation.h> |
|
23 |
|
655e66
|
24 |
FOUNDATION_EXTERN NSString *const TWTRNetworkingErrorDomain; |
H |
25 |
FOUNDATION_EXTERN NSString *const TWTRNetworkingUserAgentHeaderKey; |
|
26 |
FOUNDATION_EXTERN NSString *const TWTRNetworkingStatusCodeKey; |
a0a843
|
27 |
|
H |
28 |
#pragma mark - HTTP Headers |
655e66
|
29 |
FOUNDATION_EXTERN NSString *const TWTRContentTypeHeaderField; |
H |
30 |
FOUNDATION_EXTERN NSString *const TWTRContentLengthHeaderField; |
|
31 |
FOUNDATION_EXTERN NSString *const TWTRContentTypeURLEncoded; |
|
32 |
FOUNDATION_EXTERN NSString *const TWTRAcceptEncodingHeaderField; |
|
33 |
FOUNDATION_EXTERN NSString *const TWTRAcceptEncodingGzip; |
a0a843
|
34 |
|
H |
35 |
/** |
|
36 |
* Internal API error codes |
|
37 |
* These error codes belong to the `TWTRAPIErrorDomain` error domain. |
|
38 |
* @see https://cgit.twitter.biz/birdcage/tree/macaw/macaw-core/src/main/scala/com/twitter/macaw/monorail/ApiError.scala |
|
39 |
*/ |
|
40 |
// TODO: Move these to the public header because they can all surface to the developer? |
|
41 |
typedef NS_ENUM(NSUInteger, TWTRTwitterAPIErrorCode) { |
|
42 |
/** |
|
43 |
* "%s parameter is invalid" |
|
44 |
*/ |
|
45 |
TWTRTwitterAPIErrorInvalidParameter = 44, |
|
46 |
|
|
47 |
/** |
|
48 |
* "The email address associated with this account is invalid." |
|
49 |
*/ |
|
50 |
TWTRTwitterAPIErrorInvalidEmailAddress = 56, |
|
51 |
|
|
52 |
/** |
|
53 |
* "Client is not permitted to perform this action" |
|
54 |
*/ |
|
55 |
TWTRTwitterAPIErrorClientNotPrivileged = 87, |
|
56 |
|
|
57 |
/** |
|
58 |
* "Rate limit exceeded" |
|
59 |
*/ |
|
60 |
TWTRTwitterAPIErrorRateLimitExceeded = 88, |
|
61 |
|
|
62 |
/** |
|
63 |
* "Account update failed: %s." |
|
64 |
*/ |
|
65 |
TWTRTwitterAPIErrorAccountUpdateFailure = 120, |
|
66 |
|
|
67 |
/** |
|
68 |
* "Bad Authentication data." |
|
69 |
*/ |
|
70 |
TWTRTwitterAPIErrorCodeBadAuthenticationData = 215, |
|
71 |
|
|
72 |
/** |
|
73 |
* "The login verification request has expired" |
|
74 |
*/ |
|
75 |
TWTRTwitterAPIErrorExpiredLoginVerificationRequest = 235, |
|
76 |
|
|
77 |
/** |
|
78 |
* "The challenge response is incorrect" |
|
79 |
*/ |
|
80 |
TWTRTwitterAPIErrorIncorrectChallengeResponse = 236, |
|
81 |
|
|
82 |
/** |
|
83 |
* "That is not an active login verification request ID" |
|
84 |
*/ |
|
85 |
TWTRTwitterAPIErrorMissingLoginVerificationRequest = 237, |
|
86 |
|
|
87 |
/** |
|
88 |
* "Your signup request looks similar to automated requests from a computer. To protect our users from spam and other malicious activity, we can't create an account for you right now. Please try again later." |
|
89 |
*/ |
|
90 |
TWTRTwitterAPIErrorTieredActionSignupSpammerPhoneVerify = 240, |
|
91 |
|
|
92 |
/** |
|
93 |
* "User is over the limit for login verification. Please try again in an hour." |
|
94 |
*/ |
|
95 |
TWTRTwitterAPIErrorOverLimitLoginVerificationStart = 245, |
|
96 |
|
|
97 |
/** |
|
98 |
* "User is over the limit for login verification attempts. Please try signing in again." |
|
99 |
*/ |
|
100 |
TWTRTwitterAPIErrorOverLimitLoginVerificationAttempt = 246, |
|
101 |
|
|
102 |
/** |
|
103 |
* "The login request is not yet approved." |
|
104 |
*/ |
|
105 |
TWTRTwitterAPIErrorNotYetApprovedLoginVerification = 253, |
|
106 |
|
|
107 |
/** |
|
108 |
* "There was a failure sending the login verification request" |
|
109 |
*/ |
|
110 |
TWTRTwitterAPIErrorFailureSendingLoginVerificationRequest = 266, |
|
111 |
|
|
112 |
/** |
|
113 |
* "User is not an SDK user" |
|
114 |
*/ |
|
115 |
TWTRTwitterAPIErrorUserIsNotSdkUser = 269, |
|
116 |
|
|
117 |
/** |
|
118 |
* "We are unable to verify this phone number." |
|
119 |
*/ |
|
120 |
TWTRTwitterAPIErrorDeviceRegistrationGeneralError = 284, |
|
121 |
|
|
122 |
/** |
|
123 |
* "This phone number is already registered." |
|
124 |
*/ |
|
125 |
TWTRTwitterAPIErrorDeviceAlreadyRegistered = 285, |
|
126 |
|
|
127 |
/** |
|
128 |
* "We cannot send a text message to this phone number because its operator is not supported." |
|
129 |
*/ |
|
130 |
TWTRTwitterAPIErrorDeviceOperatorUnsupported = 286, |
|
131 |
|
|
132 |
/** |
|
133 |
* "Device registration contains incorrect/unformatted input. |
|
134 |
*/ |
|
135 |
TWTRTwitterAPIErrorDeviceRegistrationInvalidInput = 300, |
|
136 |
|
|
137 |
/** |
|
138 |
* "Device registration attempted on pending device." |
|
139 |
*/ |
|
140 |
TWTRTwitterAPIErrorDeviceDeviceRegistrationPending = 301, |
|
141 |
|
|
142 |
/** |
|
143 |
* "Internal operation failed during device registration." |
|
144 |
*/ |
|
145 |
TWTRTwitterAPIErrorDeviceRegistrationOperationFailed = 302, |
|
146 |
|
|
147 |
/** |
|
148 |
* "Phone number normalization failed during device registration" |
|
149 |
*/ |
|
150 |
TWTRTwitterAPIErrorDeviceRegistrationPhoneNormalizationFailed = 303, |
|
151 |
|
|
152 |
/** |
|
153 |
* "Phone number country not detected upon normalization during device registration" |
|
154 |
*/ |
|
155 |
TWTRTwitterAPIErrorDeviceRegistrationPhoneCountryDetectionFailed = 304, |
|
156 |
}; |