/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * 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 msRest = require('ms-rest');
const msRestAzure = require('ms-rest-azure');
const ServiceClient = msRestAzure.AzureServiceClient;

const models = require('./models');
const operations = require('./operations');


/** Class representing a AutomationClient. */
class AutomationClient extends ServiceClient {
  /**
   * Create a AutomationClient.
   * @param {credentials} credentials - Credentials needed for the client to connect to Azure.
   * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
   * @param {countType} countType1 - The type of counts to retrieve. Possible values include: 'status', 'nodeconfiguration'
   * @param {string} [baseUri] - The base URI of the service.
   * @param {object} [options] - The parameter options
   * @param {Array} [options.filters] - Filters to be added to the request pipeline
   * @param {object} [options.requestOptions] - Options for the underlying request object
   * {@link https://github.com/request/request#requestoptions-callback Options doc}
   * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
   * @param {string} [options.acceptLanguage] - The preferred language for the response.
   * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30.
   * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
   */
  constructor(credentials, subscriptionId, countType1, baseUri, options) {
    if (credentials === null || credentials === undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }
    if (subscriptionId === null || subscriptionId === undefined) {
      throw new Error('\'subscriptionId\' cannot be null.');
    }
    if (countType1 === null || countType1 === undefined) {
      throw new Error('\'countType1\' cannot be null.');
    }

    if (!options) options = {};

    super(credentials, options);

    this.acceptLanguage = 'en-US';
    this.longRunningOperationRetryTimeout = 30;
    this.generateClientRequestId = true;
    this.baseUri = baseUri;
    if (!this.baseUri) {
      this.baseUri = 'https://management.azure.com';
    }
    this.credentials = credentials;
    this.subscriptionId = subscriptionId;
    this.countType1 = countType1;

    let packageInfo = this.getPackageJsonInfo(__dirname);
    this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`);
    if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
      this.acceptLanguage = options.acceptLanguage;
    }
    if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
      this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
    }
    if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) {
      this.generateClientRequestId = options.generateClientRequestId;
    }
    this.automationAccountOperations = new operations.AutomationAccountOperations(this);
    this.operations = new operations.Operations(this);
    this.statisticsOperations = new operations.StatisticsOperations(this);
    this.usages = new operations.Usages(this);
    this.keys = new operations.Keys(this);
    this.certificateOperations = new operations.CertificateOperations(this);
    this.connectionOperations = new operations.ConnectionOperations(this);
    this.connectionTypeOperations = new operations.ConnectionTypeOperations(this);
    this.credentialOperations = new operations.CredentialOperations(this);
    this.dscConfigurationOperations = new operations.DscConfigurationOperations(this);
    this.hybridRunbookWorkerGroupOperations = new operations.HybridRunbookWorkerGroupOperations(this);
    this.jobScheduleOperations = new operations.JobScheduleOperations(this);
    this.linkedWorkspaceOperations = new operations.LinkedWorkspaceOperations(this);
    this.activityOperations = new operations.ActivityOperations(this);
    this.moduleOperations = new operations.ModuleOperations(this);
    this.objectDataTypes = new operations.ObjectDataTypes(this);
    this.fields = new operations.Fields(this);
    this.scheduleOperations = new operations.ScheduleOperations(this);
    this.variableOperations = new operations.VariableOperations(this);
    this.webhookOperations = new operations.WebhookOperations(this);
    this.watcherOperations = new operations.WatcherOperations(this);
    this.softwareUpdateConfigurations = new operations.SoftwareUpdateConfigurations(this);
    this.softwareUpdateConfigurationRuns = new operations.SoftwareUpdateConfigurationRuns(this);
    this.softwareUpdateConfigurationMachineRuns = new operations.SoftwareUpdateConfigurationMachineRuns(this);
    this.sourceControlOperations = new operations.SourceControlOperations(this);
    this.sourceControlSyncJobOperations = new operations.SourceControlSyncJobOperations(this);
    this.sourceControlSyncJobStreams = new operations.SourceControlSyncJobStreams(this);
    this.jobOperations = new operations.JobOperations(this);
    this.jobStreamOperations = new operations.JobStreamOperations(this);
    this.agentRegistrationInformation = new operations.AgentRegistrationInformation(this);
    this.dscNodeOperations = new operations.DscNodeOperations(this);
    this.nodeReports = new operations.NodeReports(this);
    this.dscCompilationJobOperations = new operations.DscCompilationJobOperations(this);
    this.dscCompilationJobStream = new operations.DscCompilationJobStream(this);
    this.dscNodeConfigurationOperations = new operations.DscNodeConfigurationOperations(this);
    this.nodeCountInformation = new operations.NodeCountInformation(this);
    this.runbookDraftOperations = new operations.RunbookDraftOperations(this);
    this.runbookOperations = new operations.RunbookOperations(this);
    this.testJobStreams = new operations.TestJobStreams(this);
    this.testJobOperations = new operations.TestJobOperations(this);
    this.python2Package = new operations.Python2Package(this);
    this.models = models;
    msRest.addSerializationMixin(this);
  }

}

module.exports = AutomationClient;
module.exports['default'] = AutomationClient;
module.exports.AutomationClient = AutomationClient;
module.exports.AutomationModels = models;
