示例#1
0
 /// <summary>
 /// execute service method on Node to avoid excessive requests from client This operation will execute service method on Node
 /// </summary>
 /// <exception cref="Genesys.Internal.Provisioning.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="serviceName">Service name, just for human-readability of URL</param>
 /// <param name="body">Body data</param>
 /// <returns>Task of void</returns>
 public async System.Threading.Tasks.Task ExecuteServiceMethodAsync(string serviceName, ServiceProxyData body)
 {
     await ExecuteServiceMethodAsyncWithHttpInfo(serviceName, body);
 }
示例#2
0
        /// <summary>
        /// execute service method on Node to avoid excessive requests from client This operation will execute service method on Node
        /// </summary>
        /// <exception cref="Genesys.Internal.Provisioning.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="serviceName">Service name, just for human-readability of URL</param>
        /// <param name="body">Body data</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <ApiResponse <Object> > ExecuteServiceMethodAsyncWithHttpInfo(string serviceName, ServiceProxyData body)
        {
            // verify the required parameter 'serviceName' is set
            if (serviceName == null)
            {
                throw new ApiException(400, "Missing required parameter 'serviceName' when calling SystemApi->ExecuteServiceMethod");
            }
            // verify the required parameter 'body' is set
            if (body == null)
            {
                throw new ApiException(400, "Missing required parameter 'body' when calling SystemApi->ExecuteServiceMethod");
            }

            var    localVarPath         = "/service-proxy/{serviceName}";
            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[] {
                "application/json"
            };
            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 (serviceName != null)
            {
                localVarPathParams.Add("serviceName", Configuration.ApiClient.ParameterToString(serviceName));                      // 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)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("ExecuteServiceMethod", 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>
 /// execute service method on Node to avoid excessive requests from client This operation will execute service method on Node
 /// </summary>
 /// <exception cref="Genesys.Internal.Provisioning.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="serviceName">Service name, just for human-readability of URL</param>
 /// <param name="body">Body data</param>
 /// <returns></returns>
 public void ExecuteServiceMethod(string serviceName, ServiceProxyData body)
 {
     ExecuteServiceMethodWithHttpInfo(serviceName, body);
 }