/*
 * 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 operation to register or provision an application type using
 * an application package uploaded to the Service Fabric image store.
 *
 * @extends models['ProvisionApplicationTypeDescriptionBase']
 */
class ProvisionApplicationTypeDescription extends models['ProvisionApplicationTypeDescriptionBase'] {
  /**
   * Create a ProvisionApplicationTypeDescription.
   * @property {string} applicationTypeBuildPath The relative path for the
   * application package in the image store specified during the prior upload
   * operation.
   * @property {string} [applicationPackageCleanupPolicy] The kind of action
   * that needs to be taken for cleaning up the application package after
   * successful provision. Possible values include: 'Invalid', 'Default',
   * 'Automatic', 'Manual'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ProvisionApplicationTypeDescription
   *
   * @returns {object} metadata of ProvisionApplicationTypeDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ImageStorePath',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'Kind',
          clientName: 'kind'
        },
        uberParent: 'ProvisionApplicationTypeDescriptionBase',
        className: 'ProvisionApplicationTypeDescription',
        modelProperties: {
          async: {
            required: true,
            serializedName: 'Async',
            type: {
              name: 'Boolean'
            }
          },
          kind: {
            required: true,
            serializedName: 'Kind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          applicationTypeBuildPath: {
            required: true,
            serializedName: 'ApplicationTypeBuildPath',
            type: {
              name: 'String'
            }
          },
          applicationPackageCleanupPolicy: {
            required: false,
            serializedName: 'ApplicationPackageCleanupPolicy',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ProvisionApplicationTypeDescription;
