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

/**
 * @summary Error details.
  *
 */
class ErrorDetail {
  /**
   * Create a ErrorDetail.
   * @member {string} code The error's code.
   * @member {string} message A human readable error message.
   * @member {string} [target] Indicates which property in the request is
   * responsible for the error.
   * @member {string} [value] Indicates which value in 'target' is responsible
   * for the error.
   * @member {array} [resources] Indicates resources which were responsible for
   * the error.
   * @member {object} [additionalProperties]
   */
  constructor() {
  }

  /**
   * Defines the metadata of ErrorDetail
   *
   * @returns {object} metadata of ErrorDetail
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'errorDetail',
      type: {
        name: 'Composite',
        className: 'ErrorDetail',
        modelProperties: {
          code: {
            required: true,
            serializedName: 'code',
            type: {
              name: 'String'
            }
          },
          message: {
            required: true,
            serializedName: 'message',
            type: {
              name: 'String'
            }
          },
          target: {
            required: false,
            serializedName: 'target',
            type: {
              name: 'String'
            }
          },
          value: {
            required: false,
            serializedName: 'value',
            type: {
              name: 'String'
            }
          },
          resources: {
            required: false,
            serializedName: 'resources',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          additionalProperties: {
            required: false,
            serializedName: 'additionalProperties',
            type: {
              name: 'Object'
            }
          }
        }
      }
    };
  }
}

module.exports = ErrorDetail;
