You are here

public function ContentHubConnectionManager::removeWebhookSuppression in Acquia Content Hub 8.2

Remove webhook suppression.

Parameters

string $webhook_uuid: Webhook uuid.

Return value

bool TRUE if we get the response with success TRUE value.

File

src/ContentHubConnectionManager.php, line 435

Class

ContentHubConnectionManager
Responsible for connection management actions.

Namespace

Drupal\acquia_contenthub

Code

public function removeWebhookSuppression(string $webhook_uuid) : bool {
  $this
    ->initialize();
  $response_body = $this->client
    ->unSuppressWebhook($webhook_uuid);
  if (!empty($response_body) && $response_body['success'] === TRUE) {
    return TRUE;
  }
  if (empty($response_body)) {
    $this->logger
      ->error('DELETE request against webhook suppression endpoint returned with an empty body.');
    return FALSE;
  }
  $this->logger
    ->error('Could not register with environment variables: @e_message', [
    '@e_message' => $response_body['error']['message'],
  ]);
  return FALSE;
}