Skip to content

get_function_definition async

get_function_definition(
    function_definition_id: __string,
    *,
    config_overrides: Optional[AsyncGreengrassClientConfig] = None,
) -> GetFunctionDefinitionResponse

Retrieves information about a Lambda function definition, including its creation time and latest version.

Parameters:

  • function_definition_id (__string) –

    The ID of the Lambda function definition.

Raises:

Source code in docs_src/capo_greengrass/_services/async_greengrass.py
async def get_function_definition(
    self,
    function_definition_id: "capo_greengrass.types.__string.__string",
    *,
    config_overrides: Optional[AsyncGreengrassClientConfig] = None,
) -> "capo_greengrass.types.get_function_definition_response.GetFunctionDefinitionResponse":
    """Retrieves information about a Lambda function definition, including its creation time and latest version.

    Args:
        function_definition_id: The ID of the Lambda function definition.

    Raises:
        capo_greengrass.errors.bad_request_exception.BadRequestException: General error information.
        capo_greengrass.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_greengrass.types.get_function_definition_request.GetFunctionDefinitionRequest]",
    ) -> AsyncOperationResponse[
        "capo_greengrass.types.get_function_definition_response.GetFunctionDefinitionResponse"
    ]:
        import capo_greengrass._operations.greengrass.get_function_definition

        (
            output,
            http_response,
        ) = await capo_greengrass._operations.greengrass.get_function_definition.async_get_function_definition(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetFunctionDefinition")
    )
    input_: capo_greengrass.types.get_function_definition_request.GetFunctionDefinitionRequest = {
        "function_definition_id": function_definition_id
    }

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