using System;
namespace RestEase
{
///
/// Controls whether the given method, or all methods within the given interface, will throw an exception if the response status code does not indicate success
///
[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public sealed class AllowAnyStatusCodeAttribute : Attribute
{
///
/// Gets or sets a value indicating whether to suppress the exception normally thrown on responses that do not indicate success
///
public bool AllowAnyStatusCode { get; set; }
///
/// Initialises a new instance of the class, which does allow any status code
///
public AllowAnyStatusCodeAttribute()
: this(true)
{
}
///
/// Initialises a new instance of the classe whi
///
/// True to allow any response status code; False to throw an exception on response status codes that do not indicate success
public AllowAnyStatusCodeAttribute(bool allowAnyStatusCode)
{
this.AllowAnyStatusCode = allowAnyStatusCode;
}
}
}