Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated SecurityNamespace Endpoints Using OpenSearch API Specifications #207

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading