| OLD | NEW |
| (Empty) |
| 1 // This is a generated file (see the discoveryapis_generator project). | |
| 2 | |
| 3 library googleapis.cloudlatencytest.v2; | |
| 4 | |
| 5 import 'dart:core' as core; | |
| 6 import 'dart:async' as async; | |
| 7 import 'dart:convert' as convert; | |
| 8 | |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | |
| 10 import 'package:http/http.dart' as http; | |
| 11 | |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | |
| 13 ApiRequestError, DetailedApiRequestError; | |
| 14 | |
| 15 const core.String USER_AGENT = 'dart-api-client cloudlatencytest/v2'; | |
| 16 | |
| 17 /** Reports latency data. */ | |
| 18 class CloudlatencytestApi { | |
| 19 /** View monitoring data for all of your Google Cloud and API projects */ | |
| 20 static const MonitoringReadonlyScope = "https://www.googleapis.com/auth/monito
ring.readonly"; | |
| 21 | |
| 22 | |
| 23 final commons.ApiRequester _requester; | |
| 24 | |
| 25 StatscollectionResourceApi get statscollection => new StatscollectionResourceA
pi(_requester); | |
| 26 | |
| 27 CloudlatencytestApi(http.Client client, {core.String rootUrl: "https://cloudla
tencytest-pa.googleapis.com/", core.String servicePath: "v2/statscollection/"})
: | |
| 28 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | |
| 29 } | |
| 30 | |
| 31 | |
| 32 class StatscollectionResourceApi { | |
| 33 final commons.ApiRequester _requester; | |
| 34 | |
| 35 StatscollectionResourceApi(commons.ApiRequester client) : | |
| 36 _requester = client; | |
| 37 | |
| 38 /** | |
| 39 * RPC to update the new TCP stats. | |
| 40 * | |
| 41 * [request] - The metadata request object. | |
| 42 * | |
| 43 * Request parameters: | |
| 44 * | |
| 45 * Completes with a [AggregatedStatsReply]. | |
| 46 * | |
| 47 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 48 * error. | |
| 49 * | |
| 50 * If the used [http.Client] completes with an error when making a REST call, | |
| 51 * this method will complete with the same error. | |
| 52 */ | |
| 53 async.Future<AggregatedStatsReply> updateaggregatedstats(AggregatedStats reque
st) { | |
| 54 var _url = null; | |
| 55 var _queryParams = new core.Map(); | |
| 56 var _uploadMedia = null; | |
| 57 var _uploadOptions = null; | |
| 58 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 59 var _body = null; | |
| 60 | |
| 61 if (request != null) { | |
| 62 _body = convert.JSON.encode((request).toJson()); | |
| 63 } | |
| 64 | |
| 65 _url = 'updateaggregatedstats'; | |
| 66 | |
| 67 var _response = _requester.request(_url, | |
| 68 "POST", | |
| 69 body: _body, | |
| 70 queryParams: _queryParams, | |
| 71 uploadOptions: _uploadOptions, | |
| 72 uploadMedia: _uploadMedia, | |
| 73 downloadOptions: _downloadOptions); | |
| 74 return _response.then((data) => new AggregatedStatsReply.fromJson(data)); | |
| 75 } | |
| 76 | |
| 77 /** | |
| 78 * RPC to update the new TCP stats. | |
| 79 * | |
| 80 * [request] - The metadata request object. | |
| 81 * | |
| 82 * Request parameters: | |
| 83 * | |
| 84 * Completes with a [StatsReply]. | |
| 85 * | |
| 86 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 87 * error. | |
| 88 * | |
| 89 * If the used [http.Client] completes with an error when making a REST call, | |
| 90 * this method will complete with the same error. | |
| 91 */ | |
| 92 async.Future<StatsReply> updatestats(Stats request) { | |
| 93 var _url = null; | |
| 94 var _queryParams = new core.Map(); | |
| 95 var _uploadMedia = null; | |
| 96 var _uploadOptions = null; | |
| 97 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 98 var _body = null; | |
| 99 | |
| 100 if (request != null) { | |
| 101 _body = convert.JSON.encode((request).toJson()); | |
| 102 } | |
| 103 | |
| 104 _url = 'updatestats'; | |
| 105 | |
| 106 var _response = _requester.request(_url, | |
| 107 "POST", | |
| 108 body: _body, | |
| 109 queryParams: _queryParams, | |
| 110 uploadOptions: _uploadOptions, | |
| 111 uploadMedia: _uploadMedia, | |
| 112 downloadOptions: _downloadOptions); | |
| 113 return _response.then((data) => new StatsReply.fromJson(data)); | |
| 114 } | |
| 115 | |
| 116 } | |
| 117 | |
| 118 | |
| 119 | |
| 120 class AggregatedStats { | |
| 121 core.List<Stats> stats; | |
| 122 | |
| 123 AggregatedStats(); | |
| 124 | |
| 125 AggregatedStats.fromJson(core.Map _json) { | |
| 126 if (_json.containsKey("stats")) { | |
| 127 stats = _json["stats"].map((value) => new Stats.fromJson(value)).toList(); | |
| 128 } | |
| 129 } | |
| 130 | |
| 131 core.Map toJson() { | |
| 132 var _json = new core.Map(); | |
| 133 if (stats != null) { | |
| 134 _json["stats"] = stats.map((value) => (value).toJson()).toList(); | |
| 135 } | |
| 136 return _json; | |
| 137 } | |
| 138 } | |
| 139 | |
| 140 class AggregatedStatsReply { | |
| 141 core.String testValue; | |
| 142 | |
| 143 AggregatedStatsReply(); | |
| 144 | |
| 145 AggregatedStatsReply.fromJson(core.Map _json) { | |
| 146 if (_json.containsKey("testValue")) { | |
| 147 testValue = _json["testValue"]; | |
| 148 } | |
| 149 } | |
| 150 | |
| 151 core.Map toJson() { | |
| 152 var _json = new core.Map(); | |
| 153 if (testValue != null) { | |
| 154 _json["testValue"] = testValue; | |
| 155 } | |
| 156 return _json; | |
| 157 } | |
| 158 } | |
| 159 | |
| 160 class DoubleValue { | |
| 161 core.String label; | |
| 162 core.double value; | |
| 163 | |
| 164 DoubleValue(); | |
| 165 | |
| 166 DoubleValue.fromJson(core.Map _json) { | |
| 167 if (_json.containsKey("label")) { | |
| 168 label = _json["label"]; | |
| 169 } | |
| 170 if (_json.containsKey("value")) { | |
| 171 value = _json["value"]; | |
| 172 } | |
| 173 } | |
| 174 | |
| 175 core.Map toJson() { | |
| 176 var _json = new core.Map(); | |
| 177 if (label != null) { | |
| 178 _json["label"] = label; | |
| 179 } | |
| 180 if (value != null) { | |
| 181 _json["value"] = value; | |
| 182 } | |
| 183 return _json; | |
| 184 } | |
| 185 } | |
| 186 | |
| 187 class IntValue { | |
| 188 core.String label; | |
| 189 core.String value; | |
| 190 | |
| 191 IntValue(); | |
| 192 | |
| 193 IntValue.fromJson(core.Map _json) { | |
| 194 if (_json.containsKey("label")) { | |
| 195 label = _json["label"]; | |
| 196 } | |
| 197 if (_json.containsKey("value")) { | |
| 198 value = _json["value"]; | |
| 199 } | |
| 200 } | |
| 201 | |
| 202 core.Map toJson() { | |
| 203 var _json = new core.Map(); | |
| 204 if (label != null) { | |
| 205 _json["label"] = label; | |
| 206 } | |
| 207 if (value != null) { | |
| 208 _json["value"] = value; | |
| 209 } | |
| 210 return _json; | |
| 211 } | |
| 212 } | |
| 213 | |
| 214 class Stats { | |
| 215 core.List<DoubleValue> doubleValues; | |
| 216 core.List<IntValue> intValues; | |
| 217 core.List<StringValue> stringValues; | |
| 218 core.double time; | |
| 219 | |
| 220 Stats(); | |
| 221 | |
| 222 Stats.fromJson(core.Map _json) { | |
| 223 if (_json.containsKey("doubleValues")) { | |
| 224 doubleValues = _json["doubleValues"].map((value) => new DoubleValue.fromJs
on(value)).toList(); | |
| 225 } | |
| 226 if (_json.containsKey("intValues")) { | |
| 227 intValues = _json["intValues"].map((value) => new IntValue.fromJson(value)
).toList(); | |
| 228 } | |
| 229 if (_json.containsKey("stringValues")) { | |
| 230 stringValues = _json["stringValues"].map((value) => new StringValue.fromJs
on(value)).toList(); | |
| 231 } | |
| 232 if (_json.containsKey("time")) { | |
| 233 time = _json["time"]; | |
| 234 } | |
| 235 } | |
| 236 | |
| 237 core.Map toJson() { | |
| 238 var _json = new core.Map(); | |
| 239 if (doubleValues != null) { | |
| 240 _json["doubleValues"] = doubleValues.map((value) => (value).toJson()).toLi
st(); | |
| 241 } | |
| 242 if (intValues != null) { | |
| 243 _json["intValues"] = intValues.map((value) => (value).toJson()).toList(); | |
| 244 } | |
| 245 if (stringValues != null) { | |
| 246 _json["stringValues"] = stringValues.map((value) => (value).toJson()).toLi
st(); | |
| 247 } | |
| 248 if (time != null) { | |
| 249 _json["time"] = time; | |
| 250 } | |
| 251 return _json; | |
| 252 } | |
| 253 } | |
| 254 | |
| 255 class StatsReply { | |
| 256 core.String testValue; | |
| 257 | |
| 258 StatsReply(); | |
| 259 | |
| 260 StatsReply.fromJson(core.Map _json) { | |
| 261 if (_json.containsKey("testValue")) { | |
| 262 testValue = _json["testValue"]; | |
| 263 } | |
| 264 } | |
| 265 | |
| 266 core.Map toJson() { | |
| 267 var _json = new core.Map(); | |
| 268 if (testValue != null) { | |
| 269 _json["testValue"] = testValue; | |
| 270 } | |
| 271 return _json; | |
| 272 } | |
| 273 } | |
| 274 | |
| 275 class StringValue { | |
| 276 core.String label; | |
| 277 core.String value; | |
| 278 | |
| 279 StringValue(); | |
| 280 | |
| 281 StringValue.fromJson(core.Map _json) { | |
| 282 if (_json.containsKey("label")) { | |
| 283 label = _json["label"]; | |
| 284 } | |
| 285 if (_json.containsKey("value")) { | |
| 286 value = _json["value"]; | |
| 287 } | |
| 288 } | |
| 289 | |
| 290 core.Map toJson() { | |
| 291 var _json = new core.Map(); | |
| 292 if (label != null) { | |
| 293 _json["label"] = label; | |
| 294 } | |
| 295 if (value != null) { | |
| 296 _json["value"] = value; | |
| 297 } | |
| 298 return _json; | |
| 299 } | |
| 300 } | |
| OLD | NEW |