| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 | 2 |
| 3 library googleapis_beta.clouderrorreporting.v1beta1; | 3 library googleapis_beta.clouderrorreporting.v1beta1; |
| 4 | 4 |
| 5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
| 8 | 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 var _response = _requester.request(_url, | 176 var _response = _requester.request(_url, |
| 177 "GET", | 177 "GET", |
| 178 body: _body, | 178 body: _body, |
| 179 queryParams: _queryParams, | 179 queryParams: _queryParams, |
| 180 uploadOptions: _uploadOptions, | 180 uploadOptions: _uploadOptions, |
| 181 uploadMedia: _uploadMedia, | 181 uploadMedia: _uploadMedia, |
| 182 downloadOptions: _downloadOptions); | 182 downloadOptions: _downloadOptions); |
| 183 return _response.then((data) => new ListEventsResponse.fromJson(data)); | 183 return _response.then((data) => new ListEventsResponse.fromJson(data)); |
| 184 } | 184 } |
| 185 | 185 |
| 186 /** |
| 187 * Report an individual error event. |
| 188 * |
| 189 * This endpoint accepts <strong>either</strong> an OAuth token, |
| 190 * <strong>or</strong> an |
| 191 * <a href="https://support.google.com/cloud/answer/6158862">API key</a> |
| 192 * for authentication. To use an API key, append it to the URL as the value of |
| 193 * a `key` parameter. For example: |
| 194 * <pre>POST |
| 195 * https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project
/events:report?key=123ABC456</pre> |
| 196 * |
| 197 * [request] - The metadata request object. |
| 198 * |
| 199 * Request parameters: |
| 200 * |
| 201 * [projectName] - [Required] The resource name of the Google Cloud Platform |
| 202 * project. Written |
| 203 * as `projects/` plus the |
| 204 * [Google Cloud Platform project |
| 205 * ID](https://support.google.com/cloud/answer/6158840). |
| 206 * Example: `projects/my-project-123`. |
| 207 * Value must have pattern "^projects/[^/]*$". |
| 208 * |
| 209 * Completes with a [ReportErrorEventResponse]. |
| 210 * |
| 211 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 212 * error. |
| 213 * |
| 214 * If the used [http.Client] completes with an error when making a REST call, |
| 215 * this method will complete with the same error. |
| 216 */ |
| 217 async.Future<ReportErrorEventResponse> report(ReportedErrorEvent request, core
.String projectName) { |
| 218 var _url = null; |
| 219 var _queryParams = new core.Map(); |
| 220 var _uploadMedia = null; |
| 221 var _uploadOptions = null; |
| 222 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 223 var _body = null; |
| 224 |
| 225 if (request != null) { |
| 226 _body = convert.JSON.encode((request).toJson()); |
| 227 } |
| 228 if (projectName == null) { |
| 229 throw new core.ArgumentError("Parameter projectName is required."); |
| 230 } |
| 231 |
| 232 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$projectName') +
'/events:report'; |
| 233 |
| 234 var _response = _requester.request(_url, |
| 235 "POST", |
| 236 body: _body, |
| 237 queryParams: _queryParams, |
| 238 uploadOptions: _uploadOptions, |
| 239 uploadMedia: _uploadMedia, |
| 240 downloadOptions: _downloadOptions); |
| 241 return _response.then((data) => new ReportErrorEventResponse.fromJson(data))
; |
| 242 } |
| 243 |
| 186 } | 244 } |
| 187 | 245 |
| 188 | 246 |
| 189 class ProjectsGroupStatsResourceApi { | 247 class ProjectsGroupStatsResourceApi { |
| 190 final commons.ApiRequester _requester; | 248 final commons.ApiRequester _requester; |
| 191 | 249 |
| 192 ProjectsGroupStatsResourceApi(commons.ApiRequester client) : | 250 ProjectsGroupStatsResourceApi(commons.ApiRequester client) : |
| 193 _requester = client; | 251 _requester = client; |
| 194 | 252 |
| 195 /** | 253 /** |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 _json["errorGroupStats"] = errorGroupStats.map((value) => (value).toJson()
).toList(); | 922 _json["errorGroupStats"] = errorGroupStats.map((value) => (value).toJson()
).toList(); |
| 865 } | 923 } |
| 866 if (nextPageToken != null) { | 924 if (nextPageToken != null) { |
| 867 _json["nextPageToken"] = nextPageToken; | 925 _json["nextPageToken"] = nextPageToken; |
| 868 } | 926 } |
| 869 return _json; | 927 return _json; |
| 870 } | 928 } |
| 871 } | 929 } |
| 872 | 930 |
| 873 /** | 931 /** |
| 932 * Response for reporting an individual error event. |
| 933 * Data may be added to this message in the future. |
| 934 */ |
| 935 class ReportErrorEventResponse { |
| 936 |
| 937 ReportErrorEventResponse(); |
| 938 |
| 939 ReportErrorEventResponse.fromJson(core.Map _json) { |
| 940 } |
| 941 |
| 942 core.Map toJson() { |
| 943 var _json = new core.Map(); |
| 944 return _json; |
| 945 } |
| 946 } |
| 947 |
| 948 /** An error event which is reported to the Error Reporting system. */ |
| 949 class ReportedErrorEvent { |
| 950 /** [Optional] A description of the context in which the error occurred. */ |
| 951 ErrorContext context; |
| 952 /** |
| 953 * [Optional] Time when the event occurred. |
| 954 * If not provided, the time when the event was received by the |
| 955 * Error Reporting system will be used. |
| 956 */ |
| 957 core.String eventTime; |
| 958 /** |
| 959 * [Required] A message describing the error. The message can contain an |
| 960 * exception stack in one of the supported programming languages and formats. |
| 961 * In that case, the message is parsed and detailed exception information |
| 962 * is returned when retrieving the error event again. |
| 963 */ |
| 964 core.String message; |
| 965 /** [Required] The service context in which this error has occurred. */ |
| 966 ServiceContext serviceContext; |
| 967 |
| 968 ReportedErrorEvent(); |
| 969 |
| 970 ReportedErrorEvent.fromJson(core.Map _json) { |
| 971 if (_json.containsKey("context")) { |
| 972 context = new ErrorContext.fromJson(_json["context"]); |
| 973 } |
| 974 if (_json.containsKey("eventTime")) { |
| 975 eventTime = _json["eventTime"]; |
| 976 } |
| 977 if (_json.containsKey("message")) { |
| 978 message = _json["message"]; |
| 979 } |
| 980 if (_json.containsKey("serviceContext")) { |
| 981 serviceContext = new ServiceContext.fromJson(_json["serviceContext"]); |
| 982 } |
| 983 } |
| 984 |
| 985 core.Map toJson() { |
| 986 var _json = new core.Map(); |
| 987 if (context != null) { |
| 988 _json["context"] = (context).toJson(); |
| 989 } |
| 990 if (eventTime != null) { |
| 991 _json["eventTime"] = eventTime; |
| 992 } |
| 993 if (message != null) { |
| 994 _json["message"] = message; |
| 995 } |
| 996 if (serviceContext != null) { |
| 997 _json["serviceContext"] = (serviceContext).toJson(); |
| 998 } |
| 999 return _json; |
| 1000 } |
| 1001 } |
| 1002 |
| 1003 /** |
| 874 * Describes a running service that sends errors. | 1004 * Describes a running service that sends errors. |
| 875 * Its version changes over time and multiple versions can run in parallel. | 1005 * Its version changes over time and multiple versions can run in parallel. |
| 876 */ | 1006 */ |
| 877 class ServiceContext { | 1007 class ServiceContext { |
| 878 /** | 1008 /** |
| 879 * An identifier of the service, such as the name of the | 1009 * An identifier of the service, such as the name of the |
| 880 * executable, job, or Google App Engine module name. This field is expected | 1010 * executable, job, or Google App Engine module name. This field is expected |
| 881 * to have a low number of values that are relatively stable over time, as | 1011 * to have a low number of values that are relatively stable over time, as |
| 882 * opposed to `version`, which can be changed whenever new code is deployed. | 1012 * opposed to `version`, which can be changed whenever new code is deployed. |
| 883 * | 1013 * |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 } | 1154 } |
| 1025 | 1155 |
| 1026 core.Map toJson() { | 1156 core.Map toJson() { |
| 1027 var _json = new core.Map(); | 1157 var _json = new core.Map(); |
| 1028 if (url != null) { | 1158 if (url != null) { |
| 1029 _json["url"] = url; | 1159 _json["url"] = url; |
| 1030 } | 1160 } |
| 1031 return _json; | 1161 return _json; |
| 1032 } | 1162 } |
| 1033 } | 1163 } |
| OLD | NEW |