Ejemplo n.º 1
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>
        /// <param name="body">update a flag</param>
        /// <returns>Task of ApiResponse (Flag)</returns>
        public async Task <ApiResponse <Flag> > PutFlagAsync(long flagID, PutFlagRequest body)
        {
            if (body == null)
            {
                throw new ApiException(400, "Missing required parameter 'body' when calling FlagApi->PutFlag");
            }

            return(await _httpClient.PutAsync($"flags/{flagID}").WithBody((x) => x.Model(body)).AsApiResponse <Flag>());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="flagID">numeric ID of the flag</param>
        /// <param name="segmentID">numeric ID of the segment</param>
        /// <param name="constraintID">numeric ID of the constraint</param>
        /// <param name="body">create a constraint</param>
        /// <returns>Task of ApiResponse (Constraint)</returns>
        public async Task <ApiResponse <Constraint> > PutConstraintAsync(long flagID, long segmentID, long constraintID, CreateConstraintRequest body)
        {
            if (body == null)
            {
                throw new ApiException(400, "Missing required parameter 'body' when calling ConstraintApi->PutConstraint");
            }

            return(await _httpClient.PutAsync($"flags/{flagID}/segments/{segmentID}/constraints/{constraintID}")
                   .WithBody((x) => x.Model(body))
                   .AsApiResponse <Constraint>());
        }
        /// <summary>
        ///  replace the distribution with the new setting
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="flagID">numeric ID of the flag</param>
        /// <param name="segmentID">numeric ID of the segment</param>
        /// <param name="body">array of distributions</param>
        /// <returns>Task of ApiResponse (List&lt;Distribution&gt;)</returns>
        public async Task <ApiResponse <IEnumerable <Distribution> > > PutDistributionsAsync(long flagID, long segmentID, PutDistributionsRequest body)
        {
            if (body == null)
            {
                throw new ApiException(400, "Missing required parameter 'body' when calling DistributionApi->PutDistributions");
            }

            return(await _httpClient.PutAsync($"flags/{flagID}/segments/{segmentID}/distributions")
                   .WithBody((x) => x.Model(body))
                   .AsApiResponse <IEnumerable <Distribution> >());
        }