Notifications::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace AcquiaCloudApi\Endpoints;
4
5
use AcquiaCloudApi\Response\NotificationResponse;
6
use AcquiaCloudApi\Response\NotificationsResponse;
7
8
/**
9
 * Class Notifications
10
 *
11
 * @package AcquiaCloudApi\CloudApi
12
 */
13
class Notifications extends CloudApiBase
14
{
15
    /**
16
     * Returns details about a notification.
17
     */
18
    public function get(string $notificationUuid): NotificationResponse
19
    {
20
        return new NotificationResponse(
21
            $this->client->request(
22
                'get',
23
                "/notifications/$notificationUuid"
24
            )
25
        );
26
    }
27
28
    /**
29
     * Returns a list of notifications.
30
     *
31
     * @return NotificationsResponse<NotificationResponse>
32
     */
33
    public function getAll(string $applicationUuid): NotificationsResponse
34
    {
35
        return new NotificationsResponse(
36
            $this->client->request(
37
                'get',
38
                "/applications/$applicationUuid/notifications"
39
            )
40
        );
41
    }
42
}
43