コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="body"> (optional)</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <ApiResponse <object> > HttpPostDashboardsAsyncWithHttpInfo(DashboardConfigBean body = null)
        {
            var    localVarPath         = "/habmin/dashboards";
            var    localVarPathParams   = new Dictionary <string, string>();
            var    localVarQueryParams  = new List <KeyValuePair <string, string> >();
            var    localVarHeaderParams = new Dictionary <string, string>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <string, string>();
            var    localVarFileParams   = new Dictionary <string, FileParameter>();
            object localVarPostBody     = null;

            // to determine the Content-Type header
            string[] localVarHttpContentTypes = new string[] {
            };
            string localVarHttpContentType    = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            string[] localVarHttpHeaderAccepts = new string[] {
                "application/json"
            };
            string localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (body != null && body.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
            }
            else
            {
                localVarPostBody = body; // byte array
            }


            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                       Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                       localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("HttpPostDashboards", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <object>(localVarStatusCode,
                                            localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                            null));
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="dashboardId"></param>
        /// <param name="body"> (optional)</param>
        /// <returns>ApiResponse of Object(void)</returns>
        public ApiResponse <object> HttpPutDashboardsWithHttpInfo(int?dashboardId, DashboardConfigBean body = null)
        {
            // verify the required parameter 'dashboardId' is set
            if (dashboardId == null)
            {
                throw new ApiException(400, "Missing required parameter 'dashboardId' when calling HabminDashboardsApi->HttpPutDashboards");
            }

            var    localVarPath         = "/habmin/dashboards/{dashboardId}";
            var    localVarPathParams   = new Dictionary <string, string>();
            var    localVarQueryParams  = new List <KeyValuePair <string, string> >();
            var    localVarHeaderParams = new Dictionary <string, string>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <string, string>();
            var    localVarFileParams   = new Dictionary <string, FileParameter>();
            object localVarPostBody     = null;

            // to determine the Content-Type header
            string[] localVarHttpContentTypes = new string[] {
            };
            string localVarHttpContentType    = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            string[] localVarHttpHeaderAccepts = new string[] {
                "application/json"
            };
            string localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (dashboardId != null)
            {
                localVarPathParams.Add("dashboardId", Configuration.ApiClient.ParameterToString(dashboardId));                      // path parameter
            }
            if (body != null && body.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
            }
            else
            {
                localVarPostBody = body; // byte array
            }


            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("HttpPutDashboards", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <object>(localVarStatusCode,
                                            localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                            null));
        }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <exception cref="ApiException">Thrown when fails to make API call</exception>
 /// <param name="dashboardId"></param>
 /// <param name="body"> (optional)</param>
 /// <returns></returns>
 public void HttpPutDashboards(int?dashboardId, DashboardConfigBean body = null)
 {
     HttpPutDashboardsWithHttpInfo(dashboardId, body);
 }
コード例 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <exception cref="ApiException">Thrown when fails to make API call</exception>
 /// <param name="body"> (optional)</param>
 /// <returns>Task of void</returns>
 public async System.Threading.Tasks.Task HttpPostDashboardsAsync(DashboardConfigBean body = null)
 {
     await HttpPostDashboardsAsyncWithHttpInfo(body);
 }
コード例 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <exception cref="ApiException">Thrown when fails to make API call</exception>
 /// <param name="body"> (optional)</param>
 /// <returns></returns>
 public void HttpPostDashboards(DashboardConfigBean body = null)
 {
     HttpPostDashboardsWithHttpInfo(body);
 }
コード例 #6
0
 /// <summary>
 ///
 /// </summary>
 /// <exception cref="ApiException">Thrown when fails to make API call</exception>
 /// <param name="dashboardId"></param>
 /// <param name="body"> (optional)</param>
 /// <returns>Task of void</returns>
 public async System.Threading.Tasks.Task HttpPutDashboardsAsync(int?dashboardId, DashboardConfigBean body = null)
 {
     await HttpPutDashboardsAsyncWithHttpInfo(dashboardId, body);
 }