-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generator and add proxies/patches for backward compatibility (#204)
Signed-off-by: saimedhi <saimedhi@amazon.com>
- Loading branch information
Showing
32 changed files
with
862 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Proxy function to createPointInTime() to prevent BC break. | ||
* This API will be removed in a future version. Use 'createPit' API instead. | ||
*/ | ||
public function createPointInTime(array $params = []) | ||
{ | ||
return $this->createPit($params); | ||
} | ||
EOD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Proxy function to deletePointInTime() to prevent BC break. | ||
* This API will be removed in a future version. Use 'deletePit' API instead. | ||
*/ | ||
public function deletePointInTime(array $params = []) | ||
{ | ||
return $this->deletePit($params); | ||
} | ||
EOD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Changes the password for the current user. | ||
* | ||
* $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. | ||
* $params['human'] = (boolean) Whether to return human readable values for statistics. | ||
* $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. | ||
* $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. | ||
* $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. | ||
* $params['current_password'] = (string) The current password | ||
* $params['password'] = (string) New password | ||
* | ||
* @param array $params Associative array of parameters | ||
* @return array | ||
*/ | ||
public function changePassword(array $params = []) | ||
{ | ||
$body = $this->extractArgument($params, 'body'); | ||
if ($body ===null) { | ||
$body =[ | ||
'current_password' => $this->extractArgument($params, 'current_password'), | ||
'password' => $this->extractArgument($params, 'password'), | ||
]; | ||
} | ||
$endpointBuilder = $this->endpoints; | ||
$endpoint = $endpointBuilder('Security\ChangePassword'); | ||
$endpoint->setParams($params); | ||
$endpoint->setBody($body); | ||
return $this->performRequest($endpoint); | ||
} | ||
EOD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Creates or replaces the specified action group. | ||
* | ||
* $params['action_group'] = (string) The name of the action group to create or replace. (Required) | ||
* $params['allowed_actions'] = (array) list of allowed actions | ||
* $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. | ||
* $params['human'] = (boolean) Whether to return human readable values for statistics. | ||
* $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. | ||
* $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. | ||
* $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. | ||
* | ||
* @param array $params Associative array of parameters | ||
* @return array | ||
*/ | ||
public function createActionGroup(array $params = []) | ||
{ | ||
$action_group = $this->extractArgument($params, 'action_group'); | ||
$body = $this->extractArgument($params, 'body'); | ||
if ($body ===null) { | ||
$body =[ | ||
'allowed_actions' => $this->extractArgument($params, 'allowed_actions'), | ||
]; | ||
} | ||
$endpointBuilder = $this->endpoints; | ||
$endpoint = $endpointBuilder('Security\CreateActionGroup'); | ||
$endpoint->setParams($params); | ||
$endpoint->setActionGroup($action_group); | ||
$endpoint->setBody($body); | ||
return $this->performRequest($endpoint); | ||
} | ||
EOD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Creates or replaces the specified role mapping. | ||
* | ||
* $params['role'] = (string) (Required) | ||
* $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. | ||
* $params['human'] = (boolean) Whether to return human readable values for statistics. | ||
* $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. | ||
* $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. | ||
* $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. | ||
* $params['backend_roles'] = (array) | ||
* $params['hosts'] = (array) | ||
* $params['users'] = (array) | ||
* | ||
* @param array $params Associative array of parameters | ||
* @return array | ||
*/ | ||
public function createRoleMapping(array $params = []) | ||
{ | ||
$role = $this->extractArgument($params, 'role'); | ||
$body = $this->extractArgument($params, 'body'); | ||
if ($body ===null) { | ||
$body = array_filter([ | ||
'backend_roles' => $this->extractArgument($params, 'backend_roles'), | ||
'hosts' => $this->extractArgument($params, 'hosts'), | ||
'users' => $this->extractArgument($params, 'users'), | ||
]); | ||
} | ||
$endpointBuilder = $this->endpoints; | ||
$endpoint = $endpointBuilder('Security\CreateRoleMapping'); | ||
$endpoint->setParams($params); | ||
$endpoint->setRole($role); | ||
$endpoint->setBody($body); | ||
return $this->performRequest($endpoint); | ||
} | ||
EOD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Creates or replaces the specified role. | ||
* | ||
* $params['role'] = (string) (Required) | ||
* $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. | ||
* $params['human'] = (boolean) Whether to return human readable values for statistics. | ||
* $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. | ||
* $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. | ||
* $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. | ||
* $params['cluster_permissions'] = (array) | ||
* $params['index_permissions'] = (array) | ||
* $params['tenant_permissions'] = (array) | ||
* | ||
* @param array $params Associative array of parameters | ||
* @return array | ||
*/ | ||
public function createRole(array $params = []) | ||
{ | ||
$role = $this->extractArgument($params, 'role'); | ||
$body = $this->extractArgument($params, 'body'); | ||
if ($body ===null) { | ||
$body = array_filter([ | ||
'cluster_permissions' => $this->extractArgument($params, 'cluster_permissions'), | ||
'index_permissions' => $this->extractArgument($params, 'index_permissions'), | ||
'tenant_permissions' => $this->extractArgument($params, 'tenant_permissions'), | ||
]); | ||
} | ||
$endpointBuilder = $this->endpoints; | ||
$endpoint = $endpointBuilder('Security\CreateRole'); | ||
$endpoint->setParams($params); | ||
$endpoint->setRole($role); | ||
$endpoint->setBody($body); | ||
return $this->performRequest($endpoint); | ||
} | ||
EOD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Creates or replaces the specified tenant. | ||
* | ||
* $params['tenant'] = (string) The name of the tenant to create | ||
* $params['description'] = (string) Description of the tenant | ||
* $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. | ||
* $params['human'] = (boolean) Whether to return human readable values for statistics. | ||
* $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. | ||
* $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. | ||
* $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. | ||
* | ||
* @param array $params Associative array of parameters | ||
* @return array | ||
*/ | ||
public function createTenant(array $params = []) | ||
{ | ||
$tenant = $this->extractArgument($params, 'tenant'); | ||
$body = $this->extractArgument($params, 'body'); | ||
if ($body ===null) { | ||
$body = [ | ||
'description' => $this->extractArgument($params, 'description'), | ||
]; | ||
} | ||
$endpointBuilder = $this->endpoints; | ||
$endpoint = $endpointBuilder('Security\CreateTenant'); | ||
$endpoint->setParams($params); | ||
$endpoint->setTenant($tenant); | ||
$endpoint->setBody($body); | ||
return $this->performRequest($endpoint); | ||
} | ||
EOD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Creates or replaces the specified user. | ||
* | ||
* $params['username'] = (string) (Required) | ||
* $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. | ||
* $params['human'] = (boolean) Whether to return human readable values for statistics. | ||
* $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. | ||
* $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. | ||
* $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. | ||
* $params['password'] = (string) | ||
* $params['opendistro_security_roles'] = (array) | ||
* $params['backend_roles'] = (array) | ||
* $params['attributes'] = (array) | ||
* | ||
* @param array $params Associative array of parameters | ||
* @return array | ||
*/ | ||
public function createUser(array $params = []) | ||
{ | ||
$username = $this->extractArgument($params, 'username'); | ||
$body = $this->extractArgument($params, 'body'); | ||
if ($body ===null) { | ||
$body = array_filter([ | ||
'password' => $this->extractArgument($params, 'password'), | ||
'opendistro_security_roles' => $this->extractArgument($params, 'opendistro_security_roles'), | ||
'backend_roles' => $this->extractArgument($params, 'backend_roles'), | ||
'attributes' => $this->extractArgument($params, 'attributes'), | ||
]); | ||
} | ||
$endpointBuilder = $this->endpoints; | ||
$endpoint = $endpointBuilder('Security\CreateUser'); | ||
$endpoint->setParams($params); | ||
$endpoint->setUsername($username); | ||
$endpoint->setBody($body); | ||
return $this->performRequest($endpoint); | ||
} | ||
EOD; |
13 changes: 13 additions & 0 deletions
13
util/EndpointProxies/security/deleteDistinguishedNamesProxy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Proxy function to deleteDistinguishedNames() to prevent BC break. | ||
* This API will be removed in a future version. Use 'deleteDistinguishedName' API instead. | ||
*/ | ||
public function deleteDistinguishedNames(array $params = []) | ||
{ | ||
return $this->deleteDistinguishedName($params); | ||
} | ||
EOD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Proxy function to getAccount() to prevent BC break. | ||
* This API will be removed in a future version. Use 'getAccountDetails' API instead. | ||
*/ | ||
public function getAccount(array $params = []) | ||
{ | ||
return $this->getAccountDetails($params); | ||
} | ||
EOD; |
Oops, something went wrong.