microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
lib/app-center-node-client/src/appCenterClient.js
36lines · modecode
| 1 | /* |
| 2 | * Code generated by Microsoft (R) SwaggerTools. |
| 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 AppCenterClientCredentials = require('./appCenterClientCredentials'); |
| 14 | const Account = require('./account/accountClient'); |
| 15 | const Codepush = require('./codepush/codepushClient'); |
| 16 | |
| 17 | |
| 18 | class AppCenterClient { |
| 19 | constructor(credentials, baseUrl = null, options = {}) { |
| 20 | let credentialsObject; |
| 21 | if (typeof(credentials) === 'string') { |
| 22 | credentialsObject = new AppCenterClientCredentials(credentials); |
| 23 | } else if (credentials instanceof AppCenterClientCredentials) { |
| 24 | credentialsObject = credentials; |
| 25 | } else { |
| 26 | throw new Error('Credentials is not a token or credentials object'); |
| 27 | } |
| 28 | |
| 29 | this.account = new Account(credentialsObject, baseUrl, options); |
| 30 | |
| 31 | this.codepush = new Codepush(credentialsObject, baseUrl, options); |
| 32 | |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | module.exports = AppCenterClient; |