Total Complexity | 5 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class EnvelopeTemplateLabelsEndpoint extends ResourceEndpoint |
||
15 | { |
||
16 | /** |
||
17 | * @param EnvelopeTemplate|string $template |
||
18 | */ |
||
19 | public function __construct(EnvelopeTemplatesEndpoint $parent, $template) |
||
20 | { |
||
21 | parent::__construct($parent, '/{template}/labels', Label::class, ['template' => $template]); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @return Collection<Label> |
||
26 | */ |
||
27 | public function all(): Collection |
||
28 | { |
||
29 | return $this->createCollectionResource($this->getRequest(), $this->getResourceClass()); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param array<string> $body |
||
34 | * @return Collection<Label> |
||
35 | */ |
||
36 | public function set(array $body): Collection |
||
37 | { |
||
38 | return $this->createCollectionResource($this->putRequest('', ['json' => $body]), $this->getResourceClass()); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @param Label|string $label |
||
43 | */ |
||
44 | public function add($label): void |
||
45 | { |
||
46 | $this->putRequest('/{label}', ['label' => $label]); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param Label|string $label |
||
51 | */ |
||
52 | public function remove($label): void |
||
55 | } |
||
56 | } |
||
57 |