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

/**
 * Managed integration runtime status.
 *
 * @extends models['IntegrationRuntimeStatus']
 */
class ManagedIntegrationRuntimeStatus extends models['IntegrationRuntimeStatus'] {
  /**
   * Create a ManagedIntegrationRuntimeStatus.
   * @member {date} [createTime] The time at which the integration runtime was
   * created, in ISO8601 format.
   * @member {array} [nodes] The list of nodes for managed integration runtime.
   * @member {array} [otherErrors] The errors that occurred on this integration
   * runtime.
   * @member {object} [lastOperation] The last operation result that occurred
   * on this integration runtime.
   * @member {string} [lastOperation.type] The operation type. Could be start
   * or stop.
   * @member {date} [lastOperation.startTime] The start time of the operation.
   * @member {string} [lastOperation.result] The operation result.
   * @member {string} [lastOperation.errorCode] The error code.
   * @member {array} [lastOperation.parameters] Managed integration runtime
   * error parameters.
   * @member {string} [lastOperation.activityId] The activity id for the
   * operation request.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ManagedIntegrationRuntimeStatus
   *
   * @returns {object} metadata of ManagedIntegrationRuntimeStatus
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Managed',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'IntegrationRuntimeStatus',
        className: 'ManagedIntegrationRuntimeStatus',
        modelProperties: {
          dataFactoryName: {
            required: false,
            readOnly: true,
            serializedName: 'dataFactoryName',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'state',
            type: {
              name: 'String'
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          createTime: {
            required: false,
            readOnly: true,
            serializedName: 'typeProperties.createTime',
            type: {
              name: 'DateTime'
            }
          },
          nodes: {
            required: false,
            readOnly: true,
            serializedName: 'typeProperties.nodes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ManagedIntegrationRuntimeNodeElementType',
                  type: {
                    name: 'Composite',
                    additionalProperties: {
                      type: {
                        name: 'Dictionary',
                        value: {
                            required: false,
                            serializedName: 'ObjectElementType',
                            type: {
                              name: 'Object'
                            }
                        }
                      }
                    },
                    className: 'ManagedIntegrationRuntimeNode'
                  }
              }
            }
          },
          otherErrors: {
            required: false,
            readOnly: true,
            serializedName: 'typeProperties.otherErrors',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ManagedIntegrationRuntimeErrorElementType',
                  type: {
                    name: 'Composite',
                    additionalProperties: {
                      type: {
                        name: 'Dictionary',
                        value: {
                            required: false,
                            serializedName: 'ObjectElementType',
                            type: {
                              name: 'Object'
                            }
                        }
                      }
                    },
                    className: 'ManagedIntegrationRuntimeError'
                  }
              }
            }
          },
          lastOperation: {
            required: false,
            readOnly: true,
            serializedName: 'typeProperties.lastOperation',
            type: {
              name: 'Composite',
              additionalProperties: {
                type: {
                  name: 'Dictionary',
                  value: {
                      required: false,
                      serializedName: 'ObjectElementType',
                      type: {
                        name: 'Object'
                      }
                  }
                }
              },
              className: 'ManagedIntegrationRuntimeOperationResult'
            }
          }
        }
      }
    };
  }
}

module.exports = ManagedIntegrationRuntimeStatus;
