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

/**
 * Node Added event.
 *
 * @extends models['NodeEvent']
 */
class NodeAddedToClusterEvent extends models['NodeEvent'] {
  /**
   * Create a NodeAddedToClusterEvent.
   * @property {string} nodeId Id of Node.
   * @property {number} nodeInstance Id of Node instance.
   * @property {string} nodeType Type of Node.
   * @property {string} fabricVersion Fabric version.
   * @property {string} ipAddressOrFQDN IP address or FQDN.
   * @property {string} nodeCapacities Capacities.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of NodeAddedToClusterEvent
   *
   * @returns {object} metadata of NodeAddedToClusterEvent
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'NodeAddedToCluster',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'Kind',
          clientName: 'kind'
        },
        uberParent: 'FabricEvent',
        className: 'NodeAddedToClusterEvent',
        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'
            }
          },
          nodeName: {
            required: true,
            serializedName: 'NodeName',
            type: {
              name: 'String'
            }
          },
          nodeId: {
            required: true,
            serializedName: 'NodeId',
            type: {
              name: 'String'
            }
          },
          nodeInstance: {
            required: true,
            serializedName: 'NodeInstance',
            type: {
              name: 'Number'
            }
          },
          nodeType: {
            required: true,
            serializedName: 'NodeType',
            type: {
              name: 'String'
            }
          },
          fabricVersion: {
            required: true,
            serializedName: 'FabricVersion',
            type: {
              name: 'String'
            }
          },
          ipAddressOrFQDN: {
            required: true,
            serializedName: 'IpAddressOrFQDN',
            type: {
              name: 'String'
            }
          },
          nodeCapacities: {
            required: true,
            serializedName: 'NodeCapacities',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = NodeAddedToClusterEvent;
