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

/**
 * Operation Result.
 *
 */
class OperationResultContract {
  /**
   * Create a OperationResultContract.
   * @property {string} [id] Operation result identifier.
   * @property {string} [status] Status of an async operation. Possible values
   * include: 'Started', 'InProgress', 'Succeeded', 'Failed'
   * @property {date} [started] Start time of an async operation. The date
   * conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by
   * the ISO 8601 standard.
   * @property {date} [updated] Last update time of an async operation. The
   * date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified
   * by the ISO 8601 standard.
   * @property {string} [resultInfo] Optional result info.
   * @property {object} [error] Error Body Contract
   * @property {string} [error.code] Service-defined error code. This code
   * serves as a sub-status for the HTTP error code specified in the response.
   * @property {string} [error.message] Human-readable representation of the
   * error.
   * @property {array} [error.details] The list of invalid fields send in
   * request, in case of validation error.
   * @property {array} [actionLog] This property if only provided as part of
   * the TenantConfiguration_Validate operation. It contains the log the
   * entities which will be updated/created/deleted as part of the
   * TenantConfiguration_Deploy operation.
   */
  constructor() {
  }

  /**
   * Defines the metadata of OperationResultContract
   *
   * @returns {object} metadata of OperationResultContract
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'OperationResultContract',
      type: {
        name: 'Composite',
        className: 'OperationResultContract',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          status: {
            required: false,
            serializedName: 'status',
            type: {
              name: 'Enum',
              allowedValues: [ 'Started', 'InProgress', 'Succeeded', 'Failed' ]
            }
          },
          started: {
            required: false,
            serializedName: 'started',
            type: {
              name: 'DateTime'
            }
          },
          updated: {
            required: false,
            serializedName: 'updated',
            type: {
              name: 'DateTime'
            }
          },
          resultInfo: {
            required: false,
            serializedName: 'resultInfo',
            type: {
              name: 'String'
            }
          },
          error: {
            required: false,
            serializedName: 'error',
            type: {
              name: 'Composite',
              className: 'ErrorResponseBody'
            }
          },
          actionLog: {
            required: false,
            readOnly: true,
            serializedName: 'actionLog',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'OperationResultLogItemContractElementType',
                  type: {
                    name: 'Composite',
                    className: 'OperationResultLogItemContract'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = OperationResultContract;
