Ejemplo n.º 1
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="GetTeamEventsArg" />
        /// class.</para>
        /// </summary>
        /// <param name="limit">Number of results to return per call.</param>
        /// <param name="accountId">Filter the events by account ID. Return ony events with
        /// this account_id as either Actor, Context, or Participants.</param>
        /// <param name="time">Filter by time range.</param>
        public GetTeamEventsArg(uint limit       = 1000,
                                string accountId = null,
                                global::Dropbox.Api.TeamCommon.TimeRange time = null)
        {
            if (limit < 1U)
            {
                throw new sys.ArgumentOutOfRangeException("limit", "Value should be greater or equal than 1");
            }
            if (limit > 1000U)
            {
                throw new sys.ArgumentOutOfRangeException("limit", "Value should be less of equal than 1000");
            }

            if (accountId != null)
            {
                if (accountId.Length < 40)
                {
                    throw new sys.ArgumentOutOfRangeException("accountId", "Length should be at least 40");
                }
                if (accountId.Length > 40)
                {
                    throw new sys.ArgumentOutOfRangeException("accountId", "Length should be at most 40");
                }
            }

            this.Limit     = limit;
            this.AccountId = accountId;
            this.Time      = time;
        }
        /// <summary>
        /// <para>Retrieves team events.</para>
        /// <para>Permission : Team Auditing.</para>
        /// </summary>
        /// <param name="limit">Number of results to return per call.</param>
        /// <param name="accountId">Filter the events by account ID. Return ony events with
        /// this account_id as either Actor, Context, or Participants.</param>
        /// <param name="time">Filter by time range.</param>
        /// <returns>The task that represents the asynchronous send operation. The TResult
        /// parameter contains the response from the server.</returns>
        /// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error
        /// processing the request; This will contain a <see
        /// cref="GetTeamEventsError"/>.</exception>
        public t.Task <GetTeamEventsResult> GetEventsAsync(uint limit       = 1000,
                                                           string accountId = null,
                                                           global::Dropbox.Api.TeamCommon.TimeRange time = null)
        {
            var getTeamEventsArg = new GetTeamEventsArg(limit,
                                                        accountId,
                                                        time);

            return(this.GetEventsAsync(getTeamEventsArg));
        }
        /// <summary>
        /// <para>Begins an asynchronous send to the get events route.</para>
        /// </summary>
        /// <param name="limit">Number of results to return per call.</param>
        /// <param name="accountId">Filter the events by account ID. Return ony events with
        /// this account_id as either Actor, Context, or Participants.</param>
        /// <param name="time">Filter by time range.</param>
        /// <param name="callback">The method to be called when the asynchronous send is
        /// completed.</param>
        /// <param name="callbackState">A user provided object that distinguished this send
        /// from other send requests.</param>
        /// <returns>An object that represents the asynchronous send request.</returns>
        public sys.IAsyncResult BeginGetEvents(uint limit       = 1000,
                                               string accountId = null,
                                               global::Dropbox.Api.TeamCommon.TimeRange time = null,
                                               sys.AsyncCallback callback = null,
                                               object callbackState       = null)
        {
            var getTeamEventsArg = new GetTeamEventsArg(limit,
                                                        accountId,
                                                        time);

            return(this.BeginGetEvents(getTeamEventsArg, callback, callbackState));
        }