/// <summary> /// Creates a new service limits configuration or updates an exiting one. /// </summary> /// <remarks> /// User can only update the following 2 properties: - frontendLimits.limitMonthlyProcessingTimeInHours - backendLimits[/engine/].limitProcessingTimeSec LimitProcessingTimeSec cannot be set greater than the maximum processing time limit specified by the engine. /// </remarks> /// <exception cref="HttpRequestException">Thrown when fails to make API call</exception> /// <param name="owner">The user to associate the configuration to.</param> /// <param name="item"></param> /// <returns>Task of ServiceLimit</returns> public async System.Threading.Tasks.Task <ServiceLimit> ModifyServiceLimitsAsync(string owner, ServiceLimit item) { var response = await this.ServiceLimitsApi.ModifyServiceLimitsAsync(owner, item); return(response.Content); }
/// <summary> /// Creates a new service limits configuration or updates an exiting one. /// </summary> /// <remarks> /// User can only update the following 2 properties: - frontendLimits.limitMonthlyProcessingTimeInHours - backendLimits[/engine/].limitProcessingTimeSec LimitProcessingTimeSec cannot be set greater than the maximum processing time limit specified by the engine. /// </remarks> /// <exception cref="HttpRequestException">Thrown when fails to make API call</exception> /// <param name="owner">The user to associate the configuration to.</param>/// <param name="item"></param> /// <returns>Task of ApiResponse<ServiceLimit></returns> public async System.Threading.Tasks.Task <ApiResponse <ServiceLimit> > ModifyServiceLimitsAsync(string owner, ServiceLimit item, string scopes = null, IDictionary <string, string> headers = null, bool throwOnError = true) { using (var request = new HttpRequestMessage()) { request.RequestUri = Marshalling.BuildRequestUri("/v3/servicelimits/{owner}", routeParameters: new Dictionary <string, object> { { "owner", owner }, }, queryParameters: new Dictionary <string, object> { } ); request.Headers.TryAddWithoutValidation("Accept", "application/json"); if (headers != null) { foreach (var header in headers) { request.Headers.TryAddWithoutValidation(header.Key, header.Value); } } request.Content = Marshalling.Serialize(item); // http body (model) parameter // tell the underlying pipeline what scope we'd like to use if (scopes == null) { request.Options.Set(ForgeConfiguration.ScopeKey, "code:all"); } else { request.Options.Set(ForgeConfiguration.ScopeKey, scopes); } request.Method = new HttpMethod("PUT"); // make the HTTP request var response = await this.Service.Client.SendAsync(request); if (throwOnError) { await response.EnsureSuccessStatusCodeAsync(); } else if (!response.IsSuccessStatusCode) { return(new ApiResponse <ServiceLimit>(response, default(ServiceLimit))); } return(new ApiResponse <ServiceLimit>(response, await Marshalling.DeserializeAsync <ServiceLimit>(response.Content))); } // using }