| 1: | <?php |
| 2: | |
| 3: | namespace OpenSearch; |
| 4: | |
| 5: | /** |
| 6: | * Provides and interface for endpoints. |
| 7: | */ |
| 8: | interface EndpointInterface |
| 9: | { |
| 10: | /** |
| 11: | * Get the whitelist of allowed parameters. |
| 12: | * |
| 13: | * @return string[] |
| 14: | */ |
| 15: | public function getParamWhitelist(): array; |
| 16: | |
| 17: | /** |
| 18: | * Get the URI. |
| 19: | */ |
| 20: | public function getURI(): string; |
| 21: | |
| 22: | /** |
| 23: | * Get the HTTP method. |
| 24: | */ |
| 25: | public function getMethod(): string; |
| 26: | |
| 27: | /** |
| 28: | * Set the query string parameters. |
| 29: | */ |
| 30: | public function setParams(array $params): static; |
| 31: | |
| 32: | /** |
| 33: | * Get the query string parameters. |
| 34: | */ |
| 35: | public function getParams(): array; |
| 36: | |
| 37: | /** |
| 38: | * Get the options. |
| 39: | * |
| 40: | * @return array<string, mixed> |
| 41: | */ |
| 42: | public function getOptions(): array; |
| 43: | |
| 44: | /** |
| 45: | * Get the index. |
| 46: | */ |
| 47: | public function getIndex(): ?string; |
| 48: | |
| 49: | /** |
| 50: | * Set the index. |
| 51: | * |
| 52: | * @param string|string[]|null $index |
| 53: | * |
| 54: | * @return $this |
| 55: | */ |
| 56: | public function setIndex(string|array|null $index): static; |
| 57: | |
| 58: | /** |
| 59: | * Get the document ID. |
| 60: | * |
| 61: | * @param int|string|null $docID |
| 62: | * |
| 63: | * @return $this |
| 64: | */ |
| 65: | public function setId(int|string|null $docID): static; |
| 66: | |
| 67: | /** |
| 68: | * Get the body of the request. |
| 69: | */ |
| 70: | public function getBody(): string|array|null; |
| 71: | |
| 72: | /** |
| 73: | * Set the body of the request. |
| 74: | * |
| 75: | * @param string|iterable<string,mixed>|null $body |
| 76: | */ |
| 77: | public function setBody(string|iterable|null $body): static; |
| 78: | |
| 79: | } |
| 80: |