/*
 * 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.
 */

'use strict';

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

/**
 * Represents an instance of an Analysis Services resource.
 *
 * @extends models['Resource']
 */
class AnalysisServicesServer extends models['Resource'] {
  /**
   * Create a AnalysisServicesServer.
   * @member {object} [asAdministrators] A collection of AS server
   * administrators
   * @member {array} [asAdministrators.members] An array of administrator user
   * identities.
   * @member {string} [backupBlobContainerUri] The SAS container URI to the
   * backup container.
   * @member {object} [gatewayDetails] The gateway details configured for the
   * AS server.
   * @member {string} [gatewayDetails.gatewayResourceId] Gateway resource to be
   * associated with the server.
   * @member {string} [gatewayDetails.gatewayObjectId] Gateway object id from
   * in the DMTS cluster for the gateway resource.
   * @member {string} [gatewayDetails.dmtsClusterUri] Uri of the DMTS cluster.
   * @member {object} [ipV4FirewallSettings] The firewall settings for the AS
   * server.
   * @member {array} [ipV4FirewallSettings.firewallRules] An array of firewall
   * rules.
   * @member {string} [ipV4FirewallSettings.enablePowerBIService] The indicator
   * of enableing PBI service.
   * @member {string} [querypoolConnectionMode] How the read-write server's
   * participation in the query pool is controlled.<br/>It can have the
   * following values: <ul><li>readOnly - indicates that the read-write server
   * is intended not to participate in query operations</li><li>all - indicates
   * that the read-write server can participate in query
   * operations</li></ul>Specifying readOnly when capacity is 1 results in
   * error. Possible values include: 'All', 'ReadOnly'. Default value: 'All' .
   * @member {string} [state] The current state of Analysis Services resource.
   * The state is to indicate more states outside of resource provisioning.
   * Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused',
   * 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing',
   * 'Resuming', 'Preparing', 'Scaling'
   * @member {string} [provisioningState] The current deployment state of
   * Analysis Services resource. The provisioningState is to indicate states
   * for resource provisioning. Possible values include: 'Deleting',
   * 'Succeeded', 'Failed', 'Paused', 'Suspended', 'Provisioning', 'Updating',
   * 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling'
   * @member {string} [serverFullName] The full name of the Analysis Services
   * resource.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of AnalysisServicesServer
   *
   * @returns {object} metadata of AnalysisServicesServer
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AnalysisServicesServer',
      type: {
        name: 'Composite',
        className: 'AnalysisServicesServer',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          sku: {
            required: true,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'ResourceSku'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          asAdministrators: {
            required: false,
            serializedName: 'properties.asAdministrators',
            type: {
              name: 'Composite',
              className: 'ServerAdministrators'
            }
          },
          backupBlobContainerUri: {
            required: false,
            serializedName: 'properties.backupBlobContainerUri',
            type: {
              name: 'String'
            }
          },
          gatewayDetails: {
            required: false,
            serializedName: 'properties.gatewayDetails',
            type: {
              name: 'Composite',
              className: 'GatewayDetails'
            }
          },
          ipV4FirewallSettings: {
            required: false,
            serializedName: 'properties.ipV4FirewallSettings',
            type: {
              name: 'Composite',
              className: 'IPv4FirewallSettings'
            }
          },
          querypoolConnectionMode: {
            required: false,
            serializedName: 'properties.querypoolConnectionMode',
            defaultValue: 'All',
            type: {
              name: 'Enum',
              allowedValues: [ 'All', 'ReadOnly' ]
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          serverFullName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.serverFullName',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = AnalysisServicesServer;
