/*
 * 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');

/**
 * A elastic pool operation.
 *
 * @extends models['ProxyResource']
 */
class ElasticPoolOperation extends models['ProxyResource'] {
  /**
   * Create a ElasticPoolOperation.
   * @property {string} [elasticPoolName] The name of the elastic pool the
   * operation is being performed on.
   * @property {string} [operation] The name of operation.
   * @property {string} [operationFriendlyName] The friendly name of operation.
   * @property {number} [percentComplete] The percentage of the operation
   * completed.
   * @property {string} [serverName] The name of the server.
   * @property {date} [startTime] The operation start time.
   * @property {string} [state] The operation state.
   * @property {number} [errorCode] The operation error code.
   * @property {string} [errorDescription] The operation error description.
   * @property {number} [errorSeverity] The operation error severity.
   * @property {boolean} [isUserError] Whether or not the error is a user
   * error.
   * @property {date} [estimatedCompletionTime] The estimated completion time
   * of the operation.
   * @property {string} [description] The operation description.
   * @property {boolean} [isCancellable] Whether the operation can be
   * cancelled.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ElasticPoolOperation
   *
   * @returns {object} metadata of ElasticPoolOperation
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ElasticPoolOperation',
      type: {
        name: 'Composite',
        className: 'ElasticPoolOperation',
        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'
            }
          },
          elasticPoolName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.elasticPoolName',
            type: {
              name: 'String'
            }
          },
          operation: {
            required: false,
            readOnly: true,
            serializedName: 'properties.operation',
            type: {
              name: 'String'
            }
          },
          operationFriendlyName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.operationFriendlyName',
            type: {
              name: 'String'
            }
          },
          percentComplete: {
            required: false,
            readOnly: true,
            serializedName: 'properties.percentComplete',
            type: {
              name: 'Number'
            }
          },
          serverName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.serverName',
            type: {
              name: 'String'
            }
          },
          startTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.startTime',
            type: {
              name: 'DateTime'
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          },
          errorCode: {
            required: false,
            readOnly: true,
            serializedName: 'properties.errorCode',
            type: {
              name: 'Number'
            }
          },
          errorDescription: {
            required: false,
            readOnly: true,
            serializedName: 'properties.errorDescription',
            type: {
              name: 'String'
            }
          },
          errorSeverity: {
            required: false,
            readOnly: true,
            serializedName: 'properties.errorSeverity',
            type: {
              name: 'Number'
            }
          },
          isUserError: {
            required: false,
            readOnly: true,
            serializedName: 'properties.isUserError',
            type: {
              name: 'Boolean'
            }
          },
          estimatedCompletionTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.estimatedCompletionTime',
            type: {
              name: 'DateTime'
            }
          },
          description: {
            required: false,
            readOnly: true,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          },
          isCancellable: {
            required: false,
            readOnly: true,
            serializedName: 'properties.isCancellable',
            type: {
              name: 'Boolean'
            }
          }
        }
      }
    };
  }
}

module.exports = ElasticPoolOperation;
