microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
lib/app-center-node-client/src/crash/operations/missingSymbolGroups.js
712lines · modecode
| 1 | /* |
| 2 | * Code generated by Microsoft (R) AutoRest Code Generator. |
| 3 | * Changes may cause incorrect behavior and will be lost if the code is |
| 4 | * regenerated. |
| 5 | */ |
| 6 | |
| 7 | 'use strict'; |
| 8 | |
| 9 | const msRest = require('ms-rest'); |
| 10 | const WebResource = msRest.WebResource; |
| 11 | |
| 12 | /** |
| 13 | * @summary Gets top N (ordered by crash count) of crash groups by missing |
| 14 | * symbol |
| 15 | * |
| 16 | * Gets top N (ordered by crash count) of crash groups by missing symbol |
| 17 | * |
| 18 | * @param {string} appName The name of the application |
| 19 | * |
| 20 | * @param {string} ownerName The name of the owner |
| 21 | * |
| 22 | * @param {number} top top N elements |
| 23 | * |
| 24 | * @param {object} [options] Optional Parameters. |
| 25 | * |
| 26 | * @param {string} [options.filter] query filter |
| 27 | * |
| 28 | * @param {object} [options.customHeaders] Headers that will be added to the |
| 29 | * request |
| 30 | * |
| 31 | * @param {function} callback - The callback. |
| 32 | * |
| 33 | * @returns {function} callback(err, result, request, response) |
| 34 | * |
| 35 | * {Error} err - The Error object if an error occurred, null otherwise. |
| 36 | * |
| 37 | * {object} [result] - The deserialized result object if an error did not occur. |
| 38 | * See {@link MissingSymbolCrashGroupsResponse} for more |
| 39 | * information. |
| 40 | * |
| 41 | * {object} [request] - The HTTP Request object if an error did not occur. |
| 42 | * |
| 43 | * {stream} [response] - The HTTP Response stream if an error did not occur. |
| 44 | */ |
| 45 | function _list(appName, ownerName, top, options, callback) { |
| 46 | /* jshint validthis: true */ |
| 47 | let client = this.client; |
| 48 | if(!callback && typeof options === 'function') { |
| 49 | callback = options; |
| 50 | options = null; |
| 51 | } |
| 52 | if (!callback) { |
| 53 | throw new Error('callback cannot be null.'); |
| 54 | } |
| 55 | let filter = (options && options.filter !== undefined) ? options.filter : undefined; |
| 56 | // Validate |
| 57 | try { |
| 58 | if (appName === null || appName === undefined || typeof appName.valueOf() !== 'string') { |
| 59 | throw new Error('appName cannot be null or undefined and it must be of type string.'); |
| 60 | } |
| 61 | if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { |
| 62 | throw new Error('filter must be of type string.'); |
| 63 | } |
| 64 | if (ownerName === null || ownerName === undefined || typeof ownerName.valueOf() !== 'string') { |
| 65 | throw new Error('ownerName cannot be null or undefined and it must be of type string.'); |
| 66 | } |
| 67 | if (top === null || top === undefined || typeof top !== 'number') { |
| 68 | throw new Error('top cannot be null or undefined and it must be of type number.'); |
| 69 | } |
| 70 | } catch (error) { |
| 71 | return callback(error); |
| 72 | } |
| 73 | |
| 74 | // Construct URL |
| 75 | let baseUrl = this.client.baseUri; |
| 76 | let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'v0.1/apps/{owner_name}/{app_name}/symbol_groups'; |
| 77 | requestUrl = requestUrl.replace('{app_name}', encodeURIComponent(appName)); |
| 78 | requestUrl = requestUrl.replace('{owner_name}', encodeURIComponent(ownerName)); |
| 79 | let queryParameters = []; |
| 80 | if (filter !== null && filter !== undefined) { |
| 81 | queryParameters.push('filter=' + encodeURIComponent(filter)); |
| 82 | } |
| 83 | queryParameters.push('top=' + encodeURIComponent(top.toString())); |
| 84 | if (queryParameters.length > 0) { |
| 85 | requestUrl += '?' + queryParameters.join('&'); |
| 86 | } |
| 87 | |
| 88 | // Create HTTP transport objects |
| 89 | let httpRequest = new WebResource(); |
| 90 | httpRequest.method = 'GET'; |
| 91 | httpRequest.url = requestUrl; |
| 92 | httpRequest.headers = {}; |
| 93 | // Set Headers |
| 94 | httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; |
| 95 | if(options) { |
| 96 | for(let headerName in options['customHeaders']) { |
| 97 | if (options['customHeaders'].hasOwnProperty(headerName)) { |
| 98 | httpRequest.headers[headerName] = options['customHeaders'][headerName]; |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | httpRequest.body = null; |
| 103 | // Send Request |
| 104 | return client.pipeline(httpRequest, (err, response, responseBody) => { |
| 105 | if (err) { |
| 106 | return callback(err); |
| 107 | } |
| 108 | let statusCode = response.statusCode; |
| 109 | if (statusCode !== 200) { |
| 110 | let error = new Error(responseBody); |
| 111 | error.statusCode = response.statusCode; |
| 112 | error.request = msRest.stripRequest(httpRequest); |
| 113 | error.response = msRest.stripResponse(response); |
| 114 | if (responseBody === '') responseBody = null; |
| 115 | let parsedErrorResponse; |
| 116 | try { |
| 117 | parsedErrorResponse = JSON.parse(responseBody); |
| 118 | if (parsedErrorResponse) { |
| 119 | let internalError = null; |
| 120 | if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; |
| 121 | error.code = internalError ? internalError.code : parsedErrorResponse.code; |
| 122 | error.message = internalError ? internalError.message : parsedErrorResponse.message; |
| 123 | } |
| 124 | } catch (defaultError) { |
| 125 | error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + |
| 126 | `- "${responseBody}" for the default response.`; |
| 127 | return callback(error); |
| 128 | } |
| 129 | return callback(error); |
| 130 | } |
| 131 | // Create Result |
| 132 | let result = null; |
| 133 | if (responseBody === '') responseBody = null; |
| 134 | // Deserialize Response |
| 135 | if (statusCode === 200) { |
| 136 | let parsedResponse = null; |
| 137 | try { |
| 138 | parsedResponse = JSON.parse(responseBody); |
| 139 | result = JSON.parse(responseBody); |
| 140 | if (parsedResponse !== null && parsedResponse !== undefined) { |
| 141 | let resultMapper = new client.models['MissingSymbolCrashGroupsResponse']().mapper(); |
| 142 | result = client.deserialize(resultMapper, parsedResponse, 'result'); |
| 143 | } |
| 144 | } catch (error) { |
| 145 | let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); |
| 146 | deserializationError.request = msRest.stripRequest(httpRequest); |
| 147 | deserializationError.response = msRest.stripResponse(response); |
| 148 | return callback(deserializationError); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | return callback(null, result, httpRequest, response); |
| 153 | }); |
| 154 | } |
| 155 | |
| 156 | /** |
| 157 | * @summary Gets missing symbol crash group by its id |
| 158 | * |
| 159 | * Gets missing symbol crash group by its id |
| 160 | * |
| 161 | * @param {string} appName The name of the application |
| 162 | * |
| 163 | * @param {string} ownerName The name of the owner |
| 164 | * |
| 165 | * @param {string} symbolGroupId missing symbol crash group id |
| 166 | * |
| 167 | * @param {object} [options] Optional Parameters. |
| 168 | * |
| 169 | * @param {object} [options.customHeaders] Headers that will be added to the |
| 170 | * request |
| 171 | * |
| 172 | * @param {function} callback - The callback. |
| 173 | * |
| 174 | * @returns {function} callback(err, result, request, response) |
| 175 | * |
| 176 | * {Error} err - The Error object if an error occurred, null otherwise. |
| 177 | * |
| 178 | * {object} [result] - The deserialized result object if an error did not occur. |
| 179 | * See {@link MissingSymbolCrashGroupsResponse} for more |
| 180 | * information. |
| 181 | * |
| 182 | * {object} [request] - The HTTP Request object if an error did not occur. |
| 183 | * |
| 184 | * {stream} [response] - The HTTP Response stream if an error did not occur. |
| 185 | */ |
| 186 | function _get(appName, ownerName, symbolGroupId, options, callback) { |
| 187 | /* jshint validthis: true */ |
| 188 | let client = this.client; |
| 189 | if(!callback && typeof options === 'function') { |
| 190 | callback = options; |
| 191 | options = null; |
| 192 | } |
| 193 | if (!callback) { |
| 194 | throw new Error('callback cannot be null.'); |
| 195 | } |
| 196 | // Validate |
| 197 | try { |
| 198 | if (appName === null || appName === undefined || typeof appName.valueOf() !== 'string') { |
| 199 | throw new Error('appName cannot be null or undefined and it must be of type string.'); |
| 200 | } |
| 201 | if (ownerName === null || ownerName === undefined || typeof ownerName.valueOf() !== 'string') { |
| 202 | throw new Error('ownerName cannot be null or undefined and it must be of type string.'); |
| 203 | } |
| 204 | if (symbolGroupId === null || symbolGroupId === undefined || typeof symbolGroupId.valueOf() !== 'string') { |
| 205 | throw new Error('symbolGroupId cannot be null or undefined and it must be of type string.'); |
| 206 | } |
| 207 | } catch (error) { |
| 208 | return callback(error); |
| 209 | } |
| 210 | |
| 211 | // Construct URL |
| 212 | let baseUrl = this.client.baseUri; |
| 213 | let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'v0.1/apps/{owner_name}/{app_name}/symbol_groups/{symbol_group_id}'; |
| 214 | requestUrl = requestUrl.replace('{app_name}', encodeURIComponent(appName)); |
| 215 | requestUrl = requestUrl.replace('{owner_name}', encodeURIComponent(ownerName)); |
| 216 | requestUrl = requestUrl.replace('{symbol_group_id}', encodeURIComponent(symbolGroupId)); |
| 217 | |
| 218 | // Create HTTP transport objects |
| 219 | let httpRequest = new WebResource(); |
| 220 | httpRequest.method = 'GET'; |
| 221 | httpRequest.url = requestUrl; |
| 222 | httpRequest.headers = {}; |
| 223 | // Set Headers |
| 224 | httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; |
| 225 | if(options) { |
| 226 | for(let headerName in options['customHeaders']) { |
| 227 | if (options['customHeaders'].hasOwnProperty(headerName)) { |
| 228 | httpRequest.headers[headerName] = options['customHeaders'][headerName]; |
| 229 | } |
| 230 | } |
| 231 | } |
| 232 | httpRequest.body = null; |
| 233 | // Send Request |
| 234 | return client.pipeline(httpRequest, (err, response, responseBody) => { |
| 235 | if (err) { |
| 236 | return callback(err); |
| 237 | } |
| 238 | let statusCode = response.statusCode; |
| 239 | if (statusCode !== 200) { |
| 240 | let error = new Error(responseBody); |
| 241 | error.statusCode = response.statusCode; |
| 242 | error.request = msRest.stripRequest(httpRequest); |
| 243 | error.response = msRest.stripResponse(response); |
| 244 | if (responseBody === '') responseBody = null; |
| 245 | let parsedErrorResponse; |
| 246 | try { |
| 247 | parsedErrorResponse = JSON.parse(responseBody); |
| 248 | if (parsedErrorResponse) { |
| 249 | let internalError = null; |
| 250 | if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; |
| 251 | error.code = internalError ? internalError.code : parsedErrorResponse.code; |
| 252 | error.message = internalError ? internalError.message : parsedErrorResponse.message; |
| 253 | } |
| 254 | } catch (defaultError) { |
| 255 | error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + |
| 256 | `- "${responseBody}" for the default response.`; |
| 257 | return callback(error); |
| 258 | } |
| 259 | return callback(error); |
| 260 | } |
| 261 | // Create Result |
| 262 | let result = null; |
| 263 | if (responseBody === '') responseBody = null; |
| 264 | // Deserialize Response |
| 265 | if (statusCode === 200) { |
| 266 | let parsedResponse = null; |
| 267 | try { |
| 268 | parsedResponse = JSON.parse(responseBody); |
| 269 | result = JSON.parse(responseBody); |
| 270 | if (parsedResponse !== null && parsedResponse !== undefined) { |
| 271 | let resultMapper = new client.models['MissingSymbolCrashGroupsResponse']().mapper(); |
| 272 | result = client.deserialize(resultMapper, parsedResponse, 'result'); |
| 273 | } |
| 274 | } catch (error) { |
| 275 | let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); |
| 276 | deserializationError.request = msRest.stripRequest(httpRequest); |
| 277 | deserializationError.response = msRest.stripResponse(response); |
| 278 | return callback(deserializationError); |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | return callback(null, result, httpRequest, response); |
| 283 | }); |
| 284 | } |
| 285 | |
| 286 | /** |
| 287 | * @summary Gets application level statistics for all missing symbol groups |
| 288 | * |
| 289 | * Gets application level statistics for all missing symbol groups |
| 290 | * |
| 291 | * @param {string} appName The name of the application |
| 292 | * |
| 293 | * @param {string} ownerName The name of the owner |
| 294 | * |
| 295 | * @param {object} [options] Optional Parameters. |
| 296 | * |
| 297 | * @param {object} [options.customHeaders] Headers that will be added to the |
| 298 | * request |
| 299 | * |
| 300 | * @param {function} callback - The callback. |
| 301 | * |
| 302 | * @returns {function} callback(err, result, request, response) |
| 303 | * |
| 304 | * {Error} err - The Error object if an error occurred, null otherwise. |
| 305 | * |
| 306 | * {object} [result] - The deserialized result object if an error did not occur. |
| 307 | * See {@link MissingSymbolCrashGroupsInfoResponse} for |
| 308 | * more information. |
| 309 | * |
| 310 | * {object} [request] - The HTTP Request object if an error did not occur. |
| 311 | * |
| 312 | * {stream} [response] - The HTTP Response stream if an error did not occur. |
| 313 | */ |
| 314 | function _info(appName, ownerName, options, callback) { |
| 315 | /* jshint validthis: true */ |
| 316 | let client = this.client; |
| 317 | if(!callback && typeof options === 'function') { |
| 318 | callback = options; |
| 319 | options = null; |
| 320 | } |
| 321 | if (!callback) { |
| 322 | throw new Error('callback cannot be null.'); |
| 323 | } |
| 324 | // Validate |
| 325 | try { |
| 326 | if (appName === null || appName === undefined || typeof appName.valueOf() !== 'string') { |
| 327 | throw new Error('appName cannot be null or undefined and it must be of type string.'); |
| 328 | } |
| 329 | if (ownerName === null || ownerName === undefined || typeof ownerName.valueOf() !== 'string') { |
| 330 | throw new Error('ownerName cannot be null or undefined and it must be of type string.'); |
| 331 | } |
| 332 | } catch (error) { |
| 333 | return callback(error); |
| 334 | } |
| 335 | |
| 336 | // Construct URL |
| 337 | let baseUrl = this.client.baseUri; |
| 338 | let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'v0.1/apps/{owner_name}/{app_name}/symbol_groups_info'; |
| 339 | requestUrl = requestUrl.replace('{app_name}', encodeURIComponent(appName)); |
| 340 | requestUrl = requestUrl.replace('{owner_name}', encodeURIComponent(ownerName)); |
| 341 | |
| 342 | // Create HTTP transport objects |
| 343 | let httpRequest = new WebResource(); |
| 344 | httpRequest.method = 'GET'; |
| 345 | httpRequest.url = requestUrl; |
| 346 | httpRequest.headers = {}; |
| 347 | // Set Headers |
| 348 | httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; |
| 349 | if(options) { |
| 350 | for(let headerName in options['customHeaders']) { |
| 351 | if (options['customHeaders'].hasOwnProperty(headerName)) { |
| 352 | httpRequest.headers[headerName] = options['customHeaders'][headerName]; |
| 353 | } |
| 354 | } |
| 355 | } |
| 356 | httpRequest.body = null; |
| 357 | // Send Request |
| 358 | return client.pipeline(httpRequest, (err, response, responseBody) => { |
| 359 | if (err) { |
| 360 | return callback(err); |
| 361 | } |
| 362 | let statusCode = response.statusCode; |
| 363 | if (statusCode !== 200) { |
| 364 | let error = new Error(responseBody); |
| 365 | error.statusCode = response.statusCode; |
| 366 | error.request = msRest.stripRequest(httpRequest); |
| 367 | error.response = msRest.stripResponse(response); |
| 368 | if (responseBody === '') responseBody = null; |
| 369 | let parsedErrorResponse; |
| 370 | try { |
| 371 | parsedErrorResponse = JSON.parse(responseBody); |
| 372 | if (parsedErrorResponse) { |
| 373 | let internalError = null; |
| 374 | if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; |
| 375 | error.code = internalError ? internalError.code : parsedErrorResponse.code; |
| 376 | error.message = internalError ? internalError.message : parsedErrorResponse.message; |
| 377 | } |
| 378 | } catch (defaultError) { |
| 379 | error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + |
| 380 | `- "${responseBody}" for the default response.`; |
| 381 | return callback(error); |
| 382 | } |
| 383 | return callback(error); |
| 384 | } |
| 385 | // Create Result |
| 386 | let result = null; |
| 387 | if (responseBody === '') responseBody = null; |
| 388 | // Deserialize Response |
| 389 | if (statusCode === 200) { |
| 390 | let parsedResponse = null; |
| 391 | try { |
| 392 | parsedResponse = JSON.parse(responseBody); |
| 393 | result = JSON.parse(responseBody); |
| 394 | if (parsedResponse !== null && parsedResponse !== undefined) { |
| 395 | let resultMapper = new client.models['MissingSymbolCrashGroupsInfoResponse']().mapper(); |
| 396 | result = client.deserialize(resultMapper, parsedResponse, 'result'); |
| 397 | } |
| 398 | } catch (error) { |
| 399 | let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); |
| 400 | deserializationError.request = msRest.stripRequest(httpRequest); |
| 401 | deserializationError.response = msRest.stripResponse(response); |
| 402 | return callback(deserializationError); |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | return callback(null, result, httpRequest, response); |
| 407 | }); |
| 408 | } |
| 409 | |
| 410 | /** Class representing a MissingSymbolGroups. */ |
| 411 | class MissingSymbolGroups { |
| 412 | /** |
| 413 | * Create a MissingSymbolGroups. |
| 414 | * @param {CrashClient} client Reference to the service client. |
| 415 | */ |
| 416 | constructor(client) { |
| 417 | this.client = client; |
| 418 | this._list = _list; |
| 419 | this._get = _get; |
| 420 | this._info = _info; |
| 421 | } |
| 422 | |
| 423 | /** |
| 424 | * @summary Gets top N (ordered by crash count) of crash groups by missing |
| 425 | * symbol |
| 426 | * |
| 427 | * Gets top N (ordered by crash count) of crash groups by missing symbol |
| 428 | * |
| 429 | * @param {string} appName The name of the application |
| 430 | * |
| 431 | * @param {string} ownerName The name of the owner |
| 432 | * |
| 433 | * @param {number} top top N elements |
| 434 | * |
| 435 | * @param {object} [options] Optional Parameters. |
| 436 | * |
| 437 | * @param {string} [options.filter] query filter |
| 438 | * |
| 439 | * @param {object} [options.customHeaders] Headers that will be added to the |
| 440 | * request |
| 441 | * |
| 442 | * @returns {Promise} A promise is returned |
| 443 | * |
| 444 | * @resolve {HttpOperationResponse<MissingSymbolCrashGroupsResponse>} - The deserialized result object. |
| 445 | * |
| 446 | * @reject {Error} - The error object. |
| 447 | */ |
| 448 | listWithHttpOperationResponse(appName, ownerName, top, options) { |
| 449 | let client = this.client; |
| 450 | let self = this; |
| 451 | return new Promise((resolve, reject) => { |
| 452 | self._list(appName, ownerName, top, options, (err, result, request, response) => { |
| 453 | let httpOperationResponse = new msRest.HttpOperationResponse(request, response); |
| 454 | httpOperationResponse.body = result; |
| 455 | if (err) { reject(err); } |
| 456 | else { resolve(httpOperationResponse); } |
| 457 | return; |
| 458 | }); |
| 459 | }); |
| 460 | } |
| 461 | |
| 462 | /** |
| 463 | * @summary Gets top N (ordered by crash count) of crash groups by missing |
| 464 | * symbol |
| 465 | * |
| 466 | * Gets top N (ordered by crash count) of crash groups by missing symbol |
| 467 | * |
| 468 | * @param {string} appName The name of the application |
| 469 | * |
| 470 | * @param {string} ownerName The name of the owner |
| 471 | * |
| 472 | * @param {number} top top N elements |
| 473 | * |
| 474 | * @param {object} [options] Optional Parameters. |
| 475 | * |
| 476 | * @param {string} [options.filter] query filter |
| 477 | * |
| 478 | * @param {object} [options.customHeaders] Headers that will be added to the |
| 479 | * request |
| 480 | * |
| 481 | * @param {function} [optionalCallback] - The optional callback. |
| 482 | * |
| 483 | * @returns {function|Promise} If a callback was passed as the last parameter |
| 484 | * then it returns the callback else returns a Promise. |
| 485 | * |
| 486 | * {Promise} A promise is returned |
| 487 | * |
| 488 | * @resolve {MissingSymbolCrashGroupsResponse} - The deserialized result object. |
| 489 | * |
| 490 | * @reject {Error} - The error object. |
| 491 | * |
| 492 | * {function} optionalCallback(err, result, request, response) |
| 493 | * |
| 494 | * {Error} err - The Error object if an error occurred, null otherwise. |
| 495 | * |
| 496 | * {object} [result] - The deserialized result object if an error did not occur. |
| 497 | * See {@link MissingSymbolCrashGroupsResponse} for more |
| 498 | * information. |
| 499 | * |
| 500 | * {object} [request] - The HTTP Request object if an error did not occur. |
| 501 | * |
| 502 | * {stream} [response] - The HTTP Response stream if an error did not occur. |
| 503 | */ |
| 504 | list(appName, ownerName, top, options, optionalCallback) { |
| 505 | let client = this.client; |
| 506 | let self = this; |
| 507 | if (!optionalCallback && typeof options === 'function') { |
| 508 | optionalCallback = options; |
| 509 | options = null; |
| 510 | } |
| 511 | if (!optionalCallback) { |
| 512 | return new Promise((resolve, reject) => { |
| 513 | self._list(appName, ownerName, top, options, (err, result, request, response) => { |
| 514 | if (err) { reject(err); } |
| 515 | else { resolve(result); } |
| 516 | return; |
| 517 | }); |
| 518 | }); |
| 519 | } else { |
| 520 | return self._list(appName, ownerName, top, options, optionalCallback); |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | /** |
| 525 | * @summary Gets missing symbol crash group by its id |
| 526 | * |
| 527 | * Gets missing symbol crash group by its id |
| 528 | * |
| 529 | * @param {string} appName The name of the application |
| 530 | * |
| 531 | * @param {string} ownerName The name of the owner |
| 532 | * |
| 533 | * @param {string} symbolGroupId missing symbol crash group id |
| 534 | * |
| 535 | * @param {object} [options] Optional Parameters. |
| 536 | * |
| 537 | * @param {object} [options.customHeaders] Headers that will be added to the |
| 538 | * request |
| 539 | * |
| 540 | * @returns {Promise} A promise is returned |
| 541 | * |
| 542 | * @resolve {HttpOperationResponse<MissingSymbolCrashGroupsResponse>} - The deserialized result object. |
| 543 | * |
| 544 | * @reject {Error} - The error object. |
| 545 | */ |
| 546 | getWithHttpOperationResponse(appName, ownerName, symbolGroupId, options) { |
| 547 | let client = this.client; |
| 548 | let self = this; |
| 549 | return new Promise((resolve, reject) => { |
| 550 | self._get(appName, ownerName, symbolGroupId, options, (err, result, request, response) => { |
| 551 | let httpOperationResponse = new msRest.HttpOperationResponse(request, response); |
| 552 | httpOperationResponse.body = result; |
| 553 | if (err) { reject(err); } |
| 554 | else { resolve(httpOperationResponse); } |
| 555 | return; |
| 556 | }); |
| 557 | }); |
| 558 | } |
| 559 | |
| 560 | /** |
| 561 | * @summary Gets missing symbol crash group by its id |
| 562 | * |
| 563 | * Gets missing symbol crash group by its id |
| 564 | * |
| 565 | * @param {string} appName The name of the application |
| 566 | * |
| 567 | * @param {string} ownerName The name of the owner |
| 568 | * |
| 569 | * @param {string} symbolGroupId missing symbol crash group id |
| 570 | * |
| 571 | * @param {object} [options] Optional Parameters. |
| 572 | * |
| 573 | * @param {object} [options.customHeaders] Headers that will be added to the |
| 574 | * request |
| 575 | * |
| 576 | * @param {function} [optionalCallback] - The optional callback. |
| 577 | * |
| 578 | * @returns {function|Promise} If a callback was passed as the last parameter |
| 579 | * then it returns the callback else returns a Promise. |
| 580 | * |
| 581 | * {Promise} A promise is returned |
| 582 | * |
| 583 | * @resolve {MissingSymbolCrashGroupsResponse} - The deserialized result object. |
| 584 | * |
| 585 | * @reject {Error} - The error object. |
| 586 | * |
| 587 | * {function} optionalCallback(err, result, request, response) |
| 588 | * |
| 589 | * {Error} err - The Error object if an error occurred, null otherwise. |
| 590 | * |
| 591 | * {object} [result] - The deserialized result object if an error did not occur. |
| 592 | * See {@link MissingSymbolCrashGroupsResponse} for more |
| 593 | * information. |
| 594 | * |
| 595 | * {object} [request] - The HTTP Request object if an error did not occur. |
| 596 | * |
| 597 | * {stream} [response] - The HTTP Response stream if an error did not occur. |
| 598 | */ |
| 599 | get(appName, ownerName, symbolGroupId, options, optionalCallback) { |
| 600 | let client = this.client; |
| 601 | let self = this; |
| 602 | if (!optionalCallback && typeof options === 'function') { |
| 603 | optionalCallback = options; |
| 604 | options = null; |
| 605 | } |
| 606 | if (!optionalCallback) { |
| 607 | return new Promise((resolve, reject) => { |
| 608 | self._get(appName, ownerName, symbolGroupId, options, (err, result, request, response) => { |
| 609 | if (err) { reject(err); } |
| 610 | else { resolve(result); } |
| 611 | return; |
| 612 | }); |
| 613 | }); |
| 614 | } else { |
| 615 | return self._get(appName, ownerName, symbolGroupId, options, optionalCallback); |
| 616 | } |
| 617 | } |
| 618 | |
| 619 | /** |
| 620 | * @summary Gets application level statistics for all missing symbol groups |
| 621 | * |
| 622 | * Gets application level statistics for all missing symbol groups |
| 623 | * |
| 624 | * @param {string} appName The name of the application |
| 625 | * |
| 626 | * @param {string} ownerName The name of the owner |
| 627 | * |
| 628 | * @param {object} [options] Optional Parameters. |
| 629 | * |
| 630 | * @param {object} [options.customHeaders] Headers that will be added to the |
| 631 | * request |
| 632 | * |
| 633 | * @returns {Promise} A promise is returned |
| 634 | * |
| 635 | * @resolve {HttpOperationResponse<MissingSymbolCrashGroupsInfoResponse>} - The deserialized result object. |
| 636 | * |
| 637 | * @reject {Error} - The error object. |
| 638 | */ |
| 639 | infoWithHttpOperationResponse(appName, ownerName, options) { |
| 640 | let client = this.client; |
| 641 | let self = this; |
| 642 | return new Promise((resolve, reject) => { |
| 643 | self._info(appName, ownerName, options, (err, result, request, response) => { |
| 644 | let httpOperationResponse = new msRest.HttpOperationResponse(request, response); |
| 645 | httpOperationResponse.body = result; |
| 646 | if (err) { reject(err); } |
| 647 | else { resolve(httpOperationResponse); } |
| 648 | return; |
| 649 | }); |
| 650 | }); |
| 651 | } |
| 652 | |
| 653 | /** |
| 654 | * @summary Gets application level statistics for all missing symbol groups |
| 655 | * |
| 656 | * Gets application level statistics for all missing symbol groups |
| 657 | * |
| 658 | * @param {string} appName The name of the application |
| 659 | * |
| 660 | * @param {string} ownerName The name of the owner |
| 661 | * |
| 662 | * @param {object} [options] Optional Parameters. |
| 663 | * |
| 664 | * @param {object} [options.customHeaders] Headers that will be added to the |
| 665 | * request |
| 666 | * |
| 667 | * @param {function} [optionalCallback] - The optional callback. |
| 668 | * |
| 669 | * @returns {function|Promise} If a callback was passed as the last parameter |
| 670 | * then it returns the callback else returns a Promise. |
| 671 | * |
| 672 | * {Promise} A promise is returned |
| 673 | * |
| 674 | * @resolve {MissingSymbolCrashGroupsInfoResponse} - The deserialized result object. |
| 675 | * |
| 676 | * @reject {Error} - The error object. |
| 677 | * |
| 678 | * {function} optionalCallback(err, result, request, response) |
| 679 | * |
| 680 | * {Error} err - The Error object if an error occurred, null otherwise. |
| 681 | * |
| 682 | * {object} [result] - The deserialized result object if an error did not occur. |
| 683 | * See {@link MissingSymbolCrashGroupsInfoResponse} for |
| 684 | * more information. |
| 685 | * |
| 686 | * {object} [request] - The HTTP Request object if an error did not occur. |
| 687 | * |
| 688 | * {stream} [response] - The HTTP Response stream if an error did not occur. |
| 689 | */ |
| 690 | info(appName, ownerName, options, optionalCallback) { |
| 691 | let client = this.client; |
| 692 | let self = this; |
| 693 | if (!optionalCallback && typeof options === 'function') { |
| 694 | optionalCallback = options; |
| 695 | options = null; |
| 696 | } |
| 697 | if (!optionalCallback) { |
| 698 | return new Promise((resolve, reject) => { |
| 699 | self._info(appName, ownerName, options, (err, result, request, response) => { |
| 700 | if (err) { reject(err); } |
| 701 | else { resolve(result); } |
| 702 | return; |
| 703 | }); |
| 704 | }); |
| 705 | } else { |
| 706 | return self._info(appName, ownerName, options, optionalCallback); |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | } |
| 711 | |
| 712 | module.exports = MissingSymbolGroups; |
| 713 | |