Esempio n. 1
0
        internal static RestIntegrationApplication Create(BaseDiscordClient discord, Model model)
        {
            var entity = new RestIntegrationApplication(discord, model.Id);

            entity.Update(model);
            return(entity);
        }
Esempio n. 2
0
        internal void Update(Model model)
        {
            Name      = model.Name;
            Type      = model.Type;
            IsEnabled = model.Enabled;

            IsSyncing           = model.Syncing.IsSpecified ? model.Syncing.Value : null;
            RoleId              = model.RoleId.IsSpecified ? model.RoleId.Value : null;
            HasEnabledEmoticons = model.EnableEmoticons.IsSpecified ? model.EnableEmoticons.Value : null;
            ExpireBehavior      = model.ExpireBehavior.IsSpecified ? model.ExpireBehavior.Value : null;
            ExpireGracePeriod   = model.ExpireGracePeriod.IsSpecified ? model.ExpireGracePeriod.Value : null;
            User            = model.User.IsSpecified ? RestUser.Create(Discord, model.User.Value) : null;
            Account         = model.Account.IsSpecified ? RestIntegrationAccount.Create(model.Account.Value) : null;
            SubscriberCount = model.SubscriberAccount.IsSpecified ? model.SubscriberAccount.Value : null;
            IsRevoked       = model.Revoked.IsSpecified ? model.Revoked.Value : null;
            Application     = model.Application.IsSpecified ? RestIntegrationApplication.Create(Discord, model.Application.Value) : null;

            _syncedAtTicks = model.SyncedAt.IsSpecified ? model.SyncedAt.Value.UtcTicks : null;
        }