internal new static RestCommunity Create(BaseRestClient client, Model model) { var entity = new RestCommunity(client, model.Id); entity.Update(model); return(entity); }
// Communities public static async Task <RestCommunity> GetCommunityAsync(BaseTwitchClient client, string communityId, bool isname, RequestOptions options = null) { var model = await client.ApiClient.GetCommunityAsync(communityId, isname, options).ConfigureAwait(false); if (model != null) { return(RestCommunity.Create(client, model)); } return(null); }
internal void Update(RestCommunity community) { base.Update(community); OwnerId = community.OwnerId; Summary = community.Summary; Description = community.Description; DescriptionHtml = community.DescriptionHtml; Rules = community.Rules; RulesHtml = community.RulesHtml; Language = community.Language; CoverUrl = community.CoverUrl; }
public static async Task <RestCommunity> GetCommunityAsync(BaseRestClient client, string id, bool isname = false) { var token = TokenHelper.GetSingleToken(client); var model = await client.RestClient.GetCommunityInternalAsync(token, id, isname); if (model == null) { return(null); } return(RestCommunity.Create(client, model)); }