|
17 | 17 |
|
18 | 18 | __all__ = ["gen_rule_payload", "gen_params_from_config", |
19 | 19 | "infer_endpoint", "convert_utc_time", |
20 | | - "validate_count_api", "GNIP_RESP_CODES", "change_to_count_endpoint"] |
| 20 | + "validate_count_api", "change_to_count_endpoint"] |
21 | 21 |
|
22 | 22 | logger = logging.getLogger(__name__) |
23 | 23 |
|
24 | | -GNIP_RESP_CODES = { |
25 | | - '200': ("OK: The request was successful. " |
26 | | - "The JSON response will be similar to the following:"), |
27 | | - |
28 | | - '400': ("Bad Request: Generally, this response occurs due " |
29 | | - "to the presence of invalid JSON in the request, " |
30 | | - "or where the request failed to send any JSON payload."), |
31 | | - |
32 | | - '401': ("Unauthorized: HTTP authentication failed due to invalid " |
33 | | - "credentials. Log in to console.gnip.com with your credentials " |
34 | | - "to ensure you are using them correctly with your request. "), |
35 | | - '404': ("Not Found: The resource was not found at the URL to which the " |
36 | | - "request was sent, likely because an incorrect URL was used."), |
37 | | - |
38 | | - '422': ("Unprocessable Entity: This is returned due to invalid parameters " |
39 | | - "in a query or when a query is too complex for us to process. " |
40 | | - "–e.g. invalid PowerTrack rules or too many phrase operators," |
41 | | - " rendering a query too complex."), |
42 | | - '429': ("Unknown Code: Your app has exceeded the limit on connection " |
43 | | - "requests. The corresponding JSON message will look " |
44 | | - "similar to the following:"), |
45 | | - '500': ("Internal Server Error: There was an error on Gnip's side. Retry " |
46 | | - "your request using an exponential backoff pattern."), |
47 | | - '502': ("Proxy Error: There was an error on Gnip's side. Retry your " |
48 | | - "request using an exponential backoff pattern."), |
49 | | - '503': ("Service Unavailable: There was an error on Gnip's side. " |
50 | | - "Retry your request using an exponential backoff pattern.") |
51 | | -} |
52 | | - |
53 | | - |
54 | 24 | def convert_utc_time(datetime_str): |
55 | 25 | """ |
56 | 26 | Handles datetime argument conversion to the GNIP API format, which is |
|
0 commit comments