Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 32
0.00% covered (danger)
0.00%
0 / 24
CRAP
0.00% covered (danger)
0.00%
0 / 1
WebhookEventLogRecord
0.00% covered (danger)
0.00%
0 / 32
0.00% covered (danger)
0.00%
0 / 24
600
0.00% covered (danger)
0.00%
0 / 1
 getEventId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setEventId
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getTaskId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setTaskId
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getResultMessage
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setResultMessage
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getHttpStatusCode
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setHttpStatusCode
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getResponseBody
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setResponseBody
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getAcknowledgementStatus
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setAcknowledgementStatus
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getResult
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setResult
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getCreatedAt
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setCreatedAt
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getWebhookId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setWebhookId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getHttpMethod
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setHttpMethod
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getEndpointUrl
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setEndpointUrl
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getEventName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setEventName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2019 (original work) Open Assessment Technologies SA;
19 */
20
21namespace oat\tao\model\webhooks\log;
22
23class WebhookEventLogRecord
24{
25    /** @var string|null */
26    private $eventId;
27
28    /** @var string|null */
29    private $taskId;
30
31    /** @var string|null */
32    private $webhookId;
33
34    /** @var string|null */
35    private $httpMethod;
36
37    /** @var string|null */
38    private $endpointUrl;
39
40    /** @var string|null */
41    private $eventName;
42
43    /**
44     * @var string|null
45     * @example port refused (in case of network error)
46     * @example unknown host (in case of network error)
47     * @example Undefined index: key (in case of internal error)
48     */
49    private $resultMessage;
50
51    /** @var int|null */
52    private $httpStatusCode;
53
54    /** @var string|null */
55    private $responseBody;
56
57    /** @var string|null */
58    private $acknowledgementStatus;
59
60    /** @var string|null */
61    private $createdAt;
62
63    /** @var string|null */
64    private $result;
65
66    public const RESULT_INTERNAL_ERROR = 'internal_error';
67    public const RESULT_NETWORK_ERROR = 'network_error';
68    public const RESULT_INVALID_BODY_FORMAT = 'invalid_body_format';
69    public const RESULT_INVALID_HTTP_STATUS = 'invalid_http_status';
70    public const RESULT_INVALID_ACKNOWLEDGEMENT = 'invalid_acknowledgement';
71    public const RESULT_OK = 'ok';
72
73    /**
74     * @return string|null
75     */
76    public function getEventId()
77    {
78        return $this->eventId;
79    }
80
81    /**
82     * @param string $eventId
83     * @return $this
84     */
85    public function setEventId($eventId)
86    {
87        $this->eventId = $eventId;
88
89        return $this;
90    }
91
92    /**
93     * @return string|null
94     */
95    public function getTaskId()
96    {
97        return $this->taskId;
98    }
99
100    /**
101     * @param string|null $taskId
102     * @return $this
103     */
104    public function setTaskId($taskId)
105    {
106        $this->taskId = $taskId;
107
108        return $this;
109    }
110
111    /**
112     * @return string|null
113     */
114    public function getResultMessage()
115    {
116        return $this->resultMessage;
117    }
118
119    /**
120     * @param string $resultMessage
121     * @return $this
122     */
123    public function setResultMessage($resultMessage)
124    {
125        $this->resultMessage = $resultMessage;
126
127        return $this;
128    }
129
130    /**
131     * @return int|null
132     */
133    public function getHttpStatusCode()
134    {
135        return $this->httpStatusCode;
136    }
137
138    /**
139     * @param int $httpStatusCode
140     * @return $this
141     */
142    public function setHttpStatusCode($httpStatusCode)
143    {
144        $this->httpStatusCode = $httpStatusCode;
145
146        return $this;
147    }
148
149    /**
150     * @return string|null
151     */
152    public function getResponseBody()
153    {
154        return $this->responseBody;
155    }
156
157    /**
158     * @param string|null $responseBody
159     * @return $this
160     */
161    public function setResponseBody($responseBody)
162    {
163        $this->responseBody = $responseBody;
164
165        return $this;
166    }
167
168    /**
169     * @return string|null
170     */
171    public function getAcknowledgementStatus()
172    {
173        return $this->acknowledgementStatus;
174    }
175
176    /**
177     * @param string $acknowledgementStatus
178     * @return $this
179     */
180    public function setAcknowledgementStatus($acknowledgementStatus)
181    {
182        $this->acknowledgementStatus = $acknowledgementStatus;
183
184        return $this;
185    }
186
187    /**
188     * @return string|null
189     */
190    public function getResult()
191    {
192        return $this->result;
193    }
194
195    /**
196     * @param string $result
197     * @return $this
198     */
199    public function setResult($result)
200    {
201        $this->result = $result;
202
203        return $this;
204    }
205
206    /**
207     * @return int|null
208     */
209    public function getCreatedAt()
210    {
211        return $this->createdAt;
212    }
213
214    /**
215     * @param int $createdAt
216     * @return $this
217     */
218    public function setCreatedAt($createdAt)
219    {
220        $this->createdAt = $createdAt;
221
222        return $this;
223    }
224
225    /**
226     * @return string|null
227     */
228    public function getWebhookId()
229    {
230        return $this->webhookId;
231    }
232
233    /**
234     * @param string|null $webhookId
235     */
236    public function setWebhookId($webhookId)
237    {
238        $this->webhookId = $webhookId;
239    }
240
241    /**
242     * @return string|null
243     */
244    public function getHttpMethod()
245    {
246        return $this->httpMethod;
247    }
248
249    /**
250     * @param string|null $httpMethod
251     */
252    public function setHttpMethod($httpMethod)
253    {
254        $this->httpMethod = $httpMethod;
255    }
256
257    /**
258     * @return string|null
259     */
260    public function getEndpointUrl()
261    {
262        return $this->endpointUrl;
263    }
264
265    /**
266     * @param string|null $endpointUrl
267     */
268    public function setEndpointUrl($endpointUrl)
269    {
270        $this->endpointUrl = $endpointUrl;
271    }
272
273    /**
274     * @return string|null
275     */
276    public function getEventName()
277    {
278        return $this->eventName;
279    }
280
281    /**
282     * @param string|null $eventName
283     */
284    public function setEventName($eventName)
285    {
286        $this->eventName = $eventName;
287    }
288}