Total Complexity | 3 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Insights implements CloudApi |
||
15 | { |
||
16 | |||
17 | /** @var ClientInterface The API client. */ |
||
18 | protected $client; |
||
19 | |||
20 | /** |
||
21 | * Client constructor. |
||
22 | * |
||
23 | * @param ClientInterface $client |
||
24 | */ |
||
25 | public function __construct(ClientInterface $client) |
||
26 | { |
||
27 | $this->client = $client; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * Returns Insight data for all sites associated with the application by its UUID. |
||
32 | * |
||
33 | * @param string $applicationUuid |
||
34 | * @return InsightsResponse |
||
35 | */ |
||
36 | public function getAll($applicationUuid) |
||
37 | { |
||
38 | return new InsightsResponse( |
||
39 | $this->client->request( |
||
|
|||
40 | 'get', |
||
41 | "/applications/${applicationUuid}/insight" |
||
42 | ) |
||
43 | ); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Returns insight data for a particular site. |
||
48 | * |
||
49 | * @param string $siteId |
||
50 | * @return InsightResponse |
||
51 | */ |
||
52 | public function get($siteId) |
||
58 | ) |
||
59 | ); |
||
60 | } |
||
62 |