1 |
efrain |
1 |
/*
|
|
|
2 |
* Copyright 2019 Google
|
|
|
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 |
#import <Foundation/Foundation.h>
|
|
|
18 |
|
|
|
19 |
NS_ASSUME_NONNULL_BEGIN
|
|
|
20 |
|
|
|
21 |
/** Represents an error caused by an unexpected API response. */
|
|
|
22 |
@interface FIRInstallationsHTTPError : NSError
|
|
|
23 |
|
|
|
24 |
@property(nonatomic, readonly) NSHTTPURLResponse *HTTPResponse;
|
|
|
25 |
@property(nonatomic, readonly, nonnull) NSData *data;
|
|
|
26 |
|
|
|
27 |
- (instancetype)init NS_UNAVAILABLE;
|
|
|
28 |
|
|
|
29 |
- (instancetype)initWithHTTPResponse:(NSHTTPURLResponse *)HTTPResponse data:(nullable NSData *)data;
|
|
|
30 |
|
|
|
31 |
@end
|
|
|
32 |
|
|
|
33 |
NS_ASSUME_NONNULL_END
|
|
|
34 |
|
|
|
35 |
typedef NS_ENUM(NSInteger, FIRInstallationsHTTPCodes) {
|
|
|
36 |
FIRInstallationsHTTPCodesTooManyRequests = 429,
|
|
|
37 |
FIRInstallationsHTTPCodesServerInternalError = 500,
|
|
|
38 |
};
|
|
|
39 |
|
|
|
40 |
/** Possible response HTTP codes for `CreateInstallation` API request. */
|
|
|
41 |
typedef NS_ENUM(NSInteger, FIRInstallationsRegistrationHTTPCode) {
|
|
|
42 |
FIRInstallationsRegistrationHTTPCodeSuccess = 201,
|
|
|
43 |
FIRInstallationsRegistrationHTTPCodeInvalidArgument = 400,
|
|
|
44 |
FIRInstallationsRegistrationHTTPCodeAPIKeyToProjectIDMismatch = 403,
|
|
|
45 |
FIRInstallationsRegistrationHTTPCodeProjectNotFound = 404,
|
|
|
46 |
FIRInstallationsRegistrationHTTPCodeTooManyRequests = 429,
|
|
|
47 |
FIRInstallationsRegistrationHTTPCodeServerInternalError = 500
|
|
|
48 |
};
|
|
|
49 |
|
|
|
50 |
typedef NS_ENUM(NSInteger, FIRInstallationsAuthTokenHTTPCode) {
|
|
|
51 |
FIRInstallationsAuthTokenHTTPCodeInvalidAuthentication = 401,
|
|
|
52 |
FIRInstallationsAuthTokenHTTPCodeFIDNotFound = 404,
|
|
|
53 |
};
|