//-----------------------------------------------------------------------------
// 
//      Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
//      Licensed under the Apache License, Version 2.0 (the "License").
//      You may not use this file except in compliance with the License.
//      A copy of the License is located at
//
//      http://aws.amazon.com/apache2.0
//
//      or in the "license" file accompanying this file. This file is distributed
//      on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
//      express or implied. See the License for the specific language governing
//      permissions and limitations under the License.
// 
//-----------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Amazon.XRay.Recorder.Core.Internal.Utils;
namespace Amazon.XRay.Recorder.Core.Internal.Entities
{
    /// 
    /// AWS X-Ray Descriptor of Exception
    /// 
    [Serializable]
    public class ExceptionDescriptor
    {
        /// 
        /// The exception descriptor identifier length
        /// 
        public const int ExceptionDescriptorIdLength = 16;
        /// 
        /// Initializes a new instance of the  class.
        /// 
        public ExceptionDescriptor()
        {
            Id = ThreadSafeRandom.GenerateHexNumber(ExceptionDescriptor.ExceptionDescriptorIdLength);
        }
        /// 
        /// Gets or sets the id of the descriptor.
        /// 
        public string Id { get; set; }
        /// 
        /// Gets or sets the message.
        /// 
        public string Message { get; set; }
        /// 
        /// Gets or sets the type.
        /// 
        public string Type { get; set; }
        /// 
        /// Gets or sets a value indicating whether this  is remove.
        /// 
        public bool Remove { get; set; }
        /// 
        /// Gets or sets the stack.
        /// 
        [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "The value of stack is not supposed to change after set.")]
        public StackFrame[] Stack { get; set; }
        /// 
        /// Gets or sets the truncated.
        /// 
        public int Truncated { get; set; }
        /// 
        /// Gets or sets the cause.
        /// 
        public string Cause { get; set; }
        /// 
        /// Gets or sets the exception.
        /// 
        public Exception Exception { get; set; }
        /// 
        /// The exception's "remote" attribute should be set to true if the exception on a "remote" subsegment is caused by or originated from a downstream service.
        /// 
        public bool Remote { get; set;}
    }
}