Skip to content

Commit

Permalink
Generated SecurityNamespace Endpoints Using OpenSearch API Specificat…
Browse files Browse the repository at this point in the history
…ions (#207)

Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi authored Jul 9, 2024
1 parent fc749ea commit e458c51
Show file tree
Hide file tree
Showing 104 changed files with 5,363 additions and 933 deletions.
47 changes: 47 additions & 0 deletions src/OpenSearch/Endpoints/Security/Authinfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

declare(strict_types=1);

/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

namespace OpenSearch\Endpoints\Security;

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class Authinfo extends AbstractEndpoint
{
public function getURI(): string
{
return "/_plugins/_security/authinfo";
}

public function getParamWhitelist(): array
{
return [
'auth_type',
'verbose',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'GET';
}
}
45 changes: 45 additions & 0 deletions src/OpenSearch/Endpoints/Security/Authtoken.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

declare(strict_types=1);

/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

namespace OpenSearch\Endpoints\Security;

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class Authtoken extends AbstractEndpoint
{
public function getURI(): string
{
return "/_plugins/_security/api/authtoken";
}

public function getParamWhitelist(): array
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'POST';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,25 @@

use OpenSearch\Endpoints\AbstractEndpoint;

class GetAccount extends AbstractEndpoint
/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class Cache extends AbstractEndpoint
{
public function getParamWhitelist(): array
public function getURI(): string
{
return [];
return "/_plugins/_security/api/cache";
}

public function getURI(): string
public function getParamWhitelist(): array
{
return '/_plugins/_security/api/account';
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
Expand Down
28 changes: 22 additions & 6 deletions src/OpenSearch/Endpoints/Security/ChangePassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,39 @@

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class ChangePassword extends AbstractEndpoint
{
public function getURI(): string
{
return "/_plugins/_security/api/account";
}

public function getParamWhitelist(): array
{
return [
'current_password',
'password',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getURI(): string
public function getMethod(): string
{
return '/_plugins/_security/api/account';
return 'PUT';
}

public function getMethod(): string
public function setBody($body): ChangePassword
{
return 'PUT';
if (isset($body) !== true) {
return $this;
}
$this->body = $body;

return $this;
}
}
45 changes: 45 additions & 0 deletions src/OpenSearch/Endpoints/Security/ConfigUpgradeCheck.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

declare(strict_types=1);

/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

namespace OpenSearch\Endpoints\Security;

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class ConfigUpgradeCheck extends AbstractEndpoint
{
public function getURI(): string
{
return "/_plugins/_security/_upgrade_check";
}

public function getParamWhitelist(): array
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'GET';
}
}
55 changes: 55 additions & 0 deletions src/OpenSearch/Endpoints/Security/ConfigUpgradePerform.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

declare(strict_types=1);

/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

namespace OpenSearch\Endpoints\Security;

use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class ConfigUpgradePerform extends AbstractEndpoint
{
public function getURI(): string
{
return "/_plugins/_security/_upgrade_perform";
}

public function getParamWhitelist(): array
{
return [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getMethod(): string
{
return 'POST';
}

public function setBody($body): ConfigUpgradePerform
{
if (isset($body) !== true) {
return $this;
}
$this->body = $body;

return $this;
}
}
49 changes: 32 additions & 17 deletions src/OpenSearch/Endpoints/Security/CreateActionGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,55 @@
use OpenSearch\Common\Exceptions\RuntimeException;
use OpenSearch\Endpoints\AbstractEndpoint;

/**
* NOTE: This file is autogenerated using util/GenerateEndpoints.php
*/
class CreateActionGroup extends AbstractEndpoint
{
/**
* @var string|null
*/
protected $action_group;

public function getURI(): string
{
if (isset($this->action_group) !== true) {
throw new RuntimeException(
'action_group is required for create_action_group'
);
}
$action_group = $this->action_group;
return "/_plugins/_security/api/actiongroups/$action_group";
}

public function getParamWhitelist(): array
{
return [
'allowed_actions'
'pretty',
'human',
'error_trace',
'source',
'filter_path'
];
}

public function getURI(): string
public function getMethod(): string
{
if (!isset($this->action_group)) {
throw new RuntimeException('Missing parameter for the endpoint security.create_action_group');
}

return "/_plugins/_security/api/actiongroups/$this->action_group";
return 'PUT';
}

public function getMethod(): string
public function setBody($body): CreateActionGroup
{
return 'PUT';
if (isset($body) !== true) {
return $this;
}
$this->body = $body;

return $this;
}

/**
* @param string|null $action_group
* @return CreateActionGroup
*/
public function setActionGroup(?string $action_group): CreateActionGroup
public function setActionGroup($action_group): CreateActionGroup
{
if (isset($action_group) !== true) {
return $this;
}
$this->action_group = $action_group;

return $this;
Expand Down
Loading

0 comments on commit e458c51

Please sign in to comment.