/*
 * 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 from an external store instead of a package uploaded
 * to the Service Fabric image store.
 *
 * @extends models['ProvisionApplicationTypeDescriptionBase']
 */
class ExternalStoreProvisionApplicationTypeDescription extends models['ProvisionApplicationTypeDescriptionBase'] {
  /**
   * Create a ExternalStoreProvisionApplicationTypeDescription.
   * @property {string} applicationPackageDownloadUri The path to the '.sfpkg'
   * application package from where the application package can be downloaded
   * using HTTP or HTTPS protocols. The application package can be stored in an
   * external store that provides GET operation to download the file. Supported
   * protocols are HTTP and HTTPS, and the path must allow READ access.
   * @property {string} applicationTypeName The application type name
   * represents the name of the application type found in the application
   * manifest.
   * @property {string} applicationTypeVersion The application type version
   * represents the version of the application type found in the application
   * manifest.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ExternalStoreProvisionApplicationTypeDescription
   *
   * @returns {object} metadata of ExternalStoreProvisionApplicationTypeDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ExternalStore',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'Kind',
          clientName: 'kind'
        },
        uberParent: 'ProvisionApplicationTypeDescriptionBase',
        className: 'ExternalStoreProvisionApplicationTypeDescription',
        modelProperties: {
          async: {
            required: true,
            serializedName: 'Async',
            type: {
              name: 'Boolean'
            }
          },
          kind: {
            required: true,
            serializedName: 'Kind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          applicationPackageDownloadUri: {
            required: true,
            serializedName: 'ApplicationPackageDownloadUri',
            type: {
              name: 'String'
            }
          },
          applicationTypeName: {
            required: true,
            serializedName: 'ApplicationTypeName',
            type: {
              name: 'String'
            }
          },
          applicationTypeVersion: {
            required: true,
            serializedName: 'ApplicationTypeVersion',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ExternalStoreProvisionApplicationTypeDescription;
