-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResponseCode.proto
More file actions
51 lines (44 loc) · 3.65 KB
/
ResponseCode.proto
File metadata and controls
51 lines (44 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
syntax = "proto3";
package e2ees;
option java_package = "org.e2eelab.proto.e2ees";
option java_outer_classname = "ResponseCodeProto";
option objc_class_prefix = "Objc";
option swift_prefix="Swift";
/**
* Response status codes indicate whether a specific request
* has been successfully completed.
* Responses are grouped in four classes:
* (ref: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
* Informational responses 100–199
* Successful responses 200–299
* Client error responses 400–499
* Server error responses 500–599
* Custom responses 1000–1007
*/
enum ResponseCode {
RESPONSE_CODE_UNSPECIFIED = 0; // Unknown response.
RESPONSE_CODE_OK = 200; // The request succeeded, and some resources were read or updated.
RESPONSE_CODE_CREATED = 201; // The request succeeded, and some new resources were created as a result.
RESPONSE_CODE_ACCEPTED = 202; // The request has been received but not yet acted upon.
RESPONSE_CODE_NO_CONTENT = 204; // There is no content to send for this request, and some resources were deleted.
RESPONSE_CODE_BAD_REQUEST = 400; // The server cannot or will not process the request due to something that is perceived to be a client error.
RESPONSE_CODE_UNAUTHORIZED = 401; // The client is not authenticated to get the requested response.
RESPONSE_CODE_FORBIDDEN = 403; // The client is authenticated but does not have access rights to the content.
RESPONSE_CODE_NOT_FOUND = 404; // The server can not find the requested resource.
RESPONSE_CODE_REQUEST_TIMEOUT = 408; // The server timed out waiting for the request, or client timeout waiting for the response.
RESPONSE_CODE_REQUEST_CONFLICT = 409; // Indicates that the request could not be processed because of conflict in the current state of the resource.
RESPONSE_CODE_PAYLOAD_TOO_LARGE = 413; // The request is larger than the server is willing or able to process.
RESPONSE_CODE_EXPECTATION_FAILED = 417; // The server cannot meet the requirements of the expected request data.
RESPONSE_CODE_UPGRADE_REQUIRED = 426; // The client should perform protocol upgrade.
RESPONSE_CODE_TOO_MANY_REQUESTS = 429; // The user has sent too many requests in a given amount of time.
RESPONSE_CODE_INTERNAL_SERVER_ERROR = 500; // The server has encountered a situation it does not know how to handle.
RESPONSE_CODE_SERVICE_UNAVAILABLE = 503; // The server is down for maintenance or overloaded.
RESPONSE_CODE_CUSTOM_1000 = 1000; // A custom response code supports the flexibility of diverse server implementations.
RESPONSE_CODE_CUSTOM_1001 = 1001; // A custom response code supports the flexibility of diverse server implementations.
RESPONSE_CODE_CUSTOM_1002 = 1002; // A custom response code supports the flexibility of diverse server implementations.
RESPONSE_CODE_CUSTOM_1003 = 1003; // A custom response code supports the flexibility of diverse server implementations.
RESPONSE_CODE_CUSTOM_1004 = 1004; // A custom response code supports the flexibility of diverse server implementations.
RESPONSE_CODE_CUSTOM_1005 = 1005; // A custom response code supports the flexibility of diverse server implementations.
RESPONSE_CODE_CUSTOM_1006 = 1006; // A custom response code supports the flexibility of diverse server implementations.
RESPONSE_CODE_CUSTOM_1007 = 1007; // A custom response code supports the flexibility of diverse server implementations.
}