diff --git a/README.md b/README.md index 153f9e0..8be72f3 100644 --- a/README.md +++ b/README.md @@ -1 +1,23 @@ # Untappd.Net + +This is a c# wrapper around the Untappd API. + +## Coverage + +So far only the Requests that do not require user tokens have been implemented + + +## How do I use? + +* Request an [API Key](http://untappd.com/api/register) +* You should be able to make a repository and call the get method with the thing you are requesting. + +Note: Additional parameters can be passed into the Get Method with an IDictionary. + +```csharp + +var ts = new UnAuthenticatedUntappdCredentials("key", "secret"); +var t = new Repository().Get(ts, "tparnell"); + + +``` diff --git a/src/Untappd.Net.UnitTests/Class1.cs b/src/Untappd.Net.UnitTests/Class1.cs index df03d9f..322cd6e 100644 --- a/src/Untappd.Net.UnitTests/Class1.cs +++ b/src/Untappd.Net.UnitTests/Class1.cs @@ -1,11 +1,8 @@ -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; +using NUnit.Framework; using Untappd.Client.Net; -using Untappd.Net.Responses.UserInfo; +using Untappd.Net.Request; +using Untappd.Net.Responses.UserDistinctBeer; namespace Untappd.Net.UnitTests { @@ -13,11 +10,12 @@ namespace Untappd.Net.UnitTests public class Class1 { [Test] + [Ignore] public void Test() { - - //var t = new Request.Request().Get(ts, "tparnell"); - //Console.WriteLine(t.response.user.first_name); + var ts = new UnAuthenticatedUntappdCredentials("clientid", "clientkey"); + var t = new Repository().Get(ts, "tparnell"); + Console.WriteLine(t); } } } diff --git a/src/Untappd.Net/Client/IAuthenticatedUntappdCredentials.cs b/src/Untappd.Net/Client/IAuthenticatedUntappdCredentials.cs new file mode 100644 index 0000000..de5ae68 --- /dev/null +++ b/src/Untappd.Net/Client/IAuthenticatedUntappdCredentials.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Untappd.Net.Client +{ + public interface IAuthenticatedUntappdCredentials : IUntappdCredentials + { + string AccessToken { get; } + } +} diff --git a/src/Untappd.Net/Constants.cs b/src/Untappd.Net/Constants.cs new file mode 100644 index 0000000..3c657a7 --- /dev/null +++ b/src/Untappd.Net/Constants.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Untappd.Net +{ + public struct Constants + { + public const string BaseRequestString = "https://api.untappd.com"; + } +} diff --git a/src/Untappd.Net/Request/AuthenticatedRequest.cs b/src/Untappd.Net/Request/AuthenticatedRequest.cs index dc0bd0a..4f012af 100644 --- a/src/Untappd.Net/Request/AuthenticatedRequest.cs +++ b/src/Untappd.Net/Request/AuthenticatedRequest.cs @@ -6,8 +6,17 @@ using System.Threading.Tasks; namespace Untappd.Net.Request { - public abstract class AuthenticatedRequest : BaseRequest + public abstract class AuthenticatedRequest { - protected override abstract string _EndPoint { get; } + protected abstract string _EndPoint { get; } + /// + /// Pass in the parameter into the request...ie username, brewery, etc. + /// + /// + /// + internal string EndPoint(string parameter) + { + return string.Format(_EndPoint, parameter); + } } } diff --git a/src/Untappd.Net/Request/BaseRequest.cs b/src/Untappd.Net/Request/BaseRequest.cs deleted file mode 100644 index 88ae8e6..0000000 --- a/src/Untappd.Net/Request/BaseRequest.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Untappd.Net.Request -{ - public abstract class BaseRequest - { - internal readonly string baseRequestString = "https://api.untappd.com"; - protected abstract string _EndPoint { get; } - /// - /// Pass in the parameter into the request...ie username, brewery, etc. - /// - /// - /// - internal string EndPoint(string parameter) - { - return string.Format(_EndPoint, parameter); - } - - } -} diff --git a/src/Untappd.Net/Request/Repository.cs b/src/Untappd.Net/Request/Repository.cs new file mode 100644 index 0000000..fcc6f01 --- /dev/null +++ b/src/Untappd.Net/Request/Repository.cs @@ -0,0 +1,49 @@ +using Newtonsoft.Json; +using RestSharp; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Untappd.Client.Net; +using Untappd.Net.Client; + +namespace Untappd.Net.Request +{ + public class Repository + { + /// + /// Get the things! + /// + /// What you want to request + /// Pass in a credentials object + /// this is the main parameter for a request. ie v4/user/checkins/urlParameter. Consult the untappd docs, this can be null for a few requests + /// Any additional params you wish to add to the request + /// + public TResult Get (IUntappdCredentials credentials, string urlParameter, IDictionary bodyParameters = null) + where TResult : UnAuthenticatedRequest,new() + { + // throw new NotImplementedException(); + var result = new TResult(); + var client = new RestClient(Constants.BaseRequestString); + var request = new RestRequest(result.EndPoint(urlParameter), Method.GET); + request.AddParameter("client_id", credentials.ClientId); + request.AddParameter("client_secret", credentials.ClientSecret); + if (bodyParameters != null) + foreach (var x in bodyParameters) + { + request.AddParameter(x.Key, x.Value); + } + var resp = client.Execute(request); + var jsonresult = JsonConvert.DeserializeObject(resp.Content); + return jsonresult; + + } + + public TResult Get(IAuthenticatedUntappdCredentials credentials, string parameter) + where TResult : AuthenticatedRequest, new() + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Untappd.Net/Request/Request.cs b/src/Untappd.Net/Request/Request.cs deleted file mode 100644 index fb776f1..0000000 --- a/src/Untappd.Net/Request/Request.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Newtonsoft.Json; -using RestSharp; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Untappd.Client.Net; -using Untappd.Net.Client; - -namespace Untappd.Net.Request -{ - public class Request - { - public TResult Get (T credentials, string parameter) - where T : IUntappdCredentials - where TResult : BaseRequest,new() - { - // throw new NotImplementedException(); - var result = new TResult(); - var client = new RestClient(result.baseRequestString); - var request = new RestRequest(result.EndPoint(parameter), Method.GET); - request.AddParameter("client_id", credentials.ClientId); - request.AddParameter("client_secret", credentials.ClientSecret); - var resp = client.Execute(request); - var jsonresult = JsonConvert.DeserializeObject(resp.Content); - return jsonresult; - - } - - public TResult GetAuth() - where T : AuthenticatedUntappdCredentials - where TResult : BaseRequest, new() - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Untappd.Net/Request/UnAuthenticatedRequest.cs b/src/Untappd.Net/Request/UnAuthenticatedRequest.cs new file mode 100644 index 0000000..3df95aa --- /dev/null +++ b/src/Untappd.Net/Request/UnAuthenticatedRequest.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Untappd.Net.Request +{ + public abstract class UnAuthenticatedRequest : AuthenticatedRequest + { + protected override abstract string _EndPoint { get; } + + } +} diff --git a/src/Untappd.Net/Responses/BeerInfo.cs b/src/Untappd.Net/Responses/BeerInfo.cs index 639f1b3..a7426dc 100644 --- a/src/Untappd.Net/Responses/BeerInfo.cs +++ b/src/Untappd.Net/Responses/BeerInfo.cs @@ -3,297 +3,871 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; using Untappd.Net.Request; namespace Untappd.Net.Responses.BeerInfo { - public class BeerInfoRootobject : BaseRequest + public class ResponseTime { - public Beer beer { get; set; } - protected override string _EndPoint { get { return "v4/beer/info/{0}"; } } + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Beer + public class InitTime { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public float beer_abv { get; set; } - public int beer_ibu { get; set; } - public string beer_description { get; set; } - public string beer_style { get; set; } - public int is_in_production { get; set; } - public string beer_slug { get; set; } - public int is_homebrew { get; set; } - public string created_at { get; set; } - public int rating_count { get; set; } - public float rating_score { get; set; } - public Stats stats { get; set; } - public Brewery brewery { get; set; } - public int auth_rating { get; set; } - public bool wish_list { get; set; } - public Media media { get; set; } - public Similar similar { get; set; } - public Friends1 friends { get; set; } - public Vintages vintages { get; set; } + + [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 Stats { - public int total_count { get; set; } - public int monthly_count { get; set; } - public int total_user_count { get; set; } - public int user_count { get; set; } - } - public class Brewery - { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact contact { get; set; } - public Location location { get; set; } + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + [JsonProperty("monthly_count")] + public int MonthlyCount { get; set; } + + [JsonProperty("total_user_count")] + public int TotalUserCount { get; set; } + + [JsonProperty("user_count")] + public int UserCount { get; set; } } public class Contact { - public string twitter { get; set; } - public string facebook { get; set; } - public string url { get; set; } + + [JsonProperty("twitter")] + public string Twitter { get; set; } + + [JsonProperty("facebook")] + public string Facebook { get; set; } + + [JsonProperty("url")] + public string Url { get; set; } } public class Location { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } + + [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 Media + public class Brewery { - public int count { get; set; } - public Items items { get; set; } - } - public class Items - { - public int photo_id { get; set; } - public Photo photo { get; set; } - public string created_at { get; set; } - public int checkin_id { get; set; } - public Beer1 beer { get; set; } - public Brewery1 brewery { get; set; } - public User user { get; set; } - public Venue[] venue { get; set; } + [JsonProperty("brewery_id")] + public int BreweryId { get; set; } + + [JsonProperty("brewery_name")] + public string BreweryName { 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; } } public class Photo { - public string photo_img_sm { get; set; } - public string photo_img_md { get; set; } - public string photo_img_lg { get; set; } - public string photo_img_og { get; set; } - } - public class Beer1 - { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public float beer_abv { get; set; } - public int beer_ibu { get; set; } - public string beer_slug { get; set; } - public string beer_description { get; set; } - public int is_in_production { get; set; } - public int beer_style_id { get; set; } - public string beer_style { get; set; } - public int auth_rating { get; set; } - public bool wish_list { get; set; } - public int beer_active { get; set; } - } + [JsonProperty("photo_img_sm")] + public string PhotoImgSm { get; set; } - public class Brewery1 - { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact1 contact { get; set; } - public Location1 location { get; set; } - public int brewery_active { get; set; } - } + [JsonProperty("photo_img_md")] + public string PhotoImgMd { get; set; } - public class Contact1 - { - public string twitter { get; set; } - public string facebook { get; set; } - public string url { get; set; } - } + [JsonProperty("photo_img_lg")] + public string PhotoImgLg { get; set; } - public class Location1 - { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } - } - - public class User - { - public int uid { get; set; } - public string user_name { get; set; } - public string first_name { get; set; } - public string last_name { get; set; } - public string user_avatar { get; set; } - public string relationship { get; set; } - public int is_private { get; set; } - } - - public class Venue - { - public int venue_id { get; set; } - public string venue_name { get; set; } - public string primary_category { get; set; } - public string parent_category_id { get; set; } - public Categories categories { get; set; } - public Location2 location { get; set; } - public Contact2 contact { get; set; } - public bool private_venue { get; set; } - public Foursquare foursquare { get; set; } - public Venue_Icon venue_icon { get; set; } - } - - public class Categories - { - public int count { get; set; } - public Item[] items { get; set; } - } - - public class Item - { - public string category_name { get; set; } - public string category_id { get; set; } - public bool is_primary { get; set; } - } - - public class Location2 - { - public string venue_address { get; set; } - public string venue_city { get; set; } - public string venue_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } - } - - public class Contact2 - { - public string twitter { get; set; } - public string venue_url { get; set; } - } - - public class Foursquare - { - public string foursquare_id { get; set; } - public string foursquare_url { get; set; } - } - - public class Venue_Icon - { - public string sm { get; set; } - public string md { get; set; } - public string lg { get; set; } - } - - public class Similar - { - public int count { get; set; } - public Items1 items { get; set; } - } - - public class Items1 - { - public float rating_score { get; set; } - public Beer2 beer { get; set; } - public Brewery2 brewery { get; set; } - public Friends friends { get; set; } + [JsonProperty("photo_img_og")] + public string PhotoImgOg { get; set; } } public class Beer2 { - public int bid { get; set; } - public string beer_name { get; set; } - public float beer_abv { get; set; } - public int beer_ibu { get; set; } - public string beer_style { get; set; } - public string beer_label { get; set; } - public int auth_rating { get; set; } - public bool wish_list { get; set; } + + [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_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_ibu")] + public int BeerIbu { get; set; } + + [JsonProperty("beer_slug")] + public string BeerSlug { get; set; } + + [JsonProperty("beer_description")] + public string BeerDescription { get; set; } + + [JsonProperty("is_in_production")] + public int IsInProduction { get; set; } + + [JsonProperty("beer_style_id")] + public int BeerStyleId { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { 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 Contact2 + { + + [JsonProperty("twitter")] + public string Twitter { get; set; } + + [JsonProperty("facebook")] + public string Facebook { get; set; } + + [JsonProperty("url")] + public string Url { get; set; } + } + + public class Location2 + { + + [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 Brewery2 { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact3 contact { get; set; } - public Location3 location { get; set; } - public int brewery_active { get; set; } + + [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 Contact2 Contact { get; set; } + + [JsonProperty("location")] + public Location2 Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { get; set; } } - public class Contact3 + public class User { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } + + [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("user_avatar")] + public string UserAvatar { get; set; } + + [JsonProperty("relationship")] + public string Relationship { get; set; } + + [JsonProperty("is_private")] + public int IsPrivate { get; set; } } - public class Location3 + public class Item { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } + + [JsonProperty("photo_id")] + public int PhotoId { get; set; } + + [JsonProperty("photo")] + public Photo Photo { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("checkin_id")] + public int CheckinId { get; set; } + + [JsonProperty("beer")] + public Beer2 Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery2 Brewery { get; set; } + + [JsonProperty("user")] + public User User { get; set; } + + [JsonProperty("venue")] + public IList Venue { get; set; } } - public class Friends + public class Media { - public object[] items { get; set; } - public int count { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } } - public class Friends1 + public class User2 { - public int count { get; set; } - public object[] items { get; set; } - } - public class Vintages - { - public int count { get; set; } - public Item1[] items { get; set; } - } + [JsonProperty("uid")] + public int Uid { get; set; } - public class Item1 - { - public Beer3 beer { 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("bio")] + public string Bio { get; set; } + + [JsonProperty("relationship")] + public object Relationship { get; set; } + + [JsonProperty("user_avatar")] + public string UserAvatar { get; set; } + + [JsonProperty("is_private")] + public int IsPrivate { get; set; } + + [JsonProperty("contact")] + public object Contact { get; set; } } public class Beer3 { - public int bid { get; set; } - public string beer_label { get; set; } - public string beer_slug { get; set; } - public string beer_name { get; set; } - public int is_vintage { get; set; } - public int is_variant { get; set; } + + [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_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_ibu")] + public int BeerIbu { get; set; } + + [JsonProperty("beer_slug")] + public string BeerSlug { get; set; } + + [JsonProperty("beer_description")] + public string BeerDescription { get; set; } + + [JsonProperty("is_in_production")] + public int IsInProduction { get; set; } + + [JsonProperty("beer_style_id")] + public int BeerStyleId { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { 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 Contact3 + { + + [JsonProperty("twitter")] + public string Twitter { get; set; } + + [JsonProperty("facebook")] + public string Facebook { get; set; } + + [JsonProperty("url")] + public string Url { get; set; } + } + + public class Location3 + { + + [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 Brewery3 + { + + [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 Contact3 Contact { get; set; } + + [JsonProperty("location")] + public Location3 Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { get; set; } + } + + public class Comments + { + + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Toasts + { + + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("auth_toast")] + public object AuthToast { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Photo2 + { + + [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 Item3 + { + + [JsonProperty("photo_id")] + public int PhotoId { get; set; } + + [JsonProperty("photo")] + public Photo2 Photo { get; set; } + } + + public class Media2 + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList 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 Item4 + { + + [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 Items { get; set; } + } + + public class Item2 + { + + [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 User2 User { get; set; } + + [JsonProperty("beer")] + public Beer3 Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery3 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 Media2 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 Items { get; set; } + } + + public class Beer4 + { + + [JsonProperty("bid")] + public int Bid { get; set; } + + [JsonProperty("beer_name")] + public string BeerName { get; set; } + + [JsonProperty("beer_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_ibu")] + public int BeerIbu { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { get; set; } + + [JsonProperty("beer_label")] + public string BeerLabel { get; set; } + + [JsonProperty("auth_rating")] + public int AuthRating { get; set; } + + [JsonProperty("wish_list")] + public bool WishList { get; set; } + } + + public class Contact4 + { + + [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 Location4 + { + + [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 Brewery4 + { + + [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 Contact4 Contact { get; set; } + + [JsonProperty("location")] + public Location4 Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { get; set; } + } + + public class Friends + { + + [JsonProperty("items")] + public IList Items { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + } + + public class Item5 + { + + [JsonProperty("rating_score")] + public double RatingScore { get; set; } + + [JsonProperty("beer")] + public Beer4 Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery4 Brewery { get; set; } + + [JsonProperty("friends")] + public Friends Friends { get; set; } + } + + public class Similar + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Friends2 + { + + [JsonProperty("items")] + public IList Items { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + } + + public class Beer5 + { + + [JsonProperty("bid")] + public int Bid { get; set; } + + [JsonProperty("beer_label")] + public string BeerLabel { get; set; } + + [JsonProperty("beer_slug")] + public string BeerSlug { get; set; } + + [JsonProperty("beer_name")] + public string BeerName { get; set; } + + [JsonProperty("is_vintage")] + public int IsVintage { get; set; } + + [JsonProperty("is_variant")] + public int IsVariant { get; set; } + } + + public class Item6 + { + + [JsonProperty("beer")] + public Beer5 Beer { get; set; } + } + + public class Vintages + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { 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_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_ibu")] + public int BeerIbu { get; set; } + + [JsonProperty("beer_description")] + public string BeerDescription { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { get; set; } + + [JsonProperty("is_in_production")] + public int IsInProduction { get; set; } + + [JsonProperty("beer_slug")] + public string BeerSlug { get; set; } + + [JsonProperty("is_homebrew")] + public int IsHomebrew { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("rating_count")] + public int RatingCount { get; set; } + + [JsonProperty("rating_score")] + public double RatingScore { get; set; } + + [JsonProperty("stats")] + public Stats Stats { get; set; } + + [JsonProperty("brewery")] + public Brewery Brewery { get; set; } + + [JsonProperty("auth_rating")] + public int AuthRating { get; set; } + + [JsonProperty("wish_list")] + public bool WishList { get; set; } + + [JsonProperty("media")] + public Media Media { get; set; } + + [JsonProperty("checkins")] + public Checkins Checkins { get; set; } + + [JsonProperty("similar")] + public Similar Similar { get; set; } + + [JsonProperty("friends")] + public Friends2 Friends { get; set; } + + [JsonProperty("vintages")] + public Vintages Vintages { get; set; } + } + + public class Response + { + + [JsonProperty("beer")] + public Beer Beer { get; set; } + } + + public class BeerInfo : UnAuthenticatedRequest + { + + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } + + protected override string _EndPoint + { + get { return "v4/beer/info/{0}"; } + } + } + + } diff --git a/src/Untappd.Net/Responses/BeerSearch.cs b/src/Untappd.Net/Responses/BeerSearch.cs index 0829fcd..7ec9c90 100644 --- a/src/Untappd.Net/Responses/BeerSearch.cs +++ b/src/Untappd.Net/Responses/BeerSearch.cs @@ -3,164 +3,411 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; using Untappd.Net.Request; namespace Untappd.Net.Responses.BeerSearch { - public class BeerSearchRootobject : BaseRequest + public class ResponseTime { - protected override string _EndPoint { get { return "v4/beer/info/{0}"; } } - public int found { get; set; } - public string term { get; set; } - public Beers beers { get; set; } - public Homebrew homebrew { get; set; } - public Breweries breweries { get; set; } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Beers + public class InitTime { - public int count { get; set; } - public Items items { get; set; } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Items + public class Meta { - public int checkin_count { get; set; } - public bool have_had { get; set; } - public int your_count { get; set; } - public Beer beer { get; set; } - public Brewery brewery { get; set; } + + [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 Beer { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public int beer_abv { get; set; } - public int beer_ibu { get; set; } - public string beer_description { get; set; } - public string created_at { get; set; } - public string beer_style { get; set; } - public int auth_rating { get; set; } - public bool wish_list { get; set; } - public int in_production { get; set; } - } - public class Brewery - { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact contact { get; set; } - public Location location { get; set; } - public int brewery_active { get; set; } + [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_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_ibu")] + public int BeerIbu { get; set; } + + [JsonProperty("beer_description")] + public string BeerDescription { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { get; set; } + + [JsonProperty("auth_rating")] + public int AuthRating { get; set; } + + [JsonProperty("wish_list")] + public bool WishList { get; set; } + + [JsonProperty("in_production")] + public int InProduction { get; set; } } public class Contact { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } + + [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 { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } + + [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 Homebrew + public class Brewery { - public int count { get; set; } - public Items1 items { get; set; } + + [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 Items1 + public class Item { - public int checkin_count { get; set; } - public bool have_had { get; set; } - public int your_count { get; set; } - public Beer1 beer { get; set; } - public Brewery1 brewery { get; set; } + + [JsonProperty("checkin_count")] + public int CheckinCount { get; set; } + + [JsonProperty("have_had")] + public bool HaveHad { get; set; } + + [JsonProperty("your_count")] + public int YourCount { get; set; } + + [JsonProperty("beer")] + public Beer Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery Brewery { get; set; } } - public class Beer1 + public class Beers { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public int beer_abv { get; set; } - public int beer_ibu { get; set; } - public string beer_description { get; set; } - public string created_at { get; set; } - public string beer_style { get; set; } - public int auth_rating { get; set; } - public bool wish_list { get; set; } - public int in_production { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } } - public class Brewery1 + public class Beer2 { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact1 contact { get; set; } - public Location1 location { get; set; } - public int brewery_active { get; set; } + + [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_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_ibu")] + public int BeerIbu { get; set; } + + [JsonProperty("beer_description")] + public string BeerDescription { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { get; set; } + + [JsonProperty("auth_rating")] + public int AuthRating { get; set; } + + [JsonProperty("wish_list")] + public bool WishList { get; set; } + + [JsonProperty("in_production")] + public int InProduction { get; set; } } - public class Contact1 + public class Contact2 { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } - } - public class Location1 - { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public int lat { get; set; } - public int lng { get; set; } - } + [JsonProperty("twitter")] + public string Twitter { get; set; } - public class Breweries - { - public int count { get; set; } - public Items2 items { get; set; } - } + [JsonProperty("facebook")] + public string Facebook { get; set; } - public class Items2 - { - public Brewery2 brewery { get; set; } - } + [JsonProperty("instagram")] + public string Instagram { get; set; } - public class Brewery2 - { - public int brewery_id { get; set; } - public int beer_count { get; set; } - public string brewery_name { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Location2 location { get; set; } + [JsonProperty("url")] + public string Url { get; set; } } public class Location2 { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public int lat { get; set; } - public int lng { get; set; } + + [JsonProperty("brewery_city")] + public string BreweryCity { get; set; } + + [JsonProperty("brewery_state")] + public string BreweryState { get; set; } + + [JsonProperty("lat")] + public int Lat { get; set; } + + [JsonProperty("lng")] + public int Lng { get; set; } + } + + public class Brewery2 + { + + [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 Contact2 Contact { get; set; } + + [JsonProperty("location")] + public Location2 Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { get; set; } + } + + public class Item2 + { + + [JsonProperty("checkin_count")] + public int CheckinCount { get; set; } + + [JsonProperty("have_had")] + public bool HaveHad { get; set; } + + [JsonProperty("your_count")] + public int YourCount { get; set; } + + [JsonProperty("beer")] + public Beer2 Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery2 Brewery { get; set; } + } + + public class Homebrew + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Location3 + { + + [JsonProperty("brewery_city")] + public string BreweryCity { get; set; } + + [JsonProperty("brewery_state")] + public string BreweryState { get; set; } + + [JsonProperty("lat")] + public int Lat { get; set; } + + [JsonProperty("lng")] + public int Lng { get; set; } + } + + public class Brewery3 + { + + [JsonProperty("brewery_id")] + public int BreweryId { get; set; } + + [JsonProperty("beer_count")] + public int BeerCount { get; set; } + + [JsonProperty("brewery_name")] + public string BreweryName { get; set; } + + [JsonProperty("brewery_label")] + public string BreweryLabel { get; set; } + + [JsonProperty("country_name")] + public string CountryName { get; set; } + + [JsonProperty("location")] + public Location3 Location { get; set; } + } + + public class Item3 + { + + [JsonProperty("brewery")] + public Brewery3 Brewery { get; set; } + } + + public class Breweries + { + + [JsonProperty("items")] + public IList Items { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + } + + public class Response + { + + [JsonProperty("message")] + public string Message { get; set; } + + [JsonProperty("brewery_id")] + public bool BreweryId { get; set; } + + [JsonProperty("search_type")] + public string SearchType { get; set; } + + [JsonProperty("type_id")] + public int TypeId { get; set; } + + [JsonProperty("search_version")] + public int SearchVersion { get; set; } + + [JsonProperty("found")] + public int Found { get; set; } + + [JsonProperty("offset")] + public int Offset { get; set; } + + [JsonProperty("limit")] + public int Limit { get; set; } + + [JsonProperty("term")] + public string Term { get; set; } + + [JsonProperty("parsed_term")] + public string ParsedTerm { get; set; } + + [JsonProperty("beers")] + public Beers Beers { get; set; } + + [JsonProperty("homebrew")] + public Homebrew Homebrew { get; set; } + + [JsonProperty("breweries")] + public Breweries Breweries { get; set; } + } + + public class BeerSearch : UnAuthenticatedRequest + { + + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } + + protected override string _EndPoint + { + get { return "v4/search/beer"; } + } } } diff --git a/src/Untappd.Net/Responses/BreweryInfo.cs b/src/Untappd.Net/Responses/BreweryInfo.cs index 5fb3060..b9e6ac6 100644 --- a/src/Untappd.Net/Responses/BreweryInfo.cs +++ b/src/Untappd.Net/Responses/BreweryInfo.cs @@ -3,228 +3,972 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; using Untappd.Net.Request; namespace Untappd.Net.Responses.BreweryInfo { - public class BreweryInfoRootobject : BaseRequest + public class ResponseTime { - protected override string _EndPoint { get { return "v4/brewery/info/{0}"; } } - public Brewery brewery { get; set; } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Brewery + public class InitTime { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public int brewery_in_production { get; set; } - public int is_independent { get; set; } - public Claimed_Status claimed_status { get; set; } - public int beer_count { get; set; } - public Contact contact { get; set; } - public string brewery_type { get; set; } - public int brewery_type_id { get; set; } - public Location location { get; set; } - public Rating rating { get; set; } - public string brewery_description { get; set; } - public Stats stats { get; set; } - public Owners owners { get; set; } - public Media media { get; set; } - public Beer_List beer_list { get; set; } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Claimed_Status + public class Meta { - public bool is_claimed { get; set; } - public string claimed_slug { get; set; } - public bool follow_status { get; set; } - public int follower_count { get; set; } - public int uid { get; set; } - public string mute_status { get; set; } + + [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 ClaimedStatus + { + + [JsonProperty("is_claimed")] + public bool IsClaimed { get; set; } + + [JsonProperty("claimed_slug")] + public string ClaimedSlug { get; set; } + + [JsonProperty("follow_status")] + public bool FollowStatus { get; set; } + + [JsonProperty("follower_count")] + public int FollowerCount { get; set; } + + [JsonProperty("uid")] + public int Uid { get; set; } + + [JsonProperty("mute_status")] + public string MuteStatus { get; set; } } public class Contact { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } + + [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 { - public string brewery_address { get; set; } - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float brewery_lat { get; set; } - public float brewery_lng { get; set; } + + [JsonProperty("brewery_address")] + public string BreweryAddress { get; set; } + + [JsonProperty("brewery_city")] + public string BreweryCity { get; set; } + + [JsonProperty("brewery_state")] + public string BreweryState { get; set; } + + [JsonProperty("brewery_lat")] + public double BreweryLat { get; set; } + + [JsonProperty("brewery_lng")] + public double BreweryLng { get; set; } } public class Rating { - public int count { get; set; } - public float rating_score { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("rating_score")] + public double RatingScore { get; set; } } public class Stats { - public int total_count { get; set; } - public int unique_count { get; set; } - public int monthly_count { get; set; } - public int weekly_count { get; set; } - public int user_count { get; set; } - public float age_on_service { get; set; } + + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + [JsonProperty("unique_count")] + public int UniqueCount { get; set; } + + [JsonProperty("monthly_count")] + public int MonthlyCount { get; set; } + + [JsonProperty("weekly_count")] + public int WeeklyCount { get; set; } + + [JsonProperty("user_count")] + public int UserCount { get; set; } + + [JsonProperty("age_on_service")] + public double AgeOnService { get; set; } } public class Owners { - public int count { get; set; } - public object[] items { get; set; } - } - public class Media - { - public int count { get; set; } - public Items items { get; set; } - } + [JsonProperty("count")] + public int Count { get; set; } - public class Items - { - public int photo_id { get; set; } - public Photo photo { get; set; } - public string created_at { get; set; } - public int checkin_id { get; set; } - public Beer beer { get; set; } - public Brewery1 brewery { get; set; } - public User user { get; set; } - public object[] venue { get; set; } + [JsonProperty("items")] + public IList Items { get; set; } } public class Photo { - public string photo_img_sm { get; set; } - public string photo_img_md { get; set; } - public string photo_img_lg { get; set; } - public string photo_img_og { get; set; } + + [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 Beer { - public int bid { get; set; } - public string beer_name { get; set; } - public float beer_abv { get; set; } - public string beer_label { get; set; } - public string beer_style { get; set; } - public int auth_rating { get; set; } - public bool wish_list { get; set; } - } - public class Brewery1 - { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact1 contact { get; set; } - public Location1 location { get; set; } - public int brewery_active { get; set; } - } + [JsonProperty("bid")] + public int Bid { get; set; } - public class Contact1 - { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } - } + [JsonProperty("beer_name")] + public string BeerName { get; set; } - public class Location1 - { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } - } + [JsonProperty("beer_abv")] + public double BeerAbv { get; set; } - public class User - { - public int uid { get; set; } - public string user_name { get; set; } - public string first_name { get; set; } - public string last_name { get; set; } - public string user_avatar { get; set; } - public string relationship { get; set; } - public int is_private { get; set; } - } + [JsonProperty("beer_label")] + public string BeerLabel { get; set; } - public class Beer_List - { - public bool is_super { get; set; } - public string sort { get; set; } - public string filter { get; set; } - public int count { get; set; } - public Items1 items { get; set; } - public int beer_count { get; set; } - } + [JsonProperty("beer_style")] + public string BeerStyle { get; set; } - public class Items1 - { - public bool has_had { get; set; } - public int total_count { get; set; } - public Beer1 beer { get; set; } - public Brewery2 brewery { get; set; } - public object[] friends { get; set; } - } + [JsonProperty("auth_rating")] + public int AuthRating { get; set; } - public class Beer1 - { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public string beer_style { get; set; } - public float beer_abv { get; set; } - public int beer_ibu { get; set; } - public string beer_slug { get; set; } - public string beer_description { get; set; } - public int is_in_production { get; set; } - public string created_at { get; set; } - public int auth_rating { get; set; } - public bool wish_list { get; set; } - public float rating_score { get; set; } - public int rating_count { get; set; } - } - - public class Brewery2 - { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact2 contact { get; set; } - public Location2 location { get; set; } - public int brewery_active { get; set; } + [JsonProperty("wish_list")] + public bool WishList { get; set; } } public class Contact2 { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } + + [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 Location2 { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } + + [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 Brewery2 + { + + [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 Contact2 Contact { get; set; } + + [JsonProperty("location")] + public Location2 Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { 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("user_avatar")] + public string UserAvatar { get; set; } + + [JsonProperty("relationship")] + public string Relationship { get; set; } + + [JsonProperty("is_private")] + public int IsPrivate { get; set; } + } + + public class Item + { + + [JsonProperty("photo_id")] + public int PhotoId { get; set; } + + [JsonProperty("photo")] + public Photo Photo { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("checkin_id")] + public int CheckinId { get; set; } + + [JsonProperty("beer")] + public Beer Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery2 Brewery { get; set; } + + [JsonProperty("user")] + public User User { get; set; } + + [JsonProperty("venue")] + public object Venue { get; set; } + } + + public class Media + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { 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("location")] + public string Location { get; set; } + + [JsonProperty("url")] + public string Url { get; set; } + + [JsonProperty("is_supporter")] + public int IsSupporter { get; set; } + + [JsonProperty("bio")] + public string Bio { get; set; } + + [JsonProperty("relationship")] + public object Relationship { get; set; } + + [JsonProperty("user_avatar")] + public string UserAvatar { get; set; } + + [JsonProperty("is_private")] + public int IsPrivate { get; set; } + + [JsonProperty("contact")] + public object Contact { get; set; } + } + + public class Beer2 + { + + [JsonProperty("bid")] + public int Bid { get; set; } + + [JsonProperty("beer_name")] + public string BeerName { get; set; } + + [JsonProperty("beer_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_label")] + public string BeerLabel { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { 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 Contact3 + { + + [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 Location3 + { + + [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 Brewery3 + { + + [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 Contact3 Contact { get; set; } + + [JsonProperty("location")] + public Location3 Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { 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("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 BreweryDetails { get; set; } + } + + public class Item3 + { + + [JsonProperty("user")] + public User3 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 Items { get; set; } + } + + public class User4 + { + + [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 BreweryDetails { get; set; } + } + + public class Item4 + { + + [JsonProperty("uid")] + public int Uid { get; set; } + + [JsonProperty("user")] + public User4 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 object AuthToast { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Photo2 + { + + [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 Item5 + { + + [JsonProperty("photo_id")] + public int PhotoId { get; set; } + + [JsonProperty("photo")] + public Photo2 Photo { get; set; } + } + + public class Media2 + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList 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 Item6 + { + + [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 Items { get; set; } + } + + public class Item2 + { + + [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 User2 User { get; set; } + + [JsonProperty("beer")] + public Beer2 Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery3 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 Media2 Media { get; set; } + + [JsonProperty("source")] + public Source Source { get; set; } + + [JsonProperty("badges")] + public Badges Badges { get; set; } + } + + public class Checkins + { + + [JsonProperty("mem")] + public bool Mem { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Beer3 + { + + [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("beer_ibu")] + public int BeerIbu { get; set; } + + [JsonProperty("beer_slug")] + public string BeerSlug { get; set; } + + [JsonProperty("beer_description")] + public string BeerDescription { get; set; } + + [JsonProperty("is_in_production")] + public int IsInProduction { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("auth_rating")] + public int AuthRating { get; set; } + + [JsonProperty("wish_list")] + public bool WishList { get; set; } + + [JsonProperty("rating_score")] + public double RatingScore { get; set; } + + [JsonProperty("rating_count")] + public int RatingCount { get; set; } + } + + public class Contact4 + { + + [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 Location4 + { + + [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 Brewery4 + { + + [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 Contact4 Contact { get; set; } + + [JsonProperty("location")] + public Location4 Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { get; set; } + } + + public class Friends + { + + [JsonProperty("items")] + public IList Items { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + } + + public class Item7 + { + + [JsonProperty("has_had")] + public object HasHad { get; set; } + + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + [JsonProperty("beer")] + public Beer3 Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery4 Brewery { get; set; } + + [JsonProperty("friends")] + public Friends Friends { get; set; } + } + + public class BeerList + { + + [JsonProperty("is_super")] + public bool IsSuper { get; set; } + + [JsonProperty("sort")] + public string Sort { get; set; } + + [JsonProperty("filter")] + public string Filter { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + + [JsonProperty("beer_count")] + public int BeerCount { 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("brewery_in_production")] + public int BreweryInProduction { get; set; } + + [JsonProperty("is_independent")] + public int IsIndependent { get; set; } + + [JsonProperty("claimed_status")] + public ClaimedStatus ClaimedStatus { get; set; } + + [JsonProperty("beer_count")] + public int BeerCount { get; set; } + + [JsonProperty("contact")] + public Contact Contact { get; set; } + + [JsonProperty("brewery_type")] + public string BreweryType { get; set; } + + [JsonProperty("brewery_type_id")] + public int BreweryTypeId { get; set; } + + [JsonProperty("location")] + public Location Location { get; set; } + + [JsonProperty("rating")] + public Rating Rating { get; set; } + + [JsonProperty("brewery_description")] + public string BreweryDescription { get; set; } + + [JsonProperty("stats")] + public Stats Stats { get; set; } + + [JsonProperty("owners")] + public Owners Owners { get; set; } + + [JsonProperty("media")] + public Media Media { get; set; } + + [JsonProperty("checkins")] + public Checkins Checkins { get; set; } + + [JsonProperty("beer_list")] + public BeerList BeerList { get; set; } + } + + public class Response + { + + [JsonProperty("brewery")] + public Brewery Brewery { get; set; } + } + + public class BreweryInfo : UnAuthenticatedRequest + { + protected override string _EndPoint { get { return "v4/brewery/info/{0}"; } } + + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } + } } diff --git a/src/Untappd.Net/Responses/BrewerySearch.cs b/src/Untappd.Net/Responses/BrewerySearch.cs index 9d7f80f..8032909 100644 --- a/src/Untappd.Net/Responses/BrewerySearch.cs +++ b/src/Untappd.Net/Responses/BrewerySearch.cs @@ -3,45 +3,138 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; using Untappd.Net.Request; namespace Untappd.Net.Responses.BrewerySearch { - public class BrewerySearchRootobject : BaseRequest + public class ResponseTime { - public int found { get; set; } - public Brewery brewery { get; set; } - protected override string _EndPoint { get { return "v4/search/beer/{0}"; } } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Brewery + public class InitTime { - public int count { get; set; } - public Items items { get; set; } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Items + public class Meta { - public Brewery1 brewery { get; set; } - } - public class Brewery1 - { - public int brewery_id { get; set; } - public int beer_count { get; set; } - public string brewery_name { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Location location { get; set; } + [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 Location { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public int lat { get; set; } - public int lng { get; set; } + + [JsonProperty("brewery_city")] + public string BreweryCity { get; set; } + + [JsonProperty("brewery_state")] + public string BreweryState { get; set; } + + [JsonProperty("lat")] + public int Lat { get; set; } + + [JsonProperty("lng")] + public int Lng { get; set; } + } + + public class Brewery2 + { + + [JsonProperty("brewery_id")] + public int BreweryId { get; set; } + + [JsonProperty("beer_count")] + public int BeerCount { get; set; } + + [JsonProperty("brewery_name")] + public string BreweryName { get; set; } + + [JsonProperty("brewery_label")] + public string BreweryLabel { get; set; } + + [JsonProperty("country_name")] + public string CountryName { get; set; } + + [JsonProperty("location")] + public Location Location { get; set; } + } + + public class Item + { + + [JsonProperty("brewery")] + public Brewery2 Brewery { get; set; } + } + + public class Brewery + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Response + { + + [JsonProperty("search_type")] + public string SearchType { get; set; } + + [JsonProperty("sort")] + public string Sort { get; set; } + + [JsonProperty("term")] + public string Term { get; set; } + + [JsonProperty("key")] + public string Key { get; set; } + + [JsonProperty("found")] + public int Found { get; set; } + + [JsonProperty("brewery")] + public Brewery Brewery { get; set; } + } + + public class BrewerySearch : UnAuthenticatedRequest + { + + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } + + protected override string _EndPoint + { + get { return "v4/search/brewery"; } + } } } diff --git a/src/Untappd.Net/Responses/Feeds/UserActivityFeed.cs b/src/Untappd.Net/Responses/Feeds/UserActivityFeed.cs new file mode 100644 index 0000000..ebc4ce3 --- /dev/null +++ b/src/Untappd.Net/Responses/Feeds/UserActivityFeed.cs @@ -0,0 +1,448 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Untappd.Net.Request; + +namespace Untappd.Net.Responses.Feeds +{ + 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 Pagination + { + + [JsonProperty("since_url")] + public string SinceUrl { get; set; } + + [JsonProperty("next_url")] + public string NextUrl { get; set; } + + [JsonProperty("max_id")] + public int MaxId { get; set; } + } + + public class Contact + { + + [JsonProperty("facebook")] + public int Facebook { get; set; } + + [JsonProperty("twitter")] + public string Twitter { 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("is_supporter")] + public int IsSupporter { get; set; } + + [JsonProperty("url")] + public string Url { get; set; } + + [JsonProperty("bio")] + public string Bio { get; set; } + + [JsonProperty("relationship")] + public object Relationship { get; set; } + + [JsonProperty("user_avatar")] + public string UserAvatar { get; set; } + + [JsonProperty("is_private")] + public int IsPrivate { get; set; } + + [JsonProperty("contact")] + public Contact Contact { 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 Contact2 + { + + [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 Contact2 Contact { get; set; } + + [JsonProperty("location")] + public Location Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { get; set; } + } + + public class Comments + { + + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { 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("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 object BreweryDetails { get; set; } + } + + public class Item2 + { + + [JsonProperty("uid")] + public int Uid { get; set; } + + [JsonProperty("user")] + public User2 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 object AuthToast { get; set; } + + [JsonProperty("items")] + public IList 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 Item3 + { + + [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 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 Item4 + { + + [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 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 Items { get; set; } + } + + public class Response + { + + [JsonProperty("pagination")] + public Pagination Pagination { get; set; } + + [JsonProperty("checkins")] + public Checkins Checkins { get; set; } + } + + public class UserActivityFeed : UnAuthenticatedRequest + { + + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } + + protected override string _EndPoint + { + get { return "v4/user/checkins/{0}"; } + } + } +} diff --git a/src/Untappd.Net/Responses/UserBadges.cs b/src/Untappd.Net/Responses/UserBadges.cs index 43fc4e2..8e773fe 100644 --- a/src/Untappd.Net/Responses/UserBadges.cs +++ b/src/Untappd.Net/Responses/UserBadges.cs @@ -3,64 +3,145 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; using Untappd.Net.Request; namespace Untappd.Net.Responses.UserBadges { - public class UserBadgesRootobject : BaseRequest + public class ResponseTime { - public string type { get; set; } - public string sort { get; set; } - public int count { get; set; } - public Item[] items { get; set; } - protected override string _EndPoint { get { return "v4/user/badges/{0}"; } } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Item + public class InitTime { - public int user_badge_id { get; set; } - public int badge_id { get; set; } - public int checkin_id { get; set; } - public string badge_name { get; set; } - public string badge_description { get; set; } - public int badge_active_status { get; set; } - public Media media { get; set; } - public string created_at { get; set; } - public bool is_level { get; set; } - public int category_id { get; set; } - public Levels levels { get; set; } + + [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 Media { - public string badge_image_sm { get; set; } - public string badge_image_md { get; set; } - public string badge_image_lg { get; set; } + + [JsonProperty("badge_image_sm")] + public string BadgeImageSm { get; set; } + + [JsonProperty("badge_image_md")] + public string BadgeImageMd { get; set; } + + [JsonProperty("badge_image_lg")] + public string BadgeImageLg { get; set; } } - public class Levels + public class BadgePackProgress { - public int count { get; set; } - public Item1[] items { get; set; } + + [JsonProperty("completed")] + public int Completed { get; set; } + + [JsonProperty("total")] + public int Total { get; set; } } - public class Item1 + public class Item { - public int actual_badge_id { get; set; } - public int badge_id { get; set; } - public int checkin_id { get; set; } - public string badge_name { get; set; } - public string badge_description { get; set; } - public Media1 media { get; set; } - public string created_at { get; set; } + + [JsonProperty("badge_id")] + public int BadgeId { get; set; } + + [JsonProperty("user_badge_id")] + public int UserBadgeId { get; set; } + + [JsonProperty("checkin_id")] + public int CheckinId { get; set; } + + [JsonProperty("badge_name")] + public string BadgeName { get; set; } + + [JsonProperty("badge_description")] + public string BadgeDescription { get; set; } + + [JsonProperty("badge_hint")] + public string BadgeHint { get; set; } + + [JsonProperty("badge_active_status")] + public int BadgeActiveStatus { get; set; } + + [JsonProperty("media")] + public Media Media { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("is_level")] + public bool IsLevel { get; set; } + + [JsonProperty("category_id")] + public int CategoryId { get; set; } + + [JsonProperty("levels")] + public object Levels { get; set; } + + [JsonProperty("badge_pack")] + public int BadgePack { get; set; } + + [JsonProperty("badge_pack_name")] + public bool BadgePackName { get; set; } + + [JsonProperty("badge_pack_progress")] + public BadgePackProgress BadgePackProgress { get; set; } } - public class Media1 + public class Response { - public string badge_image_sm { get; set; } - public string badge_image_md { get; set; } - public string badge_image_lg { get; set; } + + [JsonProperty("type")] + public string Type { get; set; } + + [JsonProperty("sort")] + public string Sort { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } } + public class UserBadges : UnAuthenticatedRequest + { + protected override string _EndPoint { get { return "v4/user/badges/{0}"; } } + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } + } + + } diff --git a/src/Untappd.Net/Responses/UserDistinctBeer.cs b/src/Untappd.Net/Responses/UserDistinctBeer.cs index e6f3fa9..da78330 100644 --- a/src/Untappd.Net/Responses/UserDistinctBeer.cs +++ b/src/Untappd.Net/Responses/UserDistinctBeer.cs @@ -3,81 +3,224 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; using Untappd.Net.Request; namespace Untappd.Net.Responses.UserDistinctBeer { - public class UserDistinctBeerRootobject : BaseRequest + public class ResponseTime { - public Beers beers { get; set; } - protected override string _EndPoint { get { throw new NotImplementedException(); } } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Beers + public class InitTime { - public string sort { get; set; } - public string sort_english { get; set; } - public int count { get; set; } - public Items items { get; set; } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Items + public class Meta { - public int first_checkin_id { get; set; } - public string first_created_at { get; set; } - public int recent_checkin_id { get; set; } - public string recent_created_at { get; set; } - public string recent_created_at_timezone { get; set; } - public float rating_score { get; set; } - public string first_had { get; set; } - public int count { get; set; } - public Beer beer { get; set; } - public Brewery brewery { get; set; } + + [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 Beer { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public float beer_abv { get; set; } - public int beer_ibu { get; set; } - public string beer_slug { get; set; } - public string beer_style { get; set; } - public string beer_description { get; set; } - public string created_at { get; set; } - public float auth_rating { get; set; } - public bool wish_list { get; set; } - public float rating_score { get; set; } - } - public class Brewery - { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact contact { get; set; } - public Location location { get; set; } - public int brewery_active { get; set; } + [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_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_ibu")] + public int BeerIbu { get; set; } + + [JsonProperty("beer_slug")] + public string BeerSlug { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { get; set; } + + [JsonProperty("beer_description")] + public string BeerDescription { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("auth_rating")] + public int AuthRating { get; set; } + + [JsonProperty("wish_list")] + public bool WishList { get; set; } + + [JsonProperty("rating_score")] + public double RatingScore { get; set; } + + [JsonProperty("rating_count")] + public int RatingCount { get; set; } } public class Contact { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } + + [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 { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } + + [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 Item + { + + [JsonProperty("first_checkin_id")] + public int FirstCheckinId { get; set; } + + [JsonProperty("first_created_at")] + public string FirstCreatedAt { get; set; } + + [JsonProperty("recent_checkin_id")] + public int RecentCheckinId { get; set; } + + [JsonProperty("recent_created_at")] + public string RecentCreatedAt { get; set; } + + [JsonProperty("recent_created_at_timezone")] + public string RecentCreatedAtTimezone { get; set; } + + [JsonProperty("rating_score")] + public double RatingScore { get; set; } + + [JsonProperty("first_had")] + public string FirstHad { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("beer")] + public Beer Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery Brewery { get; set; } + } + + public class Beers + { + + [JsonProperty("sort")] + public string Sort { get; set; } + + [JsonProperty("sort_english")] + public string SortEnglish { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Response + { + + [JsonProperty("is_search")] + public bool IsSearch { get; set; } + + [JsonProperty("beers")] + public Beers Beers { get; set; } + } + + public class UserDistinctBeers : UnAuthenticatedRequest + { + + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } + + protected override string _EndPoint + { + get { return "v4/user/beers/{0}"; } + } } } diff --git a/src/Untappd.Net/Responses/UserFriends.cs b/src/Untappd.Net/Responses/UserFriends.cs index 6dac2b4..9e17775 100644 --- a/src/Untappd.Net/Responses/UserFriends.cs +++ b/src/Untappd.Net/Responses/UserFriends.cs @@ -3,43 +3,123 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; using Untappd.Net.Request; namespace Untappd.Net.Responses.UserFriends { - public class UserFriendsRootobject : BaseRequest + public class ResponseTime { - protected override string _EndPoint { get { return "v4/user/friends/{0}"; } } - public int count { get; set; } - public Item[] items { get; set; } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Item + public class InitTime { - public string friendship_hash { get; set; } - public string created_at { get; set; } - public User user { get; set; } - public Mutual_Friends mutual_friends { get; set; } + + [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 User { - public int uid { get; set; } - public string user_name { get; set; } - public string location { get; set; } - public string bio { get; set; } - public int is_supporter { get; set; } - public string first_name { get; set; } - public string last_name { get; set; } - public string relationship { get; set; } - public string user_avatar { get; set; } + + [JsonProperty("uid")] + public int Uid { get; set; } + + [JsonProperty("user_name")] + public string UserName { get; set; } + + [JsonProperty("location")] + public string Location { get; set; } + + [JsonProperty("bio")] + public string Bio { get; set; } + + [JsonProperty("is_supporter")] + public int IsSupporter { get; set; } + + [JsonProperty("first_name")] + public string FirstName { get; set; } + + [JsonProperty("last_name")] + public string LastName { get; set; } + + [JsonProperty("relationship")] + public string Relationship { get; set; } + + [JsonProperty("user_avatar")] + public string UserAvatar { get; set; } } - public class Mutual_Friends + public class MutualFriends { - public int count { get; set; } - public object[] items { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Item + { + + [JsonProperty("friendship_hash")] + public string FriendshipHash { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("user")] + public User User { get; set; } + + [JsonProperty("mutual_friends")] + public MutualFriends MutualFriends { get; set; } + } + + public class Response + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class UserFriends : UnAuthenticatedRequest + { + protected override string _EndPoint { get { return "v4/user/friends/{0}"; } } + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } } } diff --git a/src/Untappd.Net/Responses/UserInfo.cs b/src/Untappd.Net/Responses/UserInfo.cs index 22f6a1e..6e1650d 100644 --- a/src/Untappd.Net/Responses/UserInfo.cs +++ b/src/Untappd.Net/Responses/UserInfo.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; using Untappd.Net.Request; namespace Untappd.Net.Responses.UserInfo @@ -10,465 +11,811 @@ namespace Untappd.Net.Responses.UserInfo public class ResponseTime { - public double time { get; set; } - public string measure { get; set; } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } public class InitTime { - public double time { get; set; } - public string measure { get; set; } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } public class Meta { - public int code { get; set; } - public ResponseTime response_time { get; set; } - public InitTime init_time { get; set; } + + [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 Stats { - public int total_badges { get; set; } - public int total_friends { get; set; } - public int total_checkins { get; set; } - public int total_beers { get; set; } - public int total_created_beers { get; set; } - public int total_followings { get; set; } - public int total_photos { get; set; } + + [JsonProperty("total_badges")] + public int TotalBadges { get; set; } + + [JsonProperty("total_friends")] + public int TotalFriends { get; set; } + + [JsonProperty("total_checkins")] + public int TotalCheckins { get; set; } + + [JsonProperty("total_beers")] + public int TotalBeers { get; set; } + + [JsonProperty("total_created_beers")] + public int TotalCreatedBeers { get; set; } + + [JsonProperty("total_followings")] + public int TotalFollowings { get; set; } + + [JsonProperty("total_photos")] + public int TotalPhotos { get; set; } } public class Beer { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public double beer_abv { get; set; } - public string beer_description { get; set; } - public string beer_style { get; set; } - public double auth_rating { get; set; } - public bool wish_list { get; set; } + + [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_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_description")] + public string BeerDescription { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { get; set; } + + [JsonProperty("auth_rating")] + public double AuthRating { get; set; } + + [JsonProperty("wish_list")] + public bool WishList { get; set; } } public class Contact { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } + + [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 { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public double lat { get; set; } - public double lng { get; set; } + + [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 { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact contact { get; set; } - public Location location { get; set; } - public int brewery_active { get; set; } + + [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 Item { - public Beer beer { get; set; } - public Brewery brewery { get; set; } + + [JsonProperty("beer")] + public Beer Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery Brewery { get; set; } } public class RecentBrews { - public int count { get; set; } - public List items { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } } public class Contact2 { - public int foursquare { get; set; } - public string twitter { get; set; } - public int facebook { get; set; } + + [JsonProperty("facebook")] + public int Facebook { get; set; } + + [JsonProperty("twitter")] + public string Twitter { get; set; } } public class User2 { - public int uid { get; set; } - public string user_name { get; set; } - public string first_name { get; set; } - public string last_name { get; set; } - public string location { get; set; } - public int is_supporter { get; set; } - public string url { get; set; } - public string bio { get; set; } - public object relationship { get; set; } - public string user_avatar { get; set; } - public int is_private { get; set; } - public Contact2 contact { get; set; } + + [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("is_supporter")] + public int IsSupporter { get; set; } + + [JsonProperty("url")] + public string Url { get; set; } + + [JsonProperty("bio")] + public string Bio { get; set; } + + [JsonProperty("relationship")] + public object Relationship { get; set; } + + [JsonProperty("user_avatar")] + public string UserAvatar { get; set; } + + [JsonProperty("is_private")] + public int IsPrivate { get; set; } + + [JsonProperty("contact")] + public Contact2 Contact { get; set; } } public class Beer2 { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public string beer_style { get; set; } - public double beer_abv { get; set; } - public int auth_rating { get; set; } - public bool wish_list { get; set; } - public int beer_active { get; set; } + + [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 Contact3 { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } + + [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 Location2 { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public double lat { get; set; } - public double lng { get; set; } + + [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 Brewery2 { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact3 contact { get; set; } - public Location2 location { get; set; } - public int brewery_active { get; set; } - } - public class Item3 - { - public string category_name { get; set; } - public string category_id { get; set; } - public bool is_primary { get; set; } - } + [JsonProperty("brewery_id")] + public int BreweryId { get; set; } - public class Categories - { - public int count { get; set; } - public List items { get; set; } - } + [JsonProperty("brewery_name")] + public string BreweryName { get; set; } - public class Location3 - { - public string venue_address { get; set; } - public string venue_city { get; set; } - public string venue_state { get; set; } - public string venue_country { get; set; } - public double lat { get; set; } - public double lng { get; set; } - } + [JsonProperty("brewery_slug")] + public string BrewerySlug { get; set; } - public class Contact4 - { - public string twitter { get; set; } - public string venue_url { get; set; } - } + [JsonProperty("brewery_label")] + public string BreweryLabel { get; set; } - public class Foursquare - { - public string foursquare_id { get; set; } - public string foursquare_url { get; set; } - } + [JsonProperty("country_name")] + public string CountryName { get; set; } - public class VenueIcon - { - public string sm { get; set; } - public string md { get; set; } - public string lg { get; set; } - } + [JsonProperty("contact")] + public Contact3 Contact { get; set; } - public class Venue - { - public int venue_id { get; set; } - public string venue_name { get; set; } - public string primary_category { get; set; } - public string parent_category_id { get; set; } - public Categories categories { get; set; } - public Location3 location { get; set; } - public Contact4 contact { get; set; } - public bool public_venue { get; set; } - public Foursquare foursquare { get; set; } - public VenueIcon venue_icon { get; set; } + [JsonProperty("location")] + public Location2 Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { get; set; } } public class Comments { - public int total_count { get; set; } - public int count { get; set; } - public List items { get; set; } + + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } } public class User3 { - public int uid { get; set; } - public string user_name { get; set; } - public string first_name { get; set; } - public string last_name { get; set; } - public string bio { get; set; } - public string location { get; set; } - public string user_avatar { get; set; } - public string user_link { get; set; } - public string account_type { get; set; } - public List brewery_details { get; set; } + + [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 object BreweryDetails { get; set; } } - public class Item4 + public class Item3 { - public int uid { get; set; } - public User3 user { get; set; } - public int like_id { get; set; } - public bool like_owner { get; set; } - public string created_at { get; set; } + + [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 { - public int total_count { get; set; } - public int count { get; set; } - public object auth_toast { get; set; } - public List items { get; set; } - } - public class Media - { - public int count { get; set; } - public List items { get; set; } - } + [JsonProperty("total_count")] + public int TotalCount { get; set; } - public class Source - { - public string app_name { get; set; } - public string app_website { get; set; } - } + [JsonProperty("count")] + public int Count { get; set; } - public class Badges - { - public int count { get; set; } - public List items { get; set; } - } + [JsonProperty("auth_toast")] + public object AuthToast { get; set; } - public class Item2 - { - public int checkin_id { get; set; } - public string created_at { get; set; } - public string checkin_comment { get; set; } - public double rating_score { get; set; } - public User2 user { get; set; } - public Beer2 beer { get; set; } - public Brewery2 brewery { get; set; } - public Venue venue { get; set; } - public Comments comments { get; set; } - public Toasts toasts { get; set; } - public Media media { get; set; } - public Source source { get; set; } - public Badges badges { get; set; } - } - - public class Checkins - { - public int count { get; set; } - public List items { get; set; } + [JsonProperty("items")] + public IList Items { get; set; } } public class Photo { - public string photo_img_sm { get; set; } - public string photo_img_md { get; set; } - public string photo_img_lg { get; set; } - public string photo_img_og { get; set; } + + [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 User4 + public class Item4 { - public int uid { get; set; } - public string user_name { get; set; } - public string location { get; set; } - public string bio { get; set; } - public string first_name { get; set; } - public string last_name { get; set; } - public string user_avatar { get; set; } - public string account_type { get; set; } - public string url { get; set; } + + [JsonProperty("photo_id")] + public int PhotoId { get; set; } + + [JsonProperty("photo")] + public Photo Photo { get; set; } } - public class Beer3 + public class Media { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public double beer_abv { get; set; } - public string beer_style { get; set; } - public string beer_description { get; set; } - public double auth_rating { get; set; } - public bool wish_list { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } } - public class Contact5 + public class Source { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } + + [JsonProperty("app_name")] + public string AppName { get; set; } + + [JsonProperty("app_website")] + public string AppWebsite { get; set; } } - public class Location4 + public class BadgeImage { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public double lat { get; set; } - public double lng { get; set; } - } - public class Brewery3 - { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact5 contact { get; set; } - public Location4 location { get; set; } - public int brewery_active { get; set; } - } + [JsonProperty("sm")] + public string Sm { get; set; } - public class Item6 - { - public string category_name { get; set; } - public string category_id { get; set; } - public bool is_primary { get; set; } - } + [JsonProperty("md")] + public string Md { get; set; } - public class Categories2 - { - public int count { get; set; } - public List items { get; set; } - } - - public class Location5 - { - public string venue_address { get; set; } - public string venue_city { get; set; } - public string venue_state { get; set; } - public string venue_country { get; set; } - public double lat { get; set; } - public double lng { get; set; } - } - - public class Contact6 - { - public string twitter { get; set; } - public string venue_url { get; set; } - } - - public class Foursquare2 - { - public string foursquare_id { get; set; } - public string foursquare_url { get; set; } - } - - public class VenueIcon2 - { - public string sm { get; set; } - public string md { get; set; } - public string lg { get; set; } - } - - public class Venue2 - { - public int venue_id { get; set; } - public string venue_name { get; set; } - public string primary_category { get; set; } - public string parent_category_id { get; set; } - public Categories2 categories { get; set; } - public Location5 location { get; set; } - public Contact6 contact { get; set; } - public bool public_venue { get; set; } - public Foursquare2 foursquare { get; set; } - public VenueIcon2 venue_icon { get; set; } + [JsonProperty("lg")] + public string Lg { get; set; } } public class Item5 { - public int photo_id { get; set; } - public Photo photo { get; set; } - public string created_at { get; set; } - public int checkin_id { get; set; } - public User4 user { get; set; } - public Beer3 beer { get; set; } - public Brewery3 brewery { get; set; } - public Venue2 venue { get; set; } + + [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 Items { get; set; } + } + + public class Item2 + { + + [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 User2 User { get; set; } + + [JsonProperty("beer")] + public Beer2 Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery2 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 Items { get; set; } + } + + public class Photo2 + { + + [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 User4 + { + + [JsonProperty("uid")] + public int Uid { get; set; } + + [JsonProperty("user_name")] + public string UserName { get; set; } + + [JsonProperty("location")] + public string Location { get; set; } + + [JsonProperty("bio")] + public string Bio { get; set; } + + [JsonProperty("first_name")] + public string FirstName { get; set; } + + [JsonProperty("last_name")] + public string LastName { get; set; } + + [JsonProperty("user_avatar")] + public string UserAvatar { get; set; } + + [JsonProperty("account_type")] + public string AccountType { get; set; } + + [JsonProperty("url")] + public string Url { get; set; } + } + + public class Beer3 + { + + [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_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { get; set; } + + [JsonProperty("beer_description")] + public string BeerDescription { get; set; } + + [JsonProperty("auth_rating")] + public double AuthRating { get; set; } + + [JsonProperty("wish_list")] + public bool WishList { get; set; } + } + + public class Contact4 + { + + [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 Location3 + { + + [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 Brewery3 + { + + [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 Contact4 Contact { get; set; } + + [JsonProperty("location")] + public Location3 Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { get; set; } + } + + public class Item6 + { + + [JsonProperty("photo_id")] + public int PhotoId { get; set; } + + [JsonProperty("photo")] + public Photo2 Photo { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("checkin_id")] + public int CheckinId { get; set; } + + [JsonProperty("user")] + public User4 User { get; set; } + + [JsonProperty("beer")] + public Beer3 Beer { get; set; } + + [JsonProperty("brewery")] + public Brewery3 Brewery { get; set; } + + [JsonProperty("venue")] + public object Venue { get; set; } } public class Media2 { - public int count { get; set; } - public List items { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } } - public class Contact7 + public class Contact5 { - public int foursquare { get; set; } - public string twitter { get; set; } - public int facebook { get; set; } + + [JsonProperty("facebook")] + public int Facebook { get; set; } + + [JsonProperty("twitter")] + public string Twitter { get; set; } } public class User { - public int uid { get; set; } - public int id { get; set; } - public string user_name { get; set; } - public string first_name { get; set; } - public string last_name { get; set; } - public string user_avatar { get; set; } - public string user_avatar_hd { get; set; } - public string user_cover_photo { get; set; } - public int user_cover_photo_offset { get; set; } - public int is_private { get; set; } - public string location { get; set; } - public string url { get; set; } - public string bio { get; set; } - public int is_supporter { get; set; } - public object relationship { get; set; } - public string untappd_url { get; set; } - public string account_type { get; set; } - public Stats stats { get; set; } - public RecentBrews recent_brews { get; set; } - public Checkins checkins { get; set; } - public Media2 media { get; set; } - public Contact7 contact { get; set; } - public string date_joined { get; set; } - public List settings { get; set; } + + [JsonProperty("uid")] + public int Uid { get; set; } + + [JsonProperty("id")] + public int Id { 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("user_avatar")] + public string UserAvatar { get; set; } + + [JsonProperty("user_avatar_hd")] + public string UserAvatarHd { get; set; } + + [JsonProperty("user_cover_photo")] + public string UserCoverPhoto { get; set; } + + [JsonProperty("user_cover_photo_offset")] + public int UserCoverPhotoOffset { get; set; } + + [JsonProperty("is_private")] + public int IsPrivate { get; set; } + + [JsonProperty("location")] + public string Location { get; set; } + + [JsonProperty("url")] + public string Url { get; set; } + + [JsonProperty("bio")] + public string Bio { get; set; } + + [JsonProperty("is_supporter")] + public int IsSupporter { get; set; } + + [JsonProperty("relationship")] + public object Relationship { get; set; } + + [JsonProperty("untappd_url")] + public string UntappdUrl { get; set; } + + [JsonProperty("account_type")] + public string AccountType { get; set; } + + [JsonProperty("stats")] + public Stats Stats { get; set; } + + [JsonProperty("recent_brews")] + public RecentBrews RecentBrews { get; set; } + + [JsonProperty("checkins")] + public Checkins Checkins { get; set; } + + [JsonProperty("media")] + public Media2 Media { get; set; } + + [JsonProperty("contact")] + public Contact5 Contact { get; set; } + + [JsonProperty("date_joined")] + public string DateJoined { get; set; } + + [JsonProperty("settings")] + public IList Settings { get; set; } } public class Response { - public User user { get; set; } + + [JsonProperty("user")] + public User User { get; set; } } - public class UserInfoRootobject : BaseRequest + public class UserInfo : UnAuthenticatedRequest { protected override string _EndPoint { get { return "v4/user/info/{0}"; } } - public Meta meta { get; set; } - public List notifications { get; set; } - public Response response { get; set; } + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } } } diff --git a/src/Untappd.Net/Responses/UserWishlist.cs b/src/Untappd.Net/Responses/UserWishlist.cs index 3b56960..c62c72f 100644 --- a/src/Untappd.Net/Responses/UserWishlist.cs +++ b/src/Untappd.Net/Responses/UserWishlist.cs @@ -3,75 +3,83 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; using Untappd.Net.Request; namespace Untappd.Net.Responses.UserWishlist { - public class UserWishlistRootobject : BaseRequest + public class ResponseTime { - public Beers beers { get; set; } - protected override string _EndPoint { get { throw new NotImplementedException(); } } + + [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 Beers { - public int count { get; set; } - public Items items { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } } - public class Items + public class Response { - public string created_at { get; set; } - public Beer beer { get; set; } - public Brewery brewery { get; set; } - public object[] friends { get; set; } + + [JsonProperty("sort")] + public string Sort { get; set; } + + [JsonProperty("sort_english")] + public string SortEnglish { get; set; } + + [JsonProperty("type_id")] + public int TypeId { get; set; } + + [JsonProperty("beers")] + public Beers Beers { get; set; } } - public class Beer + public class UserWishList : UnAuthenticatedRequest { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public float beer_abv { get; set; } - public int beer_ibu { get; set; } - public string beer_slug { get; set; } - public string beer_description { get; set; } - public int is_in_production { get; set; } - public string beer_style { get; set; } - public string created_at { get; set; } - public int auth_rating { get; set; } - public float rating_score { get; set; } - public int rating_count { get; set; } - public bool wish_list { get; set; } + protected override string _EndPoint { get { return "/v4/user/wishlist/{0}"; } } + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } } - public class Brewery - { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact contact { get; set; } - public Location location { get; set; } - public int brewery_active { get; set; } - } - - public class Contact - { - public string twitter { get; set; } - public string facebook { get; set; } - public string instagram { get; set; } - public string url { get; set; } - } - - public class Location - { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } - } } diff --git a/src/Untappd.Net/Responses/VenueInfo.cs b/src/Untappd.Net/Responses/VenueInfo.cs index c9d7e96..6217574 100644 --- a/src/Untappd.Net/Responses/VenueInfo.cs +++ b/src/Untappd.Net/Responses/VenueInfo.cs @@ -3,290 +3,577 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; using Untappd.Net.Request; namespace Untappd.Net.Responses.VenueInfo { - public class VenueInfoRootobject : BaseRequest + public class ResponseTime { - public Venue venue { get; set; } - protected override string _EndPoint { get { return "v4/venue/info/{0}"; } } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Venue + public class InitTime { - public int venue_id { get; set; } - public string venue_name { get; set; } - public string last_updated { get; set; } - public string primary_category { get; set; } - public Categories categories { get; set; } - public Stats stats { get; set; } - public Venue_Icon venue_icon { get; set; } - public bool public_venue { get; set; } - public Location location { get; set; } - public Contact contact { get; set; } - public Foursquare foursquare { get; set; } - public Media media { get; set; } - public Top_Beers top_beers { get; set; } + + [JsonProperty("time")] + public double Time { get; set; } + + [JsonProperty("measure")] + public string Measure { get; set; } } - public class Categories + public class Meta { - public int count { get; set; } - public Item[] items { get; set; } + + [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 Item { - public string category_name { get; set; } - public string category_id { get; set; } - public bool is_primary { get; set; } + + [JsonProperty("category_name")] + public string CategoryName { get; set; } + + [JsonProperty("category_id")] + public string CategoryId { get; set; } + + [JsonProperty("is_primary")] + public bool IsPrimary { get; set; } + } + + public class Categories + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } } public class Stats { - public int total_count { get; set; } - public int user_count { get; set; } - public int total_user_count { get; set; } - public int monthly_count { get; set; } - public int weekly_count { get; set; } + + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + [JsonProperty("user_count")] + public int UserCount { get; set; } + + [JsonProperty("total_user_count")] + public int TotalUserCount { get; set; } + + [JsonProperty("monthly_count")] + public int MonthlyCount { get; set; } + + [JsonProperty("weekly_count")] + public int WeeklyCount { get; set; } } - public class Venue_Icon + public class VenueIcon { - public string sm { get; set; } - public string md { get; set; } - public string lg { get; set; } + + [JsonProperty("sm")] + public string Sm { get; set; } + + [JsonProperty("md")] + public string Md { get; set; } + + [JsonProperty("lg")] + public string Lg { get; set; } } public class Location { - public string venue_address { get; set; } - public string venue_city { get; set; } - public string venue_state { get; set; } - public string venue_country { get; set; } - public float lat { get; set; } - public float lng { get; set; } + + [JsonProperty("venue_address")] + public string VenueAddress { get; set; } + + [JsonProperty("venue_city")] + public string VenueCity { get; set; } + + [JsonProperty("venue_state")] + public string VenueState { get; set; } + + [JsonProperty("venue_country")] + public object VenueCountry { get; set; } + + [JsonProperty("lat")] + public double Lat { get; set; } + + [JsonProperty("lng")] + public double Lng { get; set; } } public class Contact { - public string twitter { get; set; } - public string venue_url { get; set; } + + [JsonProperty("twitter")] + public object Twitter { get; set; } + + [JsonProperty("venue_url")] + public object VenueUrl { get; set; } } public class Foursquare { - public string foursquare_id { get; set; } - public string foursquare_url { get; set; } + + [JsonProperty("foursquare_id")] + public object FoursquareId { get; set; } + + [JsonProperty("foursquare_url")] + public object FoursquareUrl { get; set; } } public class Media { - public int count { get; set; } - public Items items { get; set; } - } - public class Items - { - public int photo_id { get; set; } - public Photo photo { get; set; } - public string created_at { get; set; } - public int checkin_id { get; set; } - public Beer beer { get; set; } - public Brewery brewery { get; set; } - public User user { get; set; } - public Venue1 venue { get; set; } - } + [JsonProperty("count")] + public int Count { get; set; } - public class Photo - { - public string photo_img_sm { get; set; } - public string photo_img_md { get; set; } - public string photo_img_lg { get; set; } - public string photo_img_og { get; set; } - } - - public class Beer - { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public int beer_abv { get; set; } - public int beer_ibu { get; set; } - public string beer_slug { get; set; } - public string beer_description { get; set; } - public int is_in_production { get; set; } - public int beer_style_id { get; set; } - public string beer_style { get; set; } - public int auth_rating { get; set; } - public bool wish_list { get; set; } - public int beer_active { get; set; } - } - - public class Brewery - { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact1 contact { get; set; } - public Location1 location { get; set; } - public int brewery_active { get; set; } - } - - public class Contact1 - { - public string twitter { get; set; } - public string facebook { get; set; } - public string url { get; set; } - } - - public class Location1 - { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } + [JsonProperty("items")] + public IList Items { get; set; } } public class User { - public int uid { get; set; } - public string user_name { get; set; } - public string first_name { get; set; } - public string last_name { get; set; } - public string user_avatar { get; set; } - public string relationship { get; set; } - public int is_private { get; set; } + + [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("relationship")] + public object Relationship { get; set; } + + [JsonProperty("is_supporter")] + public int IsSupporter { get; set; } + + [JsonProperty("user_avatar")] + public string UserAvatar { get; set; } + + [JsonProperty("is_private")] + public int IsPrivate { get; set; } } - public class Venue1 + public class Beer { - public int venue_id { get; set; } - public string venue_name { get; set; } - public string primary_category { get; set; } - public string parent_category_id { get; set; } - public Categories1 categories { get; set; } - public Location2 location { get; set; } - public Contact2 contact { get; set; } - public bool public_venue { get; set; } - public Foursquare1 foursquare { get; set; } - public Venue_Icon1 venue_icon { get; set; } - } - public class Categories1 - { - public int count { get; set; } - public Item1[] items { get; set; } - } + [JsonProperty("bid")] + public int Bid { get; set; } - public class Item1 - { - public string category_name { get; set; } - public string category_id { get; set; } - public bool is_primary { get; set; } - } + [JsonProperty("beer_name")] + public string BeerName { get; set; } - public class Location2 - { - public string venue_address { get; set; } - public string venue_city { get; set; } - public string venue_state { get; set; } - public string venue_country { get; set; } - public float lat { get; set; } - public float lng { get; set; } + [JsonProperty("beer_abv")] + public double BeerAbv { get; set; } + + [JsonProperty("beer_label")] + public string BeerLabel { get; set; } + + [JsonProperty("beer_style")] + public string BeerStyle { 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 Contact2 { - public string twitter { get; set; } - public string venue_url { get; set; } + + [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 Foursquare1 + public class Location2 { - public string foursquare_id { get; set; } - public string foursquare_url { get; set; } + + [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 Venue_Icon1 + public class Brewery { - public string sm { get; set; } - public string md { get; set; } - public string lg { get; set; } + + [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 Contact2 Contact { get; set; } + + [JsonProperty("location")] + public Location2 Location { get; set; } + + [JsonProperty("brewery_active")] + public int BreweryActive { get; set; } } - public class Top_Beers + public class Item3 { - public int offset { get; set; } - public int limit { get; set; } - public int count { get; set; } - public Items1 items { get; set; } + + [JsonProperty("category_name")] + public string CategoryName { get; set; } + + [JsonProperty("category_id")] + public string CategoryId { get; set; } + + [JsonProperty("is_primary")] + public bool IsPrimary { get; set; } } - public class Items1 + public class Categories2 { - public string created_at { get; set; } - public int total_count { get; set; } - public int your_count { get; set; } - public Beer1 beer { get; set; } - public Brewery1 brewery { get; set; } - public Friends friends { get; set; } - } - public class Beer1 - { - public int bid { get; set; } - public string beer_name { get; set; } - public string beer_label { get; set; } - public int beer_abv { get; set; } - public int beer_ibu { get; set; } - public string beer_slug { get; set; } - public string beer_description { get; set; } - public int is_in_production { get; set; } - public int beer_style_id { get; set; } - public string beer_style { get; set; } - public int auth_rating { get; set; } - public bool wish_list { get; set; } - public int beer_active { get; set; } - public float rating_score { get; set; } - public int rating_count { get; set; } - } + [JsonProperty("count")] + public int Count { get; set; } - public class Brewery1 - { - public int brewery_id { get; set; } - public string brewery_name { get; set; } - public string brewery_slug { get; set; } - public string brewery_label { get; set; } - public string country_name { get; set; } - public Contact3 contact { get; set; } - public Location3 location { get; set; } - public int brewery_active { get; set; } - } - - public class Contact3 - { - public string twitter { get; set; } - public string facebook { get; set; } - public string url { get; set; } + [JsonProperty("items")] + public IList Items { get; set; } } public class Location3 { - public string brewery_city { get; set; } - public string brewery_state { get; set; } - public float lat { get; set; } - public float lng { get; set; } + + [JsonProperty("venue_address")] + public string VenueAddress { get; set; } + + [JsonProperty("venue_city")] + public string VenueCity { get; set; } + + [JsonProperty("venue_state")] + public string VenueState { get; set; } + + [JsonProperty("venue_country")] + public object VenueCountry { get; set; } + + [JsonProperty("lat")] + public double Lat { get; set; } + + [JsonProperty("lng")] + public double Lng { get; set; } } - public class Friends + public class Contact3 { - public int count { get; set; } - public object[] items { get; set; } + + [JsonProperty("twitter")] + public object Twitter { get; set; } + + [JsonProperty("venue_url")] + public object VenueUrl { get; set; } + } + + public class Foursquare2 + { + + [JsonProperty("foursquare_id")] + public object FoursquareId { get; set; } + + [JsonProperty("foursquare_url")] + public object FoursquareUrl { get; set; } + } + + public class VenueIcon2 + { + + [JsonProperty("sm")] + public string Sm { get; set; } + + [JsonProperty("md")] + public string Md { get; set; } + + [JsonProperty("lg")] + public string Lg { get; set; } + } + + public class Venue2 + { + + [JsonProperty("venue_id")] + public int VenueId { get; set; } + + [JsonProperty("venue_name")] + public string VenueName { get; set; } + + [JsonProperty("primary_category")] + public string PrimaryCategory { get; set; } + + [JsonProperty("parent_category_id")] + public string ParentCategoryId { get; set; } + + [JsonProperty("categories")] + public Categories2 Categories { get; set; } + + [JsonProperty("location")] + public Location3 Location { get; set; } + + [JsonProperty("contact")] + public Contact3 Contact { get; set; } + + [JsonProperty("public_venue")] + public bool PublicVenue { get; set; } + + [JsonProperty("foursquare")] + public Foursquare2 Foursquare { get; set; } + + [JsonProperty("venue_icon")] + public VenueIcon2 VenueIcon { get; set; } + } + + public class Comments + { + + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Toasts + { + + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("auth_toast")] + public object AuthToast { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Media2 + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Source + { + + [JsonProperty("app_name")] + public string AppName { get; set; } + + [JsonProperty("app_website")] + public object AppWebsite { get; set; } + } + + public class Badges + { + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Item2 + { + + [JsonProperty("checkin_id")] + public int CheckinId { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + + [JsonProperty("rating_score")] + public int RatingScore { get; set; } + + [JsonProperty("checkin_comment")] + public string CheckinComment { 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 Venue2 Venue { get; set; } + + [JsonProperty("comments")] + public Comments Comments { get; set; } + + [JsonProperty("toasts")] + public Toasts Toasts { get; set; } + + [JsonProperty("media")] + public Media2 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 Items { get; set; } + } + + public class TopBeers + { + + [JsonProperty("offset")] + public int Offset { get; set; } + + [JsonProperty("limit")] + public int Limit { get; set; } + + [JsonProperty("count")] + public int Count { get; set; } + + [JsonProperty("items")] + public IList Items { get; set; } + } + + public class Venue + { + + [JsonProperty("venue_id")] + public int VenueId { get; set; } + + [JsonProperty("venue_name")] + public string VenueName { get; set; } + + [JsonProperty("last_updated")] + public string LastUpdated { get; set; } + + [JsonProperty("primary_category")] + public string PrimaryCategory { get; set; } + + [JsonProperty("categories")] + public Categories Categories { get; set; } + + [JsonProperty("stats")] + public Stats Stats { get; set; } + + [JsonProperty("venue_icon")] + public VenueIcon VenueIcon { get; set; } + + [JsonProperty("public_venue")] + public bool PublicVenue { get; set; } + + [JsonProperty("location")] + public Location Location { get; set; } + + [JsonProperty("contact")] + public Contact Contact { get; set; } + + [JsonProperty("foursquare")] + public Foursquare Foursquare { get; set; } + + [JsonProperty("media")] + public Media Media { get; set; } + + [JsonProperty("checkins")] + public Checkins Checkins { get; set; } + + [JsonProperty("top_beers")] + public TopBeers TopBeers { get; set; } + } + + public class Response + { + + [JsonProperty("venue")] + public Venue Venue { get; set; } + } + + public class VenueInfo : UnAuthenticatedRequest + { + + [JsonProperty("meta")] + public Meta Meta { get; set; } + + [JsonProperty("notifications")] + public IList Notifications { get; set; } + + [JsonProperty("response")] + public Response Response { get; set; } + + protected override string _EndPoint + { + get { return "v4/venue/info/{0}"; } + } } } diff --git a/src/Untappd.Net/Untappd.Net.csproj b/src/Untappd.Net/Untappd.Net.csproj index 1c64a0d..9cdefb0 100644 --- a/src/Untappd.Net/Untappd.Net.csproj +++ b/src/Untappd.Net/Untappd.Net.csproj @@ -47,10 +47,12 @@ + + - +