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

/**
 * Derived from PropertyBatchInfo. Represents the property batch failing.
 * Contains information about the specific batch failure.
 *
 * @extends models['PropertyBatchInfo']
 */
class FailedPropertyBatchInfo extends models['PropertyBatchInfo'] {
  /**
   * Create a FailedPropertyBatchInfo.
   * @property {string} [errorMessage] The error message of the failed
   * operation. Describes the exception thrown due to the first unsuccessful
   * operation in the property batch.
   * @property {number} [operationIndex] The index of the unsuccessful
   * operation in the property batch.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of FailedPropertyBatchInfo
   *
   * @returns {object} metadata of FailedPropertyBatchInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Failed',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'Kind',
          clientName: 'kind'
        },
        uberParent: 'PropertyBatchInfo',
        className: 'FailedPropertyBatchInfo',
        modelProperties: {
          kind: {
            required: true,
            serializedName: 'Kind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          errorMessage: {
            required: false,
            serializedName: 'ErrorMessage',
            type: {
              name: 'String'
            }
          },
          operationIndex: {
            required: false,
            serializedName: 'OperationIndex',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = FailedPropertyBatchInfo;
