Skip to content

get_api_inventory_item async

get_api_inventory_item(
    method: HttpMethod,
    host: Host,
    port: int,
    path: Path,
    resource_arn: ResourceArn,
    *,
    config_overrides: Optional[AsyncAPIPortalClientConfig] = None,
) -> GetApiInventoryItemResponse

Gets full details of a single API inventory item.

Parameters:

  • method (HttpMethod) –

    The HTTP method of the API.

  • port (int) –

    The port the API listens on, from 0 to 65535.

  • path (Path) –

    The request path of the API.

  • resource_arn (ResourceArn) –

    The ARN of the resource that serves the API, such as an API Gateway stage or a load balancer.

Raises:

Source code in docs_src/capo_apiportal/_services/async_api_portal.py
async def get_api_inventory_item(
    self,
    method: "capo_apiportal.types.http_method.HttpMethod",
    host: "capo_apiportal.types.host.Host",
    port: int,
    path: "capo_apiportal.types.path.Path",
    resource_arn: "capo_apiportal.types.resource_arn.ResourceArn",
    *,
    config_overrides: Optional[AsyncAPIPortalClientConfig] = None,
) -> "capo_apiportal.types.get_api_inventory_item_response.GetApiInventoryItemResponse":
    """Gets full details of a single API inventory item.

    Args:
        method: The HTTP method of the API.
        port: The port the API listens on, from 0 to 65535.
        path: The request path of the API.
        resource_arn: The ARN of the resource that serves the API, such as an API Gateway stage or a load balancer.

    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.internal_server_exception.InternalServerException: The service encountered an internal error. Try the request again.
        capo_apiportal.errors.resource_not_found_exception.ResourceNotFoundException: The requested resource does not exist, or you do not have access to it.
        capo_apiportal.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_apiportal.types.get_api_inventory_item_request.GetApiInventoryItemRequest]",
    ) -> AsyncOperationResponse[
        "capo_apiportal.types.get_api_inventory_item_response.GetApiInventoryItemResponse"
    ]:
        import capo_apiportal._operations.api_portal_control_service.get_api_inventory_item

        (
            output,
            http_response,
        ) = await capo_apiportal._operations.api_portal_control_service.get_api_inventory_item.async_get_api_inventory_item(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetApiInventoryItem")
    )
    input_: capo_apiportal.types.get_api_inventory_item_request.GetApiInventoryItemRequest = {
        "method": method,
        "host": host,
        "port": port,
        "path": path,
        "resource_arn": resource_arn,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output