/*
 * 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 a specific step on a target service unit.
 *
 */
class RolloutStep {
  /**
   * Create a RolloutStep.
   * @member {string} name Name of the step.
   * @member {string} [status] Current state of the step.
   * @member {string} [stepGroup] The step group the current step is part of.
   * @member {object} [operationInfo] Detailed information of specific action
   * execution.
   * @member {string} [operationInfo.deploymentName] The name of the ARM
   * deployment initiated as part of the step.
   * @member {string} [operationInfo.correlationId] Unique identifier to track
   * the request for ARM-based resources.
   * @member {date} [operationInfo.startTime] Start time of the action in UTC.
   * @member {date} [operationInfo.endTime] End time of the action in UTC.
   * @member {date} [operationInfo.lastUpdatedTime] Last time in UTC this
   * operation was updated.
   * @member {object} [operationInfo.error] The errors, if any, for the action.
   * @member {string} [operationInfo.error.code] Error code string.
   * @member {string} [operationInfo.error.message] Descriptive error
   * information.
   * @member {string} [operationInfo.error.target] Error target
   * @member {array} [operationInfo.error.details] More detailed error
   * information.
   * @member {array} [resourceOperations] Set of resource operations that were
   * performed, if any, on an Azure resource.
   * @member {array} [messages] Supplementary informative messages during
   * rollout.
   */
  constructor() {
  }

  /**
   * Defines the metadata of RolloutStep
   *
   * @returns {object} metadata of RolloutStep
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RolloutStep',
      type: {
        name: 'Composite',
        className: 'RolloutStep',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          status: {
            required: false,
            readOnly: true,
            serializedName: 'status',
            type: {
              name: 'String'
            }
          },
          stepGroup: {
            required: false,
            serializedName: 'stepGroup',
            type: {
              name: 'String'
            }
          },
          operationInfo: {
            required: false,
            readOnly: true,
            serializedName: 'operationInfo',
            type: {
              name: 'Composite',
              className: 'StepOperationInfo'
            }
          },
          resourceOperations: {
            required: false,
            readOnly: true,
            serializedName: 'resourceOperations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ResourceOperationElementType',
                  type: {
                    name: 'Composite',
                    className: 'ResourceOperation'
                  }
              }
            }
          },
          messages: {
            required: false,
            readOnly: true,
            serializedName: 'messages',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MessageElementType',
                  type: {
                    name: 'Composite',
                    className: 'Message'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = RolloutStep;
