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

/**
 * Describes the named partition scheme of the service.
 *
 * @extends models['PartitionSchemeDescription']
 */
class NamedPartitionSchemeDescription extends models['PartitionSchemeDescription'] {
  /**
   * Create a NamedPartitionSchemeDescription.
   * @property {number} count The number of partitions.
   * @property {array} names Array of size specified by the ‘Count’ parameter,
   * for the names of the partitions.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of NamedPartitionSchemeDescription
   *
   * @returns {object} metadata of NamedPartitionSchemeDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Named',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'PartitionScheme',
          clientName: 'partitionScheme'
        },
        uberParent: 'PartitionSchemeDescription',
        className: 'NamedPartitionSchemeDescription',
        modelProperties: {
          partitionScheme: {
            required: true,
            serializedName: 'PartitionScheme',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          count: {
            required: true,
            serializedName: 'Count',
            type: {
              name: 'Number'
            }
          },
          names: {
            required: true,
            serializedName: 'Names',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = NamedPartitionSchemeDescription;
