/*
 * Code generated by Microsoft (R) SwaggerTools.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

/* jshint latedef:false */
/* jshint forin:false */
/* jshint noempty:false */

'use strict';

const AppCenterClientCredentials = require('./appCenterClientCredentials');
const Account = require('./account/accountClient');
const Codepush = require('./codepush/codepushClient');


class AppCenterClient {
    constructor(credentials, baseUrl = null, options = {}) {
        let credentialsObject;
        if (typeof(credentials) === 'string') {
            credentialsObject = new AppCenterClientCredentials(credentials);
        } else if (credentials instanceof AppCenterClientCredentials) {
            credentialsObject = credentials;
        } else {
            throw new Error('Credentials is not a token or credentials object');
        }

        this.account = new Account(credentialsObject, baseUrl, options);

        this.codepush = new Codepush(credentialsObject, baseUrl, options);

    }
}

module.exports = AppCenterClient;