| Total Complexity | 9 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 8 | class Tag |
||
| 9 | { |
||
| 10 | public Client $HttpClient; |
||
| 11 | public function __construct(Client $HttpClient) |
||
| 12 | { |
||
| 13 | $this->HttpClient=$HttpClient; |
||
| 14 | } |
||
| 15 | public function all(){ |
||
| 16 | return ApiResponse::BodyResponse($this->HttpClient->get("com/vmware/cis/tagging/tag")); |
||
| 17 | } |
||
| 18 | public function get($tag_id){ |
||
| 19 | return ApiResponse::BodyResponse($this->HttpClient->get("com/vmware/cis/tagging/tag/id:$tag_id")); |
||
| 20 | } |
||
| 21 | public function delete($tag_id){ |
||
| 22 | return ApiResponse::BodyResponse($this->HttpClient->delete("com/vmware/cis/tagging/tag/id:$tag_id")); |
||
| 23 | } |
||
| 24 | public function update($tag_id,array $config){ |
||
| 27 | ])); |
||
| 28 | } |
||
| 29 | public function allTagsForCategory($category_id){ |
||
| 30 | return ApiResponse::BodyResponse($this->HttpClient->post("com/vmware/cis/tagging/tag/id:$category_id?~action=list-tags-for-category")); |
||
| 31 | } |
||
| 32 | public function addToUsedBy($tag_id,$entity){ |
||
| 33 | return ApiResponse::BodyResponse($this->HttpClient->post("com/vmware/cis/tagging/tag/id:$tag_id?~action=add-to-used-by", |
||
| 34 | [ |
||
| 35 | "json"=> |
||
| 36 | [ |
||
| 37 | "used_by_entity"=>$entity |
||
| 38 | ] |
||
| 39 | ] |
||
| 40 | )); |
||
| 41 | } |
||
| 42 | public function removeUsedToBy($tag_id,$entity){ |
||
| 43 | return ApiResponse::BodyResponse($this->HttpClient->post("com/vmware/cis/tagging/tag/id:$tag_id?~action=remove-from-used-by", |
||
| 44 | [ |
||
| 45 | "json"=> |
||
| 46 | [ |
||
| 47 | "used_by_entity"=>$entity |
||
| 48 | ] |
||
| 49 | ] |
||
| 50 | )); |
||
| 51 | } |
||
| 52 | public function revokePropagatingPermissions($tag_id){ |
||
| 54 | } |
||
| 55 | } |