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

/**
 * Record to track long running operation.
 *
 */
class Operation {
  /**
   * Create a Operation.
   * @property {string} [operationState] Operation state. Possible values
   * include: 'Failed', 'NotStarted', 'Running', 'Succeeded'
   * @property {string} [createdTimestamp] Timestamp when the operation was
   * created.
   * @property {string} [lastActionTimestamp] Timestamp when the current state
   * was entered.
   * @property {string} [resourceLocation] Relative URI to the target resource
   * location for completed resources.
   * @property {string} [userId] User Id
   * @property {string} [operationId] Operation Id.
   * @property {object} [errorResponse] Error details in case of failures.
   * @property {object} [errorResponse.error] The error object.
   */
  constructor() {
  }

  /**
   * Defines the metadata of Operation
   *
   * @returns {object} metadata of Operation
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Operation',
      type: {
        name: 'Composite',
        className: 'Operation',
        modelProperties: {
          operationState: {
            required: false,
            serializedName: 'operationState',
            type: {
              name: 'String'
            }
          },
          createdTimestamp: {
            required: false,
            serializedName: 'createdTimestamp',
            type: {
              name: 'String'
            }
          },
          lastActionTimestamp: {
            required: false,
            serializedName: 'lastActionTimestamp',
            type: {
              name: 'String'
            }
          },
          resourceLocation: {
            required: false,
            serializedName: 'resourceLocation',
            type: {
              name: 'String'
            }
          },
          userId: {
            required: false,
            serializedName: 'userId',
            type: {
              name: 'String'
            }
          },
          operationId: {
            required: false,
            serializedName: 'operationId',
            type: {
              name: 'String'
            }
          },
          errorResponse: {
            required: false,
            serializedName: 'errorResponse',
            type: {
              name: 'Composite',
              className: 'ErrorResponse'
            }
          }
        }
      }
    };
  }
}

module.exports = Operation;
