async def create_managed_api(
self,
api_signature: "capo_apiportal.types.api_signature.ApiSignature",
*,
config_overrides: Optional[AsyncAPIPortalClientConfig] = None,
tags: Optional["capo_apiportal.types.tags.Tags"] = None,
) -> "capo_apiportal.types.create_managed_api_response.CreateManagedApiResponse":
"""Promote a discovered API in the API inventory into the managed API list.
Args:
api_signature: The resource, method, host, port, and path that identify the API.
Raises:
capo_apiportal.errors.access_denied_exception.AccessDeniedException: You do not have permission to perform this operation.
capo_apiportal.errors.bad_request_exception.BadRequestException: The request is not valid. The message identifies the field or value that failed validation.
capo_apiportal.errors.conflict_exception.ConflictException: The request conflicts with the current state of the resource, for example because another operation on it is still in progress.
capo_apiportal.errors.limit_exceeded_exception.LimitExceededException: The request rate or a service quota was exceeded. Reduce the request rate or the number of resources and try again.
capo_apiportal.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_apiportal.types.create_managed_api_request.CreateManagedApiRequest]",
) -> AsyncOperationResponse[
"capo_apiportal.types.create_managed_api_response.CreateManagedApiResponse"
]:
import capo_apiportal._operations.api_portal_control_service.create_managed_api
(
output,
http_response,
) = await capo_apiportal._operations.api_portal_control_service.create_managed_api.async_create_managed_api(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateManagedApi")
)
input_: capo_apiportal.types.create_managed_api_request.CreateManagedApiRequest = {
"api_signature": api_signature
}
if tags is not None:
input_["tags"] = tags
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output