# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::CognitiveServices::QnamakerRuntime::V4_0
  module Models
    #
    # The error object. As per Microsoft One API guidelines -
    # https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
    #
    class Error

      include MsRestAzure

      # @return [ErrorCodeType] One of a server-defined set of error codes.
      # Possible values include: 'BadArgument', 'Forbidden', 'NotFound',
      # 'KbNotFound', 'Unauthorized', 'Unspecified', 'EndpointKeysError',
      # 'QuotaExceeded', 'QnaRuntimeError', 'SKULimitExceeded',
      # 'OperationNotFound', 'ServiceError', 'ValidationFailure',
      # 'ExtractionFailure'
      attr_accessor :code

      # @return [String] A human-readable representation of the error.
      attr_accessor :message

      # @return [String] The target of the error.
      attr_accessor :target

      # @return [Array<Error>] An array of details about specific errors that
      # led to this reported error.
      attr_accessor :details

      # @return [InnerErrorModel] An object containing more specific
      # information than the current object about the error.
      attr_accessor :inner_error


      #
      # Mapper for Error class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'Error',
          type: {
            name: 'Composite',
            class_name: 'Error',
            model_properties: {
              code: {
                client_side_validation: true,
                required: true,
                serialized_name: 'code',
                type: {
                  name: 'String'
                }
              },
              message: {
                client_side_validation: true,
                required: false,
                serialized_name: 'message',
                type: {
                  name: 'String'
                }
              },
              target: {
                client_side_validation: true,
                required: false,
                serialized_name: 'target',
                type: {
                  name: 'String'
                }
              },
              details: {
                client_side_validation: true,
                required: false,
                serialized_name: 'details',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ErrorElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'Error'
                      }
                  }
                }
              },
              inner_error: {
                client_side_validation: true,
                required: false,
                serialized_name: 'innerError',
                type: {
                  name: 'Composite',
                  class_name: 'InnerErrorModel'
                }
              }
            }
          }
        }
      end
    end
  end
end
