Ejemplo n.º 1
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="TeamEvent" /> class.</para>
        /// </summary>
        /// <param name="timestamp">The Dropbox timestamp representing when the action was
        /// taken.</param>
        /// <param name="eventCategories">One or more categories that this type of action
        /// belongs to.</param>
        /// <param name="actor">The entity who actually performed the action.</param>
        /// <param name="involveNonTeamMember">True if the action involved a non team member
        /// either as the actor or as one of the affected users.</param>
        /// <param name="context">The user or team on whose behalf the actor performed the
        /// action.</param>
        /// <param name="eventType">The particular type of action taken.</param>
        /// <param name="details">The variable event schema applicable to this type of action,
        /// instantiated with respect to this particular action.</param>
        /// <param name="origin">The origin from which the actor performed the action including
        /// information about host, ip address, location, session, etc. If the action was
        /// performed programmatically via the API the origin represents the API
        /// client.</param>
        /// <param name="participants">Zero or more users and/or groups that are affected by
        /// the action. Note that this list doesn't include any actors or users in
        /// context.</param>
        /// <param name="assets">Zero or more content assets involved in the action. Currently
        /// these include Dropbox files and folders but in the future we might add other asset
        /// types such as Paper documents, folders, projects, etc.</param>
        public TeamEvent(sys.DateTime timestamp,
                         col.IEnumerable <EventCategory> eventCategories,
                         ActorLogInfo actor,
                         bool involveNonTeamMember,
                         ContextLogInfo context,
                         EventType eventType,
                         EventDetails details,
                         OriginLogInfo origin = null,
                         col.IEnumerable <ParticipantLogInfo> participants = null,
                         col.IEnumerable <AssetLogInfo> assets             = null)
        {
            var eventCategoriesList = enc.Util.ToList(eventCategories);

            if (eventCategories == null)
            {
                throw new sys.ArgumentNullException("eventCategories");
            }
            if (eventCategoriesList.Count < 1)
            {
                throw new sys.ArgumentOutOfRangeException("eventCategories", "List should at at least 1 items");
            }

            if (actor == null)
            {
                throw new sys.ArgumentNullException("actor");
            }

            if (context == null)
            {
                throw new sys.ArgumentNullException("context");
            }

            if (eventType == null)
            {
                throw new sys.ArgumentNullException("eventType");
            }

            if (details == null)
            {
                throw new sys.ArgumentNullException("details");
            }

            var participantsList = enc.Util.ToList(participants);

            var assetsList = enc.Util.ToList(assets);

            this.Timestamp            = timestamp;
            this.EventCategories      = eventCategoriesList;
            this.Actor                = actor;
            this.InvolveNonTeamMember = involveNonTeamMember;
            this.Context              = context;
            this.EventType            = eventType;
            this.Details              = details;
            this.Origin               = origin;
            this.Participants         = participantsList;
            this.Assets               = assetsList;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="TeamEvent" /> class.</para>
        /// </summary>
        /// <param name="timestamp">The Dropbox timestamp representing when the action was
        /// taken.</param>
        /// <param name="eventCategory">The category that this type of action belongs
        /// to.</param>
        /// <param name="eventType">The particular type of action taken.</param>
        /// <param name="details">The variable event schema applicable to this type of action,
        /// instantiated with respect to this particular action.</param>
        /// <param name="actor">The entity who actually performed the action. Might be missing
        /// due to historical data gap.</param>
        /// <param name="origin">The origin from which the actor performed the action including
        /// information about host, ip address, location, session, etc. If the action was
        /// performed programmatically via the API the origin represents the API
        /// client.</param>
        /// <param name="involveNonTeamMember">True if the action involved a non team member
        /// either as the actor or as one of the affected users. Might be missing due to
        /// historical data gap.</param>
        /// <param name="context">The user or team on whose behalf the actor performed the
        /// action. Might be missing due to historical data gap.</param>
        /// <param name="participants">Zero or more users and/or groups that are affected by
        /// the action. Note that this list doesn't include any actors or users in
        /// context.</param>
        /// <param name="assets">Zero or more content assets involved in the action. Currently
        /// these include Dropbox files and folders but in the future we might add other asset
        /// types such as Paper documents, folders, projects, etc.</param>
        public TeamEvent(sys.DateTime timestamp,
                         EventCategory eventCategory,
                         EventType eventType,
                         EventDetails details,
                         ActorLogInfo actor        = null,
                         OriginLogInfo origin      = null,
                         bool?involveNonTeamMember = null,
                         ContextLogInfo context    = null,
                         col.IEnumerable <ParticipantLogInfo> participants = null,
                         col.IEnumerable <AssetLogInfo> assets             = null)
        {
            if (eventCategory == null)
            {
                throw new sys.ArgumentNullException("eventCategory");
            }

            if (eventType == null)
            {
                throw new sys.ArgumentNullException("eventType");
            }

            if (details == null)
            {
                throw new sys.ArgumentNullException("details");
            }

            var participantsList = enc.Util.ToList(participants);

            var assetsList = enc.Util.ToList(assets);

            this.Timestamp            = timestamp;
            this.EventCategory        = eventCategory;
            this.EventType            = eventType;
            this.Details              = details;
            this.Actor                = actor;
            this.Origin               = origin;
            this.InvolveNonTeamMember = involveNonTeamMember;
            this.Context              = context;
            this.Participants         = participantsList;
            this.Assets               = assetsList;
        }