Spotify.NET/SpotifyAPI.Web/Models/BasicModel.cs
2019-03-18 21:24:09 +01:00

23 lines
563 B
C#

using Newtonsoft.Json;
using System.Net;
namespace SpotifyAPI.Web.Models
{
public abstract class BasicModel
{
[JsonProperty("error")]
public Error Error { get; set; }
private ResponseInfo _info;
public bool HasError() => Error != null;
internal void AddResponseInfo(ResponseInfo info) => _info = info;
public string Header(string key) => _info.Headers?.Get(key);
public WebHeaderCollection Headers() => _info.Headers;
public HttpStatusCode StatusCode() => _info.StatusCode;
}
}