示例#1
0
        internal new static RestCommunity Create(BaseRestClient client, Model model)
        {
            var entity = new RestCommunity(client, model.Id);

            entity.Update(model);
            return(entity);
        }
示例#2
0
        // 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);
        }
示例#3
0
 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;
 }
示例#4
0
        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));
        }