fixed generator (#738)

Signed-off-by: saimedhi <saimedhi@amazon.com>
This commit is contained in:
Sai Medhini Reddy Maryada
2024-05-01 13:59:17 -07:00
committed by GitHub
parent 0caacf870c
commit 9a67bbfd16
5 changed files with 48 additions and 12 deletions
+1
View File
@@ -14,6 +14,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- Updated code generator to use native OpenAPI specification ([#721](https://github.com/opensearch-project/opensearch-py/pull/721))
### Updated APIs
- Updated opensearch-py APIs to reflect [opensearch-api-specification@d3783f1](https://github.com/opensearch-project/opensearch-api-specification/commit/d3783f1200fdc5799eba861842ee611f2c7e30e7)
- Updated opensearch-py APIs to reflect [opensearch-api-specification@3ed6aaf](https://github.com/opensearch-project/opensearch-api-specification/commit/3ed6aaff0ce51af3aad00fe57c34d1a7056bd6d1)
- Updated opensearch-py APIs to reflect [opensearch-api-specification@af4a34f](https://github.com/opensearch-project/opensearch-api-specification/commit/af4a34f9847d36709b5a394be7c76fda4649ccc8)
- Updated opensearch-py APIs to reflect [opensearch-api-specification@e02c076](https://github.com/opensearch-project/opensearch-api-specification/commit/e02c076ef63f7a9b650ca1416380120cc640620a)
+14 -1
View File
@@ -18,7 +18,7 @@
from typing import Any
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
from .utils import SKIP_IN_PATH, NamespacedClient, _bulk_body, _make_path, query_params
class SecurityClient(NamespacedClient):
@@ -244,6 +244,7 @@ class SecurityClient(NamespacedClient):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
_make_path("_plugins", "_security", "api", "actiongroups", action_group),
@@ -277,6 +278,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/actiongroups",
@@ -439,6 +441,7 @@ class SecurityClient(NamespacedClient):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
_make_path("_plugins", "_security", "api", "internalusers", username),
@@ -472,6 +475,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/internalusers",
@@ -631,6 +635,7 @@ class SecurityClient(NamespacedClient):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
_make_path("_plugins", "_security", "api", "roles", role),
@@ -664,6 +669,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/roles",
@@ -826,6 +832,7 @@ class SecurityClient(NamespacedClient):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
_make_path("_plugins", "_security", "api", "rolesmapping", role),
@@ -859,6 +866,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/rolesmapping",
@@ -1018,6 +1026,7 @@ class SecurityClient(NamespacedClient):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
_make_path("_plugins", "_security", "api", "tenants", tenant),
@@ -1051,6 +1060,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/tenants/",
@@ -1145,6 +1155,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/securityconfig",
@@ -1468,6 +1479,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/audit",
@@ -1501,6 +1513,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return await self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/nodesdn",
+14 -1
View File
@@ -18,7 +18,7 @@
from typing import Any
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
from .utils import SKIP_IN_PATH, NamespacedClient, _bulk_body, _make_path, query_params
class SecurityClient(NamespacedClient):
@@ -244,6 +244,7 @@ class SecurityClient(NamespacedClient):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
_make_path("_plugins", "_security", "api", "actiongroups", action_group),
@@ -277,6 +278,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/actiongroups",
@@ -439,6 +441,7 @@ class SecurityClient(NamespacedClient):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
_make_path("_plugins", "_security", "api", "internalusers", username),
@@ -472,6 +475,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/internalusers",
@@ -631,6 +635,7 @@ class SecurityClient(NamespacedClient):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
_make_path("_plugins", "_security", "api", "roles", role),
@@ -664,6 +669,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/roles",
@@ -826,6 +832,7 @@ class SecurityClient(NamespacedClient):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
_make_path("_plugins", "_security", "api", "rolesmapping", role),
@@ -859,6 +866,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/rolesmapping",
@@ -1018,6 +1026,7 @@ class SecurityClient(NamespacedClient):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
_make_path("_plugins", "_security", "api", "tenants", tenant),
@@ -1051,6 +1060,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/tenants/",
@@ -1145,6 +1155,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/securityconfig",
@@ -1468,6 +1479,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/audit",
@@ -1501,6 +1513,7 @@ class SecurityClient(NamespacedClient):
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
body = _bulk_body(self.transport.serializer, body)
return self.transport.perform_request(
"PATCH",
"/_plugins/_security/api/nodesdn",
+18 -9
View File
@@ -731,15 +731,24 @@ def read_modules() -> Any:
]["required"]
}
)
q = data["components"]["requestBodies"][requestbody_ref]["content"][
"application/json"
][
"schema"
] # pylint: disable=invalid-name
if "description" in q:
body.update({"description": q["description"]})
if "x-serialize" in q:
body.update({"serialize": q["x-serialize"]})
if (
"application/x-ndjson"
in data["components"]["requestBodies"][requestbody_ref][
"content"
]
):
requestbody_schema = data["components"]["requestBodies"][
requestbody_ref
]["content"]["application/x-ndjson"]["schema"]
body.update({"serialize": True})
else:
requestbody_schema = data["components"]["requestBodies"][
requestbody_ref
]["content"]["application/json"]["schema"]
if "description" in requestbody_schema:
body.update({"description": requestbody_schema["description"]})
api.update({"body": body})
+1 -1
View File
@@ -36,7 +36,7 @@
{% endif %}
{% include "substitutions" %}
{% include "required" %}
{% if api.body.serialize == "bulk" %}
{% if api.body.serialize %}
body = _bulk_body(self.transport.serializer, body)
{% endif %}
{% block request %}