/// <summary> /// /// </summary> /// <exception cref="Koudenpa.Mackerel.Api.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="graphAnnotation"></param> /// <returns>Task of ApiResponse (GraphAnnotation)</returns> public async System.Threading.Tasks.Task <Koudenpa.Mackerel.Api.Client.ApiResponse <GraphAnnotation> > PostGraphAnnotationAsyncWithHttpInfo(GraphAnnotationBody graphAnnotation) { // verify the required parameter 'graphAnnotation' is set if (graphAnnotation == null) { throw new Koudenpa.Mackerel.Api.Client.ApiException(400, "Missing required parameter 'graphAnnotation' when calling GraphAnnotationApi->PostGraphAnnotation"); } Koudenpa.Mackerel.Api.Client.RequestOptions localVarRequestOptions = new Koudenpa.Mackerel.Api.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json" }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; foreach (var _contentType in _contentTypes) { localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); } foreach (var _accept in _accepts) { localVarRequestOptions.HeaderParameters.Add("Accept", _accept); } localVarRequestOptions.Data = graphAnnotation; // authentication (apiKey) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("X-Api-Key"))) { localVarRequestOptions.HeaderParameters.Add("X-Api-Key", this.Configuration.GetApiKeyWithPrefix("X-Api-Key")); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.PostAsync <GraphAnnotation>("/graph-annotations", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PostGraphAnnotation", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// /// </summary> /// <exception cref="Koudenpa.Mackerel.Api.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="graphAnnotation"></param> /// <returns>ApiResponse of GraphAnnotation</returns> public Koudenpa.Mackerel.Api.Client.ApiResponse <GraphAnnotation> PostGraphAnnotationWithHttpInfo(GraphAnnotationBody graphAnnotation) { // verify the required parameter 'graphAnnotation' is set if (graphAnnotation == null) { throw new Koudenpa.Mackerel.Api.Client.ApiException(400, "Missing required parameter 'graphAnnotation' when calling GraphAnnotationApi->PostGraphAnnotation"); } Koudenpa.Mackerel.Api.Client.RequestOptions localVarRequestOptions = new Koudenpa.Mackerel.Api.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json" }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = Koudenpa.Mackerel.Api.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = Koudenpa.Mackerel.Api.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = graphAnnotation; // authentication (apiKey) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("X-Api-Key"))) { localVarRequestOptions.HeaderParameters.Add("X-Api-Key", this.Configuration.GetApiKeyWithPrefix("X-Api-Key")); } // make the HTTP request var localVarResponse = this.Client.Post <GraphAnnotation>("/graph-annotations", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PostGraphAnnotation", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// /// </summary> /// <exception cref="Koudenpa.Mackerel.Api.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="graphAnnotation"></param> /// <returns>Task of GraphAnnotation</returns> public async System.Threading.Tasks.Task <GraphAnnotation> PostGraphAnnotationAsync(GraphAnnotationBody graphAnnotation) { Koudenpa.Mackerel.Api.Client.ApiResponse <GraphAnnotation> localVarResponse = await PostGraphAnnotationAsyncWithHttpInfo(graphAnnotation); return(localVarResponse.Data); }
/// <summary> /// /// </summary> /// <exception cref="Koudenpa.Mackerel.Api.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="graphAnnotation"></param> /// <returns>GraphAnnotation</returns> public GraphAnnotation PostGraphAnnotation(GraphAnnotationBody graphAnnotation) { Koudenpa.Mackerel.Api.Client.ApiResponse <GraphAnnotation> localVarResponse = PostGraphAnnotationWithHttpInfo(graphAnnotation); return(localVarResponse.Data); }