forked from JohnnyCrazy/SpotifyAPI-NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicModel.cs
More file actions
27 lines (19 loc) · 691 Bytes
/
Copy pathBasicModel.cs
File metadata and controls
27 lines (19 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using Newtonsoft.Json;
using SpotifyAPI.Web.Enums;
using System;
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;
public SpotifyHttpStatusCode SpotifyStatusCode() => _info.SpotifyStatusCode;
}
}