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

/**
 * @class
 * Initializes a new instance of the ApplicationUpgrade class.
 * @constructor
 * The upgrade of the application
 *
 * @member {string} [name]
 *
 * @member {string} [typeName]
 *
 * @member {string} [targetApplicationTypeVersion]
 *
 * @member {string} [upgradeDomains]
 *
 * @member {string} [upgradeState] Possible values include: 'Invalid',
 * 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending',
 * 'RollingForwardInProgress', 'RollingForwardCompleted'
 *
 * @member {string} [nextUpgradeDomain]
 *
 * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid',
 * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'
 *
 * @member {string} [upgradeDurationInMilliseconds]
 *
 * @member {string} [upgradeDomainDurationInMilliseconds]
 *
 * @member {string} [unhealthyEvaluations]
 *
 * @member {object} [currentUpgradeDomainProgress] The progress of the current
 * upgrade domain
 *
 * @member {string} [currentUpgradeDomainProgress.domainName]
 *
 * @member {string} [currentUpgradeDomainProgress.nodeUpgradeProgressList]
 *
 * @member {string} [startTimestampUtc]
 *
 * @member {string} [failureTimestampUtc]
 *
 * @member {string} [failureReason] Possible values include: 'Invalid',
 * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout',
 * 'OverallUpgradeTimeout'
 *
 * @member {object} [deployedApplicationHealthStates] The states of the
 * deployed application health
 *
 * @member {string} [deployedApplicationHealthStates.domainName]
 *
 * @member {string} [deployedApplicationHealthStates.nodeUpgradeProgressList]
 *
 */
class ApplicationUpgrade {
  constructor() {
  }

  /**
   * Defines the metadata of ApplicationUpgrade
   *
   * @returns {object} metadata of ApplicationUpgrade
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationUpgrade',
      type: {
        name: 'Composite',
        className: 'ApplicationUpgrade',
        modelProperties: {
          name: {
            required: false,
            serializedName: 'Name',
            type: {
              name: 'String'
            }
          },
          typeName: {
            required: false,
            serializedName: 'TypeName',
            type: {
              name: 'String'
            }
          },
          targetApplicationTypeVersion: {
            required: false,
            serializedName: 'TargetApplicationTypeVersion',
            type: {
              name: 'String'
            }
          },
          upgradeDomains: {
            required: false,
            serializedName: 'UpgradeDomains',
            type: {
              name: 'String'
            }
          },
          upgradeState: {
            required: false,
            serializedName: 'UpgradeState',
            type: {
              name: 'String'
            }
          },
          nextUpgradeDomain: {
            required: false,
            serializedName: 'NextUpgradeDomain',
            type: {
              name: 'String'
            }
          },
          rollingUpgradeMode: {
            required: false,
            serializedName: 'RollingUpgradeMode',
            type: {
              name: 'String'
            }
          },
          upgradeDurationInMilliseconds: {
            required: false,
            serializedName: 'UpgradeDurationInMilliseconds',
            type: {
              name: 'String'
            }
          },
          upgradeDomainDurationInMilliseconds: {
            required: false,
            serializedName: 'UpgradeDomainDurationInMilliseconds',
            type: {
              name: 'String'
            }
          },
          unhealthyEvaluations: {
            required: false,
            serializedName: 'UnhealthyEvaluations',
            type: {
              name: 'String'
            }
          },
          currentUpgradeDomainProgress: {
            required: false,
            serializedName: 'CurrentUpgradeDomainProgress',
            type: {
              name: 'Composite',
              className: 'ApplicationUpgradeCurrentUpgradeDomainProgress'
            }
          },
          startTimestampUtc: {
            required: false,
            serializedName: 'StartTimestampUtc',
            type: {
              name: 'String'
            }
          },
          failureTimestampUtc: {
            required: false,
            serializedName: 'FailureTimestampUtc',
            type: {
              name: 'String'
            }
          },
          failureReason: {
            required: false,
            serializedName: 'FailureReason',
            type: {
              name: 'String'
            }
          },
          deployedApplicationHealthStates: {
            required: false,
            serializedName: 'DeployedApplicationHealthStates',
            type: {
              name: 'Composite',
              className: 'ApplicationUpgradeDeployedApplicationHealthStates'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationUpgrade;
