|  1:  | <?php | 
|  2:  |  | 
|  3:  | declare(strict_types=1); | 
|  4:  |  | 
|  5:  |  | 
|  6:  |  | 
|  7:  |  | 
|  8:  |  | 
|  9:  |  | 
| 10:  |  | 
| 11:  |  | 
| 12:  |  | 
| 13:  |  | 
| 14:  |  | 
| 15:  |  | 
| 16:  | namespace OpenSearch\Endpoints\Security; | 
| 17:  |  | 
| 18:  | use OpenSearch\Exception\RuntimeException; | 
| 19:  | use OpenSearch\Endpoints\AbstractEndpoint; | 
| 20:  |  | 
| 21:  |  | 
| 22:  |  | 
| 23:  |  | 
| 24:  | class DeleteDistinguishedName extends AbstractEndpoint | 
| 25:  | { | 
| 26:  |     protected $cluster_name; | 
| 27:  |  | 
| 28:  |     public function getURI(): string | 
| 29:  |     { | 
| 30:  |         if (!isset($this->cluster_name) || $this->cluster_name === '') { | 
| 31:  |             throw new RuntimeException('cluster_name is required for delete_distinguished_name'); | 
| 32:  |         } | 
| 33:  |         $cluster_name = $this->cluster_name; | 
| 34:  |  | 
| 35:  |         return '/_plugins/_security/api/nodesdn/' . rawurlencode($cluster_name); | 
| 36:  |     } | 
| 37:  |  | 
| 38:  |     public function getParamWhitelist(): array | 
| 39:  |     { | 
| 40:  |         return [ | 
| 41:  |             'pretty', | 
| 42:  |             'human', | 
| 43:  |             'error_trace', | 
| 44:  |             'source', | 
| 45:  |             'filter_path' | 
| 46:  |         ]; | 
| 47:  |     } | 
| 48:  |  | 
| 49:  |     public function getMethod(): string | 
| 50:  |     { | 
| 51:  |         return 'DELETE'; | 
| 52:  |     } | 
| 53:  |  | 
| 54:  |     public function setClusterName($cluster_name): static | 
| 55:  |     { | 
| 56:  |         if (is_null($cluster_name)) { | 
| 57:  |             return $this; | 
| 58:  |         } | 
| 59:  |         $this->cluster_name = $cluster_name; | 
| 60:  |  | 
| 61:  |         return $this; | 
| 62:  |     } | 
| 63:  | } | 
| 64:  |  |