internal static RestConnection Create(BaseDiscordClient discord, Model model) { var entity = new RestConnection(discord); entity.Update(model); return(entity); }
public Connection(Model model) { Id = model.Id; Type = model.Type; Name = model.Name; IsRevoked = model.Revoked; IntegrationIds = model.Integrations; }
internal void Update(Model model) { Id = model.Id; Name = model.Name; Type = model.Type; IsRevoked = model.Revoked.IsSpecified ? model.Revoked.Value : null; Integrations = model.Integrations.IsSpecified ?model.Integrations.Value .Select(intergration => RestIntegration.Create(Discord, null, intergration)).ToImmutableArray() : null; Verified = model.Verified; FriendSync = model.FriendSync; ShowActivity = model.ShowActivity; Visibility = model.Visibility; }
internal static RestConnection Create(Model model) { return(new RestConnection(model.Id, model.Type, model.Name, model.Revoked, model.Integrations.ToImmutableArray())); }