microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
lib/app-center-node-client/src/analytics/analyticsClient.js
57lines · 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 | /* jshint latedef:false */ |
| 8 | /* jshint forin:false */ |
| 9 | /* jshint noempty:false */ |
| 10 | |
| 11 | 'use strict'; |
| 12 | |
| 13 | const msRest = require('ms-rest'); |
| 14 | const ServiceClient = msRest.ServiceClient; |
| 15 | |
| 16 | const models = require('./models'); |
| 17 | const operations = require('./operations'); |
| 18 | |
| 19 | |
| 20 | /** Class representing a AnalyticsClient. */ |
| 21 | class AnalyticsClient extends ServiceClient { |
| 22 | /** |
| 23 | * Create a AnalyticsClient. |
| 24 | * @param {credentials} credentials - Subscription credentials which uniquely identify client subscription. |
| 25 | * @param {string} [baseUri] - The base URI of the service. |
| 26 | * @param {object} [options] - The parameter options |
| 27 | * @param {Array} [options.filters] - Filters to be added to the request pipeline |
| 28 | * @param {object} [options.requestOptions] - Options for the underlying request object |
| 29 | * {@link https://github.com/request/request#requestoptions-callback Options doc} |
| 30 | * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy |
| 31 | */ |
| 32 | constructor(credentials, baseUri, options) { |
| 33 | if (credentials === null || credentials === undefined) { |
| 34 | throw new Error('\'credentials\' cannot be null.'); |
| 35 | } |
| 36 | |
| 37 | if (!options) options = {}; |
| 38 | |
| 39 | super(credentials, options); |
| 40 | |
| 41 | this.baseUri = baseUri; |
| 42 | if (!this.baseUri) { |
| 43 | this.baseUri = 'https://api.appcenter.ms/'; |
| 44 | } |
| 45 | this.credentials = credentials; |
| 46 | |
| 47 | let packageInfo = this.getPackageJsonInfo(__dirname); |
| 48 | this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); |
| 49 | this.analytics = new operations.Analytics(this); |
| 50 | this.analyticsCrashes = new operations.AnalyticsCrashes(this); |
| 51 | this.models = models; |
| 52 | msRest.addSerializationMixin(this); |
| 53 | } |
| 54 | |
| 55 | } |
| 56 | |
| 57 | module.exports = AnalyticsClient; |
| 58 | |