1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * Copyright OpenSearch Contributors
7: * SPDX-License-Identifier: Apache-2.0
8: *
9: * The OpenSearch Contributors require contributions made to
10: * this file be licensed under the Apache-2.0 license or a
11: * compatible open source license.
12: */
13:
14: namespace OpenSearch\Endpoints\Ml;
15:
16: use OpenSearch\Common\Exceptions\RuntimeException;
17: use OpenSearch\Endpoints\AbstractEndpoint;
18:
19: class UpdateModelGroup extends AbstractEndpoint
20: {
21: /**
22: * @return string[]
23: */
24: public function getParamWhitelist(): array
25: {
26: return [];
27: }
28:
29: /**
30: * @return string
31: */
32: public function getURI(): string
33: {
34: if ($this->id) {
35: return "/_plugins/_ml/model_groups/$this->id";
36: }
37:
38: throw new RuntimeException(
39: 'id is required for update'
40: );
41: }
42:
43: /**
44: * @return string
45: */
46: public function getMethod(): string
47: {
48: return 'PUT';
49: }
50: }
51: