Skip to content

Commit

Permalink
Add sites api endpoint (fix site type)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcticEcho committed Jul 25, 2018
1 parent 7ea645f commit 9d2552d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions SharpExchange/Api/2.2/Endpoints/Sites.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using SharpExchange.Api.V22.Types;
using System.Threading.Tasks;

namespace SharpExchange.Api.V22.Endpoints
{
public static class Sites
{
public static Task<Result<Site[]>> GetAllAsync(QueryOptions options = null)
{
var endpoint = $"{Constants.BaseApiUrl}/sites";

return ApiRequestScheduler.ScheduleRequestAsync<Site[]>(endpoint, options);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpExchange.Api.V22.Types
{
public class RelatedSites
public class RelatedSite
{
[JsonProperty("api_site_parameter")]
public string ApiSiteParameter { get; internal set; }
Expand Down
4 changes: 2 additions & 2 deletions SharpExchange/Api/2.2/Types/Site.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class Site
public DateTime? OpenBetaStartedOn { get; internal set; }

[JsonProperty("related_sites")]
public RelatedSites[] RelatedSites { get; internal set; }
public RelatedSite[] RelatedSites { get; internal set; }

[JsonProperty("site_state")]
public SiteState? State { get; internal set; }
Expand All @@ -61,6 +61,6 @@ public class Site
public Styling Styling { get; internal set; }

[JsonProperty("twitter_account")]
public Styling TwitterHandle { get; internal set; }
public string TwitterHandle { get; internal set; }
}
}

0 comments on commit 9d2552d

Please sign in to comment.