AuthenticatedRequests
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Untappd.Net.Client;
|
using Untappd.Net.Client;
|
||||||
using Untappd.Net.Request;
|
using Untappd.Net.Request;
|
||||||
using Untappd.Net.Responses.UserInfo;
|
using UserInfo = Untappd.Net.Responses.UserInfo;
|
||||||
|
using ActivityFeed = Untappd.Net.Responses.Feeds.ActivityFeed;
|
||||||
|
|
||||||
namespace Untappd.Net.UnitTests
|
namespace Untappd.Net.UnitTests
|
||||||
{
|
{
|
||||||
@@ -15,8 +16,21 @@ namespace Untappd.Net.UnitTests
|
|||||||
{
|
{
|
||||||
|
|
||||||
var ts = new UnAuthenticatedUntappdCredentials("id", "scrt");
|
var ts = new UnAuthenticatedUntappdCredentials("id", "scrt");
|
||||||
var t = new Repository().Get<UserInfo>(ts, "tparnell");
|
var t = new Repository().Get<UserInfo.UserInfo>(ts, "tparnell");
|
||||||
Console.WriteLine(t);
|
Console.WriteLine(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void GetActualJsonRequest()
|
||||||
|
{
|
||||||
|
var credentials = new AuthenticatedUntappdCredentials(
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"");
|
||||||
|
|
||||||
|
var repo = new Repository();
|
||||||
|
var activityFeed = repo.Get<ActivityFeed.ActivityFeed>(credentials);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Untappd.Net.UnitTests.Request
|
|||||||
[Test]
|
[Test]
|
||||||
public void ConfirmRequestWorks()
|
public void ConfirmRequestWorks()
|
||||||
{
|
{
|
||||||
var mockCreds = new Mock<IUntappdCredentials>();
|
var mockCreds = new Mock<IUnAuthenticadedUntappdCredentials>();
|
||||||
mockCreds.Setup(a => a.ClientId).Returns("id");
|
mockCreds.Setup(a => a.ClientId).Returns("id");
|
||||||
mockCreds.Setup(a => a.ClientSecret).Returns("secret");
|
mockCreds.Setup(a => a.ClientSecret).Returns("secret");
|
||||||
var bodyParam = new Dictionary<string, string> {{"key", "value"}};
|
var bodyParam = new Dictionary<string, string> {{"key", "value"}};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Untappd.Net.Client
|
namespace Untappd.Net.Client
|
||||||
{
|
{
|
||||||
public class AuthenticatedUntappdCredentials : UnAuthenticatedUntappdCredentials
|
public class AuthenticatedUntappdCredentials : UntappdCredentials, IAuthenticatedUntappdCredentials
|
||||||
{
|
{
|
||||||
public string AccessToken { get; private set; }
|
public string AccessToken { get; private set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -33,5 +33,6 @@ using System.Runtime.InteropServices;
|
|||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.2.*")]
|
[assembly: AssemblyVersion("0.2.*")]
|
||||||
[assembly: AssemblyFileVersion("0.2.*")]
|
//If AssemblyFileVersion is not explicitly set, it takes its value from the AssemblyVersion attribute.
|
||||||
|
//[assembly: AssemblyFileVersion("0.2.*")]
|
||||||
[assembly: InternalsVisibleTo("Untappd.Net.UnitTests")]
|
[assembly: InternalsVisibleTo("Untappd.Net.UnitTests")]
|
||||||
@@ -1,12 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Untappd.Net.Request
|
namespace Untappd.Net.Request
|
||||||
{
|
{
|
||||||
public abstract class AuthenticatedRequest
|
public abstract class BasicRequest
|
||||||
{
|
{
|
||||||
protected abstract string _EndPoint { get; }
|
protected abstract string _EndPoint { get; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -14,7 +9,7 @@ namespace Untappd.Net.Request
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="parameter"></param>
|
/// <param name="parameter"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal string EndPoint(string parameter = "")
|
public string EndPoint(string parameter = "")
|
||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(parameter))
|
if (!String.IsNullOrEmpty(parameter))
|
||||||
{
|
{
|
||||||
13
src/Untappd.Net/Request/IRequest.cs
Normal file
13
src/Untappd.Net/Request/IRequest.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Untappd.Net.Request
|
||||||
|
{
|
||||||
|
public interface IRequest
|
||||||
|
{
|
||||||
|
string EndPoint(string parameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
12
src/Untappd.Net/Request/IUnAuthenticatedRequest.cs
Normal file
12
src/Untappd.Net/Request/IUnAuthenticatedRequest.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Untappd.Net.Request
|
||||||
|
{
|
||||||
|
public interface IUnAuthenticatedRequest : IRequest
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,7 +31,7 @@ namespace Untappd.Net.Request
|
|||||||
/// <param name="bodyParameters">Any additional params you wish to add to the request</param>
|
/// <param name="bodyParameters">Any additional params you wish to add to the request</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public TResult Get<TResult> (IUnAuthenticadedUntappdCredentials credentials, string urlParameter, IDictionary<string, string> bodyParameters = null)
|
public TResult Get<TResult> (IUnAuthenticadedUntappdCredentials credentials, string urlParameter, IDictionary<string, string> bodyParameters = null)
|
||||||
where TResult : UnAuthenticatedRequest,new()
|
where TResult : IUnAuthenticatedRequest,new()
|
||||||
{
|
{
|
||||||
var result = new TResult();
|
var result = new TResult();
|
||||||
Request.Resource = result.EndPoint(urlParameter);
|
Request.Resource = result.EndPoint(urlParameter);
|
||||||
@@ -50,7 +50,7 @@ namespace Untappd.Net.Request
|
|||||||
}
|
}
|
||||||
|
|
||||||
public TResult Get<TResult>(IAuthenticatedUntappdCredentials credentials, string parameter = "", IDictionary<string, string> bodyParameters = null)
|
public TResult Get<TResult>(IAuthenticatedUntappdCredentials credentials, string parameter = "", IDictionary<string, string> bodyParameters = null)
|
||||||
where TResult : AuthenticatedRequest, new()
|
where TResult : IAuthenticatedRequest, new()
|
||||||
{
|
{
|
||||||
var result = new TResult();
|
var result = new TResult();
|
||||||
var client = new RestClient(Constants.BaseRequestString);
|
var client = new RestClient(Constants.BaseRequestString);
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
namespace Untappd.Net.Request
|
|
||||||
{
|
|
||||||
public abstract class UnAuthenticatedRequest : AuthenticatedRequest
|
|
||||||
{
|
|
||||||
protected override abstract string _EndPoint { get; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -847,9 +847,10 @@ namespace Untappd.Net.Responses.BeerInfo
|
|||||||
public Beer Beer { get; set; }
|
public Beer Beer { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BeerInfo : UnAuthenticatedRequest
|
public class BeerInfo : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
|
protected override string _EndPoint { get { return "v4/beer/info{0}"; }
|
||||||
|
}
|
||||||
[JsonProperty("meta")]
|
[JsonProperty("meta")]
|
||||||
public Meta Meta { get; set; }
|
public Meta Meta { get; set; }
|
||||||
|
|
||||||
@@ -858,12 +859,5 @@ namespace Untappd.Net.Responses.BeerInfo
|
|||||||
|
|
||||||
[JsonProperty("response")]
|
[JsonProperty("response")]
|
||||||
public Response Response { get; set; }
|
public Response Response { get; set; }
|
||||||
|
|
||||||
protected override string _EndPoint
|
|
||||||
{
|
|
||||||
get { return "v4/beer/info/{0}"; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -388,9 +388,10 @@ namespace Untappd.Net.Responses.BeerSearch
|
|||||||
public Breweries Breweries { get; set; }
|
public Breweries Breweries { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BeerSearch : UnAuthenticatedRequest
|
public class BeerSearch : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
|
protected override string _EndPoint { get { return "v4/search/beer"; }
|
||||||
|
}
|
||||||
[JsonProperty("meta")]
|
[JsonProperty("meta")]
|
||||||
public Meta Meta { get; set; }
|
public Meta Meta { get; set; }
|
||||||
|
|
||||||
@@ -399,11 +400,5 @@ namespace Untappd.Net.Responses.BeerSearch
|
|||||||
|
|
||||||
[JsonProperty("response")]
|
[JsonProperty("response")]
|
||||||
public Response Response { get; set; }
|
public Response Response { get; set; }
|
||||||
|
|
||||||
protected override string _EndPoint
|
|
||||||
{
|
|
||||||
get { return "v4/search/beer"; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -954,9 +954,9 @@ namespace Untappd.Net.Responses.BreweryInfo
|
|||||||
public Brewery Brewery { get; set; }
|
public Brewery Brewery { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BreweryInfo : UnAuthenticatedRequest
|
public class BreweryInfo : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
protected override string _EndPoint { get { return "v4/brewery/info/{0}"; } }
|
protected override string _EndPoint { get { return "v4/brewery/info{0}"; } }
|
||||||
|
|
||||||
[JsonProperty("meta")]
|
[JsonProperty("meta")]
|
||||||
public Meta Meta { get; set; }
|
public Meta Meta { get; set; }
|
||||||
|
|||||||
@@ -115,9 +115,10 @@ namespace Untappd.Net.Responses.BrewerySearch
|
|||||||
public Brewery Brewery { get; set; }
|
public Brewery Brewery { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BrewerySearch : UnAuthenticatedRequest
|
public class BrewerySearch : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
|
protected override string _EndPoint { get { return "v4/search/brewery"; }
|
||||||
|
}
|
||||||
[JsonProperty("meta")]
|
[JsonProperty("meta")]
|
||||||
public Meta Meta { get; set; }
|
public Meta Meta { get; set; }
|
||||||
|
|
||||||
@@ -126,11 +127,5 @@ namespace Untappd.Net.Responses.BrewerySearch
|
|||||||
|
|
||||||
[JsonProperty("response")]
|
[JsonProperty("response")]
|
||||||
public Response Response { get; set; }
|
public Response Response { get; set; }
|
||||||
|
|
||||||
protected override string _EndPoint
|
|
||||||
{
|
|
||||||
get { return "v4/search/brewery"; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
524
src/Untappd.Net/Responses/Feeds/ActivityFeed.cs
Normal file
524
src/Untappd.Net/Responses/Feeds/ActivityFeed.cs
Normal file
@@ -0,0 +1,524 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Untappd.Net.Request;
|
||||||
|
|
||||||
|
namespace Untappd.Net.Responses.Feeds.ActivityFeed
|
||||||
|
{
|
||||||
|
public class ResponseTime
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("time")]
|
||||||
|
public double Time { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("measure")]
|
||||||
|
public string Measure { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InitTime
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("time")]
|
||||||
|
public double Time { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("measure")]
|
||||||
|
public string Measure { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Meta
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("response_time")]
|
||||||
|
public ResponseTime ResponseTime { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("init_time")]
|
||||||
|
public InitTime InitTime { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UnreadCount
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("comments")]
|
||||||
|
public int Comments { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("toasts")]
|
||||||
|
public int Toasts { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("friends")]
|
||||||
|
public int Friends { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("messages")]
|
||||||
|
public int Messages { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("news")]
|
||||||
|
public int News { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Notifications
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("type")]
|
||||||
|
public string Type { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("unread_count")]
|
||||||
|
public UnreadCount UnreadCount { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class User
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("uid")]
|
||||||
|
public int Uid { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user_name")]
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("first_name")]
|
||||||
|
public string FirstName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("last_name")]
|
||||||
|
public string LastName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("location")]
|
||||||
|
public string Location { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("url")]
|
||||||
|
public string Url { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("is_supporter")]
|
||||||
|
public int IsSupporter { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("relationship")]
|
||||||
|
public string Relationship { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("bio")]
|
||||||
|
public string Bio { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user_avatar")]
|
||||||
|
public string UserAvatar { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Beer
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("bid")]
|
||||||
|
public int Bid { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("beer_name")]
|
||||||
|
public string BeerName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("beer_label")]
|
||||||
|
public string BeerLabel { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("beer_style")]
|
||||||
|
public string BeerStyle { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("beer_abv")]
|
||||||
|
public double BeerAbv { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("auth_rating")]
|
||||||
|
public int AuthRating { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("wish_list")]
|
||||||
|
public bool WishList { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("beer_active")]
|
||||||
|
public int BeerActive { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Contact
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("twitter")]
|
||||||
|
public string Twitter { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("facebook")]
|
||||||
|
public string Facebook { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("instagram")]
|
||||||
|
public string Instagram { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("url")]
|
||||||
|
public string Url { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Location
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("brewery_city")]
|
||||||
|
public string BreweryCity { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("brewery_state")]
|
||||||
|
public string BreweryState { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("lat")]
|
||||||
|
public double Lat { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("lng")]
|
||||||
|
public double Lng { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Brewery
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("brewery_id")]
|
||||||
|
public int BreweryId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("brewery_name")]
|
||||||
|
public string BreweryName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("brewery_slug")]
|
||||||
|
public string BrewerySlug { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("brewery_label")]
|
||||||
|
public string BreweryLabel { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("country_name")]
|
||||||
|
public string CountryName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("contact")]
|
||||||
|
public Contact Contact { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("location")]
|
||||||
|
public Location Location { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("brewery_active")]
|
||||||
|
public int BreweryActive { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class User2
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("uid")]
|
||||||
|
public int Uid { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user_name")]
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("first_name")]
|
||||||
|
public string FirstName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("last_name")]
|
||||||
|
public string LastName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("bio")]
|
||||||
|
public string Bio { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("location")]
|
||||||
|
public string Location { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("relationship")]
|
||||||
|
public string Relationship { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("is_supporter")]
|
||||||
|
public int IsSupporter { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user_avatar")]
|
||||||
|
public string UserAvatar { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user_link")]
|
||||||
|
public string UserLink { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("account_type")]
|
||||||
|
public string AccountType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("brewery_details")]
|
||||||
|
public IList<object> BreweryDetails { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Item2
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("user")]
|
||||||
|
public User2 User { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("checkin_id")]
|
||||||
|
public int CheckinId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("comment_id")]
|
||||||
|
public int CommentId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("comment_owner")]
|
||||||
|
public bool CommentOwner { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("comment_editor")]
|
||||||
|
public bool CommentEditor { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("comment")]
|
||||||
|
public string Comment { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("created_at")]
|
||||||
|
public string CreatedAt { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("comment_source")]
|
||||||
|
public string CommentSource { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Comments
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("total_count")]
|
||||||
|
public int TotalCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("count")]
|
||||||
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("items")]
|
||||||
|
public IList<Item2> Items { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class User3
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("uid")]
|
||||||
|
public int Uid { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user_name")]
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("first_name")]
|
||||||
|
public string FirstName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("last_name")]
|
||||||
|
public string LastName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("bio")]
|
||||||
|
public string Bio { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("location")]
|
||||||
|
public string Location { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user_avatar")]
|
||||||
|
public string UserAvatar { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user_link")]
|
||||||
|
public string UserLink { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("account_type")]
|
||||||
|
public string AccountType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("brewery_details")]
|
||||||
|
public IList<object> BreweryDetails { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Item3
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("uid")]
|
||||||
|
public int Uid { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user")]
|
||||||
|
public User3 User { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("like_id")]
|
||||||
|
public int LikeId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("like_owner")]
|
||||||
|
public bool LikeOwner { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("created_at")]
|
||||||
|
public string CreatedAt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Toasts
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("total_count")]
|
||||||
|
public int TotalCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("count")]
|
||||||
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("auth_toast")]
|
||||||
|
public bool AuthToast { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("items")]
|
||||||
|
public IList<Item3> Items { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Photo
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("photo_img_sm")]
|
||||||
|
public string PhotoImgSm { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("photo_img_md")]
|
||||||
|
public string PhotoImgMd { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("photo_img_lg")]
|
||||||
|
public string PhotoImgLg { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("photo_img_og")]
|
||||||
|
public string PhotoImgOg { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Item4
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("photo_id")]
|
||||||
|
public int PhotoId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("photo")]
|
||||||
|
public Photo Photo { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Media
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("count")]
|
||||||
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("items")]
|
||||||
|
public IList<Item4> Items { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Source
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("app_name")]
|
||||||
|
public string AppName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("app_website")]
|
||||||
|
public string AppWebsite { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BadgeImage
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("sm")]
|
||||||
|
public string Sm { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("md")]
|
||||||
|
public string Md { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("lg")]
|
||||||
|
public string Lg { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Item5
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("badge_id")]
|
||||||
|
public int BadgeId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user_badge_id")]
|
||||||
|
public int UserBadgeId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("badge_name")]
|
||||||
|
public string BadgeName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("badge_description")]
|
||||||
|
public string BadgeDescription { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("created_at")]
|
||||||
|
public string CreatedAt { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("badge_image")]
|
||||||
|
public BadgeImage BadgeImage { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Badges
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("count")]
|
||||||
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("items")]
|
||||||
|
public IList<Item5> Items { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Item
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("checkin_id")]
|
||||||
|
public int CheckinId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("created_at")]
|
||||||
|
public string CreatedAt { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("checkin_comment")]
|
||||||
|
public string CheckinComment { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("rating_score")]
|
||||||
|
public double RatingScore { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("user")]
|
||||||
|
public User User { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("beer")]
|
||||||
|
public Beer Beer { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("brewery")]
|
||||||
|
public Brewery Brewery { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("venue")]
|
||||||
|
public object Venue { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("comments")]
|
||||||
|
public Comments Comments { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("toasts")]
|
||||||
|
public Toasts Toasts { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("media")]
|
||||||
|
public Media Media { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("source")]
|
||||||
|
public Source Source { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("badges")]
|
||||||
|
public Badges Badges { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Checkins
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("count")]
|
||||||
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("items")]
|
||||||
|
public IList<Item> Items { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Pagination
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("next_url")]
|
||||||
|
public string NextUrl { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("max_id")]
|
||||||
|
public int MaxId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("since_url")]
|
||||||
|
public string SinceUrl { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Response
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("mg")]
|
||||||
|
public bool Mg { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("checkins")]
|
||||||
|
public Checkins Checkins { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("pagination")]
|
||||||
|
public Pagination Pagination { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ActivityFeed : BasicRequest, IAuthenticatedRequest
|
||||||
|
{
|
||||||
|
protected override string _EndPoint { get { return "/v4/checkin/recent"; } }
|
||||||
|
|
||||||
|
[JsonProperty("meta")]
|
||||||
|
public Meta Meta { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("notifications")]
|
||||||
|
public Notifications Notifications { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("response")]
|
||||||
|
public Response Response { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Untappd.Net.Request;
|
using Untappd.Net.Request;
|
||||||
|
|
||||||
namespace Untappd.Net.Responses.Feeds
|
namespace Untappd.Net.Responses.Feeds.UserActivityFeed
|
||||||
{
|
{
|
||||||
public sealed class ResponseTime
|
public sealed class ResponseTime
|
||||||
{
|
{
|
||||||
@@ -424,8 +424,9 @@ namespace Untappd.Net.Responses.Feeds
|
|||||||
public Checkins Checkins { get; set; }
|
public Checkins Checkins { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserActivityFeed : UnAuthenticatedRequest
|
public class UserActivityFeed : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
|
protected override string _EndPoint { get { return "v4/user/checkins{0}"; } }
|
||||||
|
|
||||||
[JsonProperty("meta")]
|
[JsonProperty("meta")]
|
||||||
public Meta Meta { get; set; }
|
public Meta Meta { get; set; }
|
||||||
@@ -435,10 +436,5 @@ namespace Untappd.Net.Responses.Feeds
|
|||||||
|
|
||||||
[JsonProperty("response")]
|
[JsonProperty("response")]
|
||||||
public Response Response { get; set; }
|
public Response Response { get; set; }
|
||||||
|
|
||||||
protected override string _EndPoint
|
|
||||||
{
|
|
||||||
get { return "v4/user/checkins/{0}"; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,9 +126,10 @@ namespace Untappd.Net.Responses.UserBadges
|
|||||||
public IList<Item> Items { get; set; }
|
public IList<Item> Items { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserBadges : UnAuthenticatedRequest
|
public class UserBadges : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
protected override string _EndPoint { get { return "v4/user/badges/{0}"; } }
|
protected override string _EndPoint { get { return "v4/user/badges{0}"; } }
|
||||||
|
|
||||||
[JsonProperty("meta")]
|
[JsonProperty("meta")]
|
||||||
public Meta Meta { get; set; }
|
public Meta Meta { get; set; }
|
||||||
|
|
||||||
@@ -138,6 +139,4 @@ namespace Untappd.Net.Responses.UserBadges
|
|||||||
[JsonProperty("response")]
|
[JsonProperty("response")]
|
||||||
public Response Response { get; set; }
|
public Response Response { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ namespace Untappd.Net.Responses.UserDistinctBeer
|
|||||||
public Beers Beers { get; set; }
|
public Beers Beers { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserDistinctBeers : UnAuthenticatedRequest
|
public class UserDistinctBeers : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
protected override string _EndPoint { get { return "v4/user/beers{0}"; } }
|
protected override string _EndPoint { get { return "v4/user/beers{0}"; } }
|
||||||
|
|
||||||
|
|||||||
@@ -105,9 +105,10 @@ namespace Untappd.Net.Responses.UserFriends
|
|||||||
public IList<Item> Items { get; set; }
|
public IList<Item> Items { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserFriends : UnAuthenticatedRequest
|
public class UserFriends : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
protected override string _EndPoint { get { return "v4/user/friends/{0}"; } }
|
protected override string _EndPoint { get { return "v4/user/friends{0}"; } }
|
||||||
|
|
||||||
[JsonProperty("meta")]
|
[JsonProperty("meta")]
|
||||||
public Meta Meta { get; set; }
|
public Meta Meta { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -864,7 +864,7 @@ namespace Untappd.Net.Responses.UserInfo
|
|||||||
public User User { get; set; }
|
public User User { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserInfo : UnAuthenticatedRequest
|
public class UserInfo : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
protected override string _EndPoint { get { return "v4/user/info{0}"; } }
|
protected override string _EndPoint { get { return "v4/user/info{0}"; } }
|
||||||
|
|
||||||
@@ -877,5 +877,4 @@ namespace Untappd.Net.Responses.UserInfo
|
|||||||
[JsonProperty("response")]
|
[JsonProperty("response")]
|
||||||
public Response Response { get; set; }
|
public Response Response { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -64,9 +64,9 @@ namespace Untappd.Net.Responses.UserWishlist
|
|||||||
public Beers Beers { get; set; }
|
public Beers Beers { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserWishList : UnAuthenticatedRequest
|
public class UserWishList : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
protected override string _EndPoint { get { return "/v4/user/wishlist/{0}"; } }
|
protected override string _EndPoint { get { return "/v4/user/wishlist{0}"; } }
|
||||||
[JsonProperty("meta")]
|
[JsonProperty("meta")]
|
||||||
public Meta Meta { get; set; }
|
public Meta Meta { get; set; }
|
||||||
|
|
||||||
@@ -76,6 +76,4 @@ namespace Untappd.Net.Responses.UserWishlist
|
|||||||
[JsonProperty("response")]
|
[JsonProperty("response")]
|
||||||
public Response Response { get; set; }
|
public Response Response { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -554,8 +554,10 @@ namespace Untappd.Net.Responses.VenueInfo
|
|||||||
public Venue Venue { get; set; }
|
public Venue Venue { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class VenueInfo : UnAuthenticatedRequest
|
public class VenueInfo : BasicRequest, IAuthenticatedRequest, IUnAuthenticatedRequest
|
||||||
{
|
{
|
||||||
|
protected override string _EndPoint { get { return "v4/venue/info{0}"; }
|
||||||
|
}
|
||||||
|
|
||||||
[JsonProperty("meta")]
|
[JsonProperty("meta")]
|
||||||
public Meta Meta { get; set; }
|
public Meta Meta { get; set; }
|
||||||
@@ -565,11 +567,5 @@ namespace Untappd.Net.Responses.VenueInfo
|
|||||||
|
|
||||||
[JsonProperty("response")]
|
[JsonProperty("response")]
|
||||||
public Response Response { get; set; }
|
public Response Response { get; set; }
|
||||||
|
|
||||||
protected override string _EndPoint
|
|
||||||
{
|
|
||||||
get { return "v4/venue/info/{0}"; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,12 +55,15 @@
|
|||||||
<Compile Include="Constants.cs" />
|
<Compile Include="Constants.cs" />
|
||||||
<Compile Include="Exception\BaseUntappdException.cs" />
|
<Compile Include="Exception\BaseUntappdException.cs" />
|
||||||
<Compile Include="Exception\EndpointConfigurationException.cs" />
|
<Compile Include="Exception\EndpointConfigurationException.cs" />
|
||||||
<Compile Include="Request\AuthenticatedRequest.cs" />
|
<Compile Include="Request\IAuthenticatedRequest.cs" />
|
||||||
<Compile Include="Request\UnAuthenticatedRequest.cs" />
|
<Compile Include="Request\IRequest.cs" />
|
||||||
|
<Compile Include="Request\BasicRequest.cs" />
|
||||||
|
<Compile Include="Request\IUnAuthenticatedRequest.cs" />
|
||||||
<Compile Include="Responses\BeerInfo.cs" />
|
<Compile Include="Responses\BeerInfo.cs" />
|
||||||
<Compile Include="Responses\BeerSearch.cs" />
|
<Compile Include="Responses\BeerSearch.cs" />
|
||||||
<Compile Include="Responses\BreweryInfo.cs" />
|
<Compile Include="Responses\BreweryInfo.cs" />
|
||||||
<Compile Include="Responses\BrewerySearch.cs" />
|
<Compile Include="Responses\BrewerySearch.cs" />
|
||||||
|
<Compile Include="Responses\Feeds\ActivityFeed.cs" />
|
||||||
<Compile Include="Responses\Feeds\UserActivityFeed.cs" />
|
<Compile Include="Responses\Feeds\UserActivityFeed.cs" />
|
||||||
<Compile Include="Responses\UserBadges.cs" />
|
<Compile Include="Responses\UserBadges.cs" />
|
||||||
<Compile Include="Responses\UserDistinctBeer.cs" />
|
<Compile Include="Responses\UserDistinctBeer.cs" />
|
||||||
@@ -74,6 +77,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Responses\Actions\" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
Reference in New Issue
Block a user