/*
 * 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 a node in Service Fabric cluster.
 *
 */
class NodeInfo {
  /**
   * Create a NodeInfo.
   * @property {string} [name] The name of a Service Fabric node.
   * @property {string} [ipAddressOrFQDN] The IP address or fully qualified
   * domain name of the node.
   * @property {string} [type] The type of the node.
   * @property {string} [codeVersion] The version of Service Fabric binaries
   * that the node is running.
   * @property {string} [configVersion] The version of Service Fabric cluster
   * manifest that the node is using.
   * @property {string} [nodeStatus] The status of the node. Possible values
   * include: 'Invalid', 'Up', 'Down', 'Enabling', 'Disabling', 'Disabled',
   * 'Unknown', 'Removed'
   * @property {string} [nodeUpTimeInSeconds] Time in seconds since the node
   * has been in NodeStatus Up. Value zero indicates that the node is not Up.
   * @property {string} [healthState] The health state of a Service Fabric
   * entity such as Cluster, Node, Application, Service, Partition, Replica
   * etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error',
   * 'Unknown'
   * @property {boolean} [isSeedNode] Indicates if the node is a seed node or
   * not. Returns true if the node is a seed node, otherwise false. A quorum of
   * seed nodes are required for proper operation of Service Fabric cluster.
   * @property {string} [upgradeDomain] The upgrade domain of the node.
   * @property {string} [faultDomain] The fault domain of the node.
   * @property {object} [id] An internal ID used by Service Fabric to uniquely
   * identify a node. Node Id is deterministically generated from node name.
   * @property {string} [id.id] Value of the node Id. This is a 128 bit
   * integer.
   * @property {string} [instanceId] The ID representing the node instance.
   * While the ID of the node is deterministically generated from the node name
   * and remains same across restarts, the InstanceId changes every time node
   * restarts.
   * @property {object} [nodeDeactivationInfo] Information about the node
   * deactivation. This information is valid for a node that is undergoing
   * deactivation or has already been deactivated.
   * @property {string} [nodeDeactivationInfo.nodeDeactivationIntent] The
   * intent or the reason for deactivating the node. Following are the possible
   * values for it. Possible values include: 'Invalid', 'Pause', 'Restart',
   * 'RemoveData', 'RemoveNode'
   * @property {string} [nodeDeactivationInfo.nodeDeactivationStatus] The
   * status of node deactivation operation. Following are the possible values.
   * Possible values include: 'None', 'SafetyCheckInProgress',
   * 'SafetyCheckComplete', 'Completed'
   * @property {array} [nodeDeactivationInfo.nodeDeactivationTask] List of
   * tasks representing the deactivation operation on the node.
   * @property {array} [nodeDeactivationInfo.pendingSafetyChecks] List of
   * pending safety checks
   * @property {boolean} [isStopped] Indicates if the node is stopped by
   * calling stop node API or not. Returns true if the node is stopped,
   * otherwise false.
   * @property {string} [nodeDownTimeInSeconds] Time in seconds since the node
   * has been in NodeStatus Down. Value zero indicates node is not NodeStatus
   * Down.
   * @property {date} [nodeUpAt] Date time in UTC when the node came up. If the
   * node has never been up then this value will be zero date time.
   * @property {date} [nodeDownAt] Date time in UTC when the node went down. If
   * node has never been down then this value will be zero date time.
   */
  constructor() {
  }

  /**
   * Defines the metadata of NodeInfo
   *
   * @returns {object} metadata of NodeInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'NodeInfo',
      type: {
        name: 'Composite',
        className: 'NodeInfo',
        modelProperties: {
          name: {
            required: false,
            serializedName: 'Name',
            type: {
              name: 'String'
            }
          },
          ipAddressOrFQDN: {
            required: false,
            serializedName: 'IpAddressOrFQDN',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            serializedName: 'Type',
            type: {
              name: 'String'
            }
          },
          codeVersion: {
            required: false,
            serializedName: 'CodeVersion',
            type: {
              name: 'String'
            }
          },
          configVersion: {
            required: false,
            serializedName: 'ConfigVersion',
            type: {
              name: 'String'
            }
          },
          nodeStatus: {
            required: false,
            serializedName: 'NodeStatus',
            type: {
              name: 'String'
            }
          },
          nodeUpTimeInSeconds: {
            required: false,
            serializedName: 'NodeUpTimeInSeconds',
            type: {
              name: 'String'
            }
          },
          healthState: {
            required: false,
            serializedName: 'HealthState',
            type: {
              name: 'String'
            }
          },
          isSeedNode: {
            required: false,
            serializedName: 'IsSeedNode',
            type: {
              name: 'Boolean'
            }
          },
          upgradeDomain: {
            required: false,
            serializedName: 'UpgradeDomain',
            type: {
              name: 'String'
            }
          },
          faultDomain: {
            required: false,
            serializedName: 'FaultDomain',
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            serializedName: 'Id',
            type: {
              name: 'Composite',
              className: 'NodeId'
            }
          },
          instanceId: {
            required: false,
            serializedName: 'InstanceId',
            type: {
              name: 'String'
            }
          },
          nodeDeactivationInfo: {
            required: false,
            serializedName: 'NodeDeactivationInfo',
            type: {
              name: 'Composite',
              className: 'NodeDeactivationInfo'
            }
          },
          isStopped: {
            required: false,
            serializedName: 'IsStopped',
            type: {
              name: 'Boolean'
            }
          },
          nodeDownTimeInSeconds: {
            required: false,
            serializedName: 'NodeDownTimeInSeconds',
            type: {
              name: 'String'
            }
          },
          nodeUpAt: {
            required: false,
            serializedName: 'NodeUpAt',
            type: {
              name: 'DateTime'
            }
          },
          nodeDownAt: {
            required: false,
            serializedName: 'NodeDownAt',
            type: {
              name: 'DateTime'
            }
          }
        }
      }
    };
  }
}

module.exports = NodeInfo;
