/// <summary>
        /// Update Webhook. Update a webhook in the ChannelEngine.
        /// </summary>
        /// <exception cref="ChannelEngine.Merchant.ApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="merchantWebhookRequest"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <ApiResponse> WebhooksUpdateAsync(MerchantWebhookRequest merchantWebhookRequest = default(MerchantWebhookRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            ChannelEngine.Merchant.ApiClient.Client.ApiResponse <ApiResponse> localVarResponse = await WebhooksUpdateWithHttpInfoAsync(merchantWebhookRequest, cancellationToken).ConfigureAwait(false);

            return(localVarResponse.Data);
        }
        /// <summary>
        /// Update Webhook. Update a webhook in the ChannelEngine.
        /// </summary>
        /// <exception cref="ChannelEngine.Merchant.ApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="merchantWebhookRequest"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (ApiResponse)</returns>
        public async System.Threading.Tasks.Task <ChannelEngine.Merchant.ApiClient.Client.ApiResponse <ApiResponse> > WebhooksUpdateWithHttpInfoAsync(MerchantWebhookRequest merchantWebhookRequest = default(MerchantWebhookRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            ChannelEngine.Merchant.ApiClient.Client.RequestOptions localVarRequestOptions = new ChannelEngine.Merchant.ApiClient.Client.RequestOptions();

            string[] _contentTypes = new string[] {
                "application/json-patch+json",
                "application/json",
                "application/_*+json"
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };


            var localVarContentType = ChannelEngine.Merchant.ApiClient.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ChannelEngine.Merchant.ApiClient.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = merchantWebhookRequest;

            // authentication (apiKey) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("apikey")))
            {
                localVarRequestOptions.QueryParameters.Add(ChannelEngine.Merchant.ApiClient.Client.ClientUtils.ParameterToMultiMap("", "apikey", this.Configuration.GetApiKeyWithPrefix("apikey")));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PutAsync <ApiResponse>("/v2/webhooks", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("WebhooksUpdate", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
 /// <summary>
 /// Update Webhook. Update a webhook in the ChannelEngine.
 /// </summary>
 /// <exception cref="ChannelEngine.Merchant.ApiClient.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="merchantWebhookRequest"> (optional)</param>
 /// <returns>ApiResponse</returns>
 public ApiResponse WebhooksUpdate(MerchantWebhookRequest merchantWebhookRequest = default(MerchantWebhookRequest))
 {
     ChannelEngine.Merchant.ApiClient.Client.ApiResponse <ApiResponse> localVarResponse = WebhooksUpdateWithHttpInfo(merchantWebhookRequest);
     return(localVarResponse.Data);
 }