Skip to content

Commit 26d9a1f

Browse files
committed
chore: skeleton for OutgoingWebhook service
1 parent 89f1b53 commit 26d9a1f

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

http_webhooks.services.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
logger.channel.http_webhooks:
3+
parent: logger.channel_base
4+
arguments: ['http_webhooks']
5+
http_webhooks.outgoing_webhook:
6+
class: Drupal\http_webhooks\OutgoingWebhook
7+
arguments: ['@http_client', '@serialization.json']

src/OutgoingWebhook.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
namespace Drupal\http_webhooks;
4+
use GuzzleHttp\ClientInterface;
5+
use Drupal\Component\Serialization\SerializationInterface;
6+
7+
/**
8+
* Class OutgoingWebhook.
9+
*/
10+
class OutgoingWebhook {
11+
12+
/**
13+
* GuzzleHttp\ClientInterface definition.
14+
*
15+
* @var \GuzzleHttp\ClientInterface
16+
*/
17+
protected $httpClient;
18+
19+
/**
20+
* Drupal\Component\Serialization\SerializationInterface definition.
21+
*
22+
* @var \Drupal\Component\Serialization\SerializationInterface
23+
*/
24+
protected $serializationJson;
25+
26+
/**
27+
* Constructs a new OutgoingWebhook object.
28+
*/
29+
public function __construct(ClientInterface $http_client, SerializationInterface $serialization_json) {
30+
$this->httpClient = $http_client;
31+
$this->serializationJson = $serialization_json;
32+
}
33+
34+
}

0 commit comments

Comments
 (0)