コード例 #1
0
        /// <summary>
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="limit">the numbers of flags to return (optional)</param>
        /// <param name="enabled">return flags having given enabled status (optional)</param>
        /// <param name="description">return flags exactly matching given description (optional)</param>
        /// <param name="tags">return flags with the given tags (comma separated) (optional)</param>
        /// <param name="descriptionLike">return flags partially matching given description (optional)</param>
        /// <param name="key">return flags matching given key (optional)</param>
        /// <param name="offset">return flags given the offset, it should usually set together with limit (optional)</param>
        /// <param name="preload">return flags with preloaded segments and variants (optional)</param>
        /// <param name="deleted">return all deleted flags (optional)</param>
        /// <returns>Task of ApiResponse (List&lt;Flag&gt;)</returns>
        public async Task <ApiResponse <IEnumerable <Flag> > > FindFlagsAsync(long?limit = null, bool?enabled = null, string description = null, string tags = null, string descriptionLike = null, string key = null, long?offset = null, bool?preload = null, bool?deleted = null)
        {
            var request = _httpClient.GetAsync("flags");

            if (limit != null)
            {
                request = request.WithArgument("limit", limit);
            }

            if (enabled != null)
            {
                request = request.WithArgument("enabled", enabled);
            }

            if (description != null)
            {
                request = request.WithArgument("description", description);
            }

            if (tags != null)
            {
                request = request.WithArgument("tags", tags);
            }

            if (descriptionLike != null)
            {
                request = request.WithArgument("description_like", descriptionLike);
            }

            if (key != null)
            {
                request = request.WithArgument("key", key);
            }

            if (offset != null)
            {
                request = request.WithArgument("offset", offset);
            }

            if (preload != null)
            {
                request = request.WithArgument("preload", preload);
            }

            if (deleted != null)
            {
                request = request.WithArgument("deleted", deleted);
            }

            return(await request.AsApiResponse <IEnumerable <Flag> >());
        }
コード例 #2
0
        /// <summary>
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="limit">the numbers of tags to return (optional)</param>
        /// <param name="offset">return tags given the offset, it should usually set together with limit (optional)</param>
        /// <param name="valueLike">return tags partially matching given value (optional)</param>
        /// <returns>Task of ApiResponse (List&lt;Tag&gt;)</returns>
        public async Task <ApiResponse <IEnumerable <Tag> > > FindAllTagsAsync(long?limit = null, long?offset = null, string valueLike = null)
        {
            var request = _httpClient.GetAsync("tags");

            if (limit != null)
            {
                request = request.WithArgument("limit", limit);
            }

            if (offset != null)
            {
                request = request.WithArgument("offset", offset);
            }

            if (valueLike != null)
            {
                request = request.WithArgument("value_like", valueLike);
            }

            return(await request.AsApiResponse <IEnumerable <Tag> >());
        }
コード例 #3
0
 /// <summary>
 ///  Export JSON format of the eval cache dump
 /// </summary>
 /// <exception cref="ApiException">Thrown when fails to make API call</exception>
 /// <returns>Task of ApiResponse (object)</returns>
 public async Task <ApiResponse <object> > GetExportEvalCacheJSONAsync()
 {
     return(await _httpClient.GetAsync("export/eval_cache/json").AsApiResponse <object>());
 }
コード例 #4
0
 /// <summary>
 /// </summary>
 /// <exception cref="ApiException">Thrown when fails to make API call</exception>
 /// <param name="flagID">numeric ID of the flag to get</param>
 /// <returns>Task of ApiResponse (List&lt;Segment&gt;)</returns>
 public async Task <ApiResponse <IEnumerable <Segment> > > FindSegmentsAsync(long flagID)
 {
     return(await _httpClient.GetAsync($"flags/{flagID}/segments").AsApiResponse <IEnumerable <Segment> >());
 }
コード例 #5
0
 /// <summary>
 ///  Check if Flagr is healthy
 /// </summary>
 /// <exception cref="ApiException">Thrown when fails to make API call</exception>
 /// <returns>Task of ApiResponse (Health)</returns>
 public async Task <ApiResponse <Health> > GetHealthAsync()
 {
     return(await _httpClient.GetAsync("health").AsApiResponse <Health>());
 }
コード例 #6
0
 public async Task <ApiResponse <IEnumerable <Distribution> > > GetDistributionsAsync(long flagID, long segmentID)
 {
     return(await _httpClient.GetAsync($"flags/{flagID}/segments/{segmentID}/distributions").AsApiResponse <IEnumerable <Distribution> >());
 }