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

/**
 * Container Exited event.
 *
 * @extends models['ApplicationEvent']
 */
class ApplicationContainerInstanceExitedEvent extends models['ApplicationEvent'] {
  /**
   * Create a ApplicationContainerInstanceExitedEvent.
   * @property {string} serviceName Name of Service.
   * @property {string} servicePackageName Name of Service package.
   * @property {string} servicePackageActivationId Activation Id of Service
   * package.
   * @property {boolean} isExclusive Indicates IsExclusive flag.
   * @property {string} codePackageName Name of Code package.
   * @property {string} entryPointType Type of EntryPoint.
   * @property {string} imageName Name of Container image.
   * @property {string} containerName Name of Container.
   * @property {string} hostId Host Id.
   * @property {number} exitCode Exit code of process.
   * @property {boolean} unexpectedTermination Indicates if termination is
   * unexpected.
   * @property {date} startTime Start time of process.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ApplicationContainerInstanceExitedEvent
   *
   * @returns {object} metadata of ApplicationContainerInstanceExitedEvent
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationContainerInstanceExited',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'Kind',
          clientName: 'kind'
        },
        uberParent: 'FabricEvent',
        className: 'ApplicationContainerInstanceExitedEvent',
        modelProperties: {
          eventInstanceId: {
            required: true,
            serializedName: 'EventInstanceId',
            type: {
              name: 'String'
            }
          },
          category: {
            required: false,
            serializedName: 'Category',
            type: {
              name: 'String'
            }
          },
          timeStamp: {
            required: true,
            serializedName: 'TimeStamp',
            type: {
              name: 'DateTime'
            }
          },
          hasCorrelatedEvents: {
            required: false,
            serializedName: 'HasCorrelatedEvents',
            type: {
              name: 'Boolean'
            }
          },
          kind: {
            required: true,
            serializedName: 'Kind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          applicationId: {
            required: true,
            serializedName: 'ApplicationId',
            type: {
              name: 'String'
            }
          },
          serviceName: {
            required: true,
            serializedName: 'ServiceName',
            type: {
              name: 'String'
            }
          },
          servicePackageName: {
            required: true,
            serializedName: 'ServicePackageName',
            type: {
              name: 'String'
            }
          },
          servicePackageActivationId: {
            required: true,
            serializedName: 'ServicePackageActivationId',
            type: {
              name: 'String'
            }
          },
          isExclusive: {
            required: true,
            serializedName: 'IsExclusive',
            type: {
              name: 'Boolean'
            }
          },
          codePackageName: {
            required: true,
            serializedName: 'CodePackageName',
            type: {
              name: 'String'
            }
          },
          entryPointType: {
            required: true,
            serializedName: 'EntryPointType',
            type: {
              name: 'String'
            }
          },
          imageName: {
            required: true,
            serializedName: 'ImageName',
            type: {
              name: 'String'
            }
          },
          containerName: {
            required: true,
            serializedName: 'ContainerName',
            type: {
              name: 'String'
            }
          },
          hostId: {
            required: true,
            serializedName: 'HostId',
            type: {
              name: 'String'
            }
          },
          exitCode: {
            required: true,
            serializedName: 'ExitCode',
            type: {
              name: 'Number'
            }
          },
          unexpectedTermination: {
            required: true,
            serializedName: 'UnexpectedTermination',
            type: {
              name: 'Boolean'
            }
          },
          startTime: {
            required: true,
            serializedName: 'StartTime',
            type: {
              name: 'DateTime'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationContainerInstanceExitedEvent;
