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

/**
 * An application package which represents a particular version of an
 * application.
 *
 * @extends models['ProxyResource']
 */
class ApplicationPackage extends models['ProxyResource'] {
  /**
   * Create a ApplicationPackage.
   * @property {string} [state] The current state of the application package.
   * Possible values include: 'Pending', 'Active'
   * @property {string} [format] The format of the application package, if the
   * package is active.
   * @property {string} [storageUrl] The URL for the application package in
   * Azure Storage.
   * @property {date} [storageUrlExpiry] The UTC time at which the Azure
   * Storage URL will expire.
   * @property {date} [lastActivationTime] The time at which the package was
   * last activated, if the package is active.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ApplicationPackage
   *
   * @returns {object} metadata of ApplicationPackage
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationPackage',
      type: {
        name: 'Composite',
        className: 'ApplicationPackage',
        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'
            }
          },
          etag: {
            required: false,
            readOnly: true,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'properties.state',
            type: {
              name: 'Enum',
              allowedValues: [ 'Pending', 'Active' ]
            }
          },
          format: {
            required: false,
            readOnly: true,
            serializedName: 'properties.format',
            type: {
              name: 'String'
            }
          },
          storageUrl: {
            required: false,
            readOnly: true,
            serializedName: 'properties.storageUrl',
            type: {
              name: 'String'
            }
          },
          storageUrlExpiry: {
            required: false,
            readOnly: true,
            serializedName: 'properties.storageUrlExpiry',
            type: {
              name: 'DateTime'
            }
          },
          lastActivationTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.lastActivationTime',
            type: {
              name: 'DateTime'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationPackage;
