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

/**
 * Information about code package deployed on a Service Fabric node.
 *
 */
class DeployedCodePackageInfo {
  /**
   * Create a DeployedCodePackageInfo.
   * @property {string} [name] The name of the code package.
   * @property {string} [version] The version of the code package specified in
   * service manifest.
   * @property {string} [serviceManifestName] The name of service manifest that
   * specified this code package.
   * @property {string} [servicePackageActivationId] The ActivationId of a
   * deployed service package. If ServicePackageActivationMode specified at the
   * time of creating the service
   * is 'SharedProcess' (or if it is not specified, in which case it defaults
   * to 'SharedProcess'), then value of ServicePackageActivationId
   * is always an empty string.
   * @property {string} [hostType] Specifies the type of host for main entry
   * point of a code package as specified in service manifest. Possible values
   * include: 'Invalid', 'ExeHost', 'ContainerHost'
   * @property {string} [hostIsolationMode] Specifies the isolation mode of
   * main entry point of a code package when it's host type is ContainerHost.
   * This is specified as part of container host policies in application
   * manifest while importing service manifest. Possible values include:
   * 'None', 'Process', 'HyperV'
   * @property {string} [status] Specifies the status of a deployed application
   * or service package on a Service Fabric node. Possible values include:
   * 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading',
   * 'Deactivating'
   * @property {string} [runFrequencyInterval] The interval at which code
   * package is run. This is used for periodic code package.
   * @property {object} [setupEntryPoint] Information about setup or main entry
   * point of a code package deployed on a Service Fabric node.
   * @property {string} [setupEntryPoint.entryPointLocation] The location of
   * entry point executable on the node.
   * @property {string} [setupEntryPoint.processId] The process ID of the entry
   * point.
   * @property {string} [setupEntryPoint.runAsUserName] The user name under
   * which entry point executable is run on the node.
   * @property {object} [setupEntryPoint.codePackageEntryPointStatistics]
   * Statistics about setup or main entry point  of a code package deployed on
   * a Service Fabric node.
   * @property {string}
   * [setupEntryPoint.codePackageEntryPointStatistics.lastExitCode] The last
   * exit code of the entry point.
   * @property {date}
   * [setupEntryPoint.codePackageEntryPointStatistics.lastActivationTime] The
   * last time (in UTC) when Service Fabric attempted to run the entry point.
   * @property {date}
   * [setupEntryPoint.codePackageEntryPointStatistics.lastExitTime] The last
   * time (in UTC) when the entry point finished running.
   * @property {date}
   * [setupEntryPoint.codePackageEntryPointStatistics.lastSuccessfulActivationTime]
   * The last time (in UTC) when the entry point ran successfully.
   * @property {date}
   * [setupEntryPoint.codePackageEntryPointStatistics.lastSuccessfulExitTime]
   * The last time (in UTC) when the entry point finished running gracefully.
   * @property {string}
   * [setupEntryPoint.codePackageEntryPointStatistics.activationCount] Number
   * of times the entry point has run.
   * @property {string}
   * [setupEntryPoint.codePackageEntryPointStatistics.activationFailureCount]
   * Number of times the entry point failed to run.
   * @property {string}
   * [setupEntryPoint.codePackageEntryPointStatistics.continuousActivationFailureCount]
   * Number of times the entry point continuously failed to run.
   * @property {string}
   * [setupEntryPoint.codePackageEntryPointStatistics.exitCount] Number of
   * times the entry point finished running.
   * @property {string}
   * [setupEntryPoint.codePackageEntryPointStatistics.exitFailureCount] Number
   * of times the entry point failed to exit gracefully.
   * @property {string}
   * [setupEntryPoint.codePackageEntryPointStatistics.continuousExitFailureCount]
   * Number of times the entry point continuously failed to exit gracefully.
   * @property {string} [setupEntryPoint.status] Specifies the status of the
   * code package entry point deployed on a Service Fabric node. Possible
   * values include: 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping',
   * 'Stopped'
   * @property {date} [setupEntryPoint.nextActivationTime] The time (in UTC)
   * when the entry point executable will be run next.
   * @property {string} [setupEntryPoint.instanceId] The instance ID for
   * current running entry point. For a code package setup entry point (if
   * specified) runs first and after it finishes main entry point is started.
   * Each time entry point executable is run, its instance id will change.
   * @property {object} [mainEntryPoint] Information about setup or main entry
   * point of a code package deployed on a Service Fabric node.
   * @property {string} [mainEntryPoint.entryPointLocation] The location of
   * entry point executable on the node.
   * @property {string} [mainEntryPoint.processId] The process ID of the entry
   * point.
   * @property {string} [mainEntryPoint.runAsUserName] The user name under
   * which entry point executable is run on the node.
   * @property {object} [mainEntryPoint.codePackageEntryPointStatistics]
   * Statistics about setup or main entry point  of a code package deployed on
   * a Service Fabric node.
   * @property {string}
   * [mainEntryPoint.codePackageEntryPointStatistics.lastExitCode] The last
   * exit code of the entry point.
   * @property {date}
   * [mainEntryPoint.codePackageEntryPointStatistics.lastActivationTime] The
   * last time (in UTC) when Service Fabric attempted to run the entry point.
   * @property {date}
   * [mainEntryPoint.codePackageEntryPointStatistics.lastExitTime] The last
   * time (in UTC) when the entry point finished running.
   * @property {date}
   * [mainEntryPoint.codePackageEntryPointStatistics.lastSuccessfulActivationTime]
   * The last time (in UTC) when the entry point ran successfully.
   * @property {date}
   * [mainEntryPoint.codePackageEntryPointStatistics.lastSuccessfulExitTime]
   * The last time (in UTC) when the entry point finished running gracefully.
   * @property {string}
   * [mainEntryPoint.codePackageEntryPointStatistics.activationCount] Number of
   * times the entry point has run.
   * @property {string}
   * [mainEntryPoint.codePackageEntryPointStatistics.activationFailureCount]
   * Number of times the entry point failed to run.
   * @property {string}
   * [mainEntryPoint.codePackageEntryPointStatistics.continuousActivationFailureCount]
   * Number of times the entry point continuously failed to run.
   * @property {string}
   * [mainEntryPoint.codePackageEntryPointStatistics.exitCount] Number of times
   * the entry point finished running.
   * @property {string}
   * [mainEntryPoint.codePackageEntryPointStatistics.exitFailureCount] Number
   * of times the entry point failed to exit gracefully.
   * @property {string}
   * [mainEntryPoint.codePackageEntryPointStatistics.continuousExitFailureCount]
   * Number of times the entry point continuously failed to exit gracefully.
   * @property {string} [mainEntryPoint.status] Specifies the status of the
   * code package entry point deployed on a Service Fabric node. Possible
   * values include: 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping',
   * 'Stopped'
   * @property {date} [mainEntryPoint.nextActivationTime] The time (in UTC)
   * when the entry point executable will be run next.
   * @property {string} [mainEntryPoint.instanceId] The instance ID for current
   * running entry point. For a code package setup entry point (if specified)
   * runs first and after it finishes main entry point is started. Each time
   * entry point executable is run, its instance id will change.
   */
  constructor() {
  }

  /**
   * Defines the metadata of DeployedCodePackageInfo
   *
   * @returns {object} metadata of DeployedCodePackageInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DeployedCodePackageInfo',
      type: {
        name: 'Composite',
        className: 'DeployedCodePackageInfo',
        modelProperties: {
          name: {
            required: false,
            serializedName: 'Name',
            type: {
              name: 'String'
            }
          },
          version: {
            required: false,
            serializedName: 'Version',
            type: {
              name: 'String'
            }
          },
          serviceManifestName: {
            required: false,
            serializedName: 'ServiceManifestName',
            type: {
              name: 'String'
            }
          },
          servicePackageActivationId: {
            required: false,
            serializedName: 'ServicePackageActivationId',
            type: {
              name: 'String'
            }
          },
          hostType: {
            required: false,
            serializedName: 'HostType',
            type: {
              name: 'String'
            }
          },
          hostIsolationMode: {
            required: false,
            serializedName: 'HostIsolationMode',
            type: {
              name: 'String'
            }
          },
          status: {
            required: false,
            serializedName: 'Status',
            type: {
              name: 'String'
            }
          },
          runFrequencyInterval: {
            required: false,
            serializedName: 'RunFrequencyInterval',
            type: {
              name: 'String'
            }
          },
          setupEntryPoint: {
            required: false,
            serializedName: 'SetupEntryPoint',
            type: {
              name: 'Composite',
              className: 'CodePackageEntryPoint'
            }
          },
          mainEntryPoint: {
            required: false,
            serializedName: 'MainEntryPoint',
            type: {
              name: 'Composite',
              className: 'CodePackageEntryPoint'
            }
          }
        }
      }
    };
  }
}

module.exports = DeployedCodePackageInfo;
