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

/**
 * Defines description for restarting a deployed code package on Service Fabric
 * node.
 *
 */
class RestartDeployedCodePackageDescription {
  /**
   * Create a RestartDeployedCodePackageDescription.
   * @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} codePackageName The name of the code package defined in
   * the service manifest.
   * @property {string} codePackageInstanceId The instance ID for currently
   * 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. If 0
   * is passed in as the code package instance ID, the API will restart the
   * code package with whatever instance ID it is currently running.
   * If an instance ID other than 0 is passed in, the API will restart the code
   * package only if the current Instance ID matches the passed in instance ID.
   * Note, passing in the exact instance ID (not 0) in the API is safer,
   * because if ensures at most one restart of the code package.
   */
  constructor() {
  }

  /**
   * Defines the metadata of RestartDeployedCodePackageDescription
   *
   * @returns {object} metadata of RestartDeployedCodePackageDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RestartDeployedCodePackageDescription',
      type: {
        name: 'Composite',
        className: 'RestartDeployedCodePackageDescription',
        modelProperties: {
          serviceManifestName: {
            required: true,
            serializedName: 'ServiceManifestName',
            type: {
              name: 'String'
            }
          },
          servicePackageActivationId: {
            required: false,
            serializedName: 'ServicePackageActivationId',
            type: {
              name: 'String'
            }
          },
          codePackageName: {
            required: true,
            serializedName: 'CodePackageName',
            type: {
              name: 'String'
            }
          },
          codePackageInstanceId: {
            required: true,
            serializedName: 'CodePackageInstanceId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = RestartDeployedCodePackageDescription;
