コード例 #1
0
        /// <summary>
        /// Retrieve a list of Logs from Persephony.
        /// </summary>
        /// <param name="filters">Optional query written in PQL (Persy Query Language) .</param>
        /// <returns>
        /// An in-language representation of Persephony's paginated list response.This will be a paginated list
        /// of Log instances as returned by the Persephony API.
        /// </returns>
        /// <exception cref="PersyException">Thrown upon failed request.</exception>
        public LogList get(LogSearchFilters filters = null)
        {
            // if persyQuery is not null, we do a post, passing the PQL in the body. Else we just do a normal get with no search params
            string json = null;

            if (filters != null)
            {
                json = base.POST(this.path, filters.toJson());
            }
            else
            {
                json = base.GET(this.path, null);
            }

            if (string.IsNullOrEmpty(json) == true)
            {
                throw new PersyException("Failed to get Log list");
            }

            LogList list = new LogList(this.getAccountId, this.getAuthToken, json);

            return(list);
        }