Skip to content

get_function async

get_function(
    api_id: String,
    function_id: ResourceName,
    *,
    config_overrides: Optional[AsyncAppSyncClientConfig] = None,
) -> GetFunctionResponse

Get a Function.

Parameters:

Raises:

Source code in docs_src/capo_appsync/_services/async_app_sync.py
async def get_function(
    self,
    api_id: "capo_appsync.types.string.String",
    function_id: "capo_appsync.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[AsyncAppSyncClientConfig] = None,
) -> "capo_appsync.types.get_function_response.GetFunctionResponse":
    """<p>Get a <code>Function</code>.</p>

    Args:
        api_id: <p>The GraphQL API ID.</p>
        function_id: <p>The <code>Function</code> ID.</p>

    Raises:
        capo_appsync.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Another modification is in progress at this time and it must complete before you can make your change.</p>
        capo_appsync.errors.not_found_exception.NotFoundException: <p>The resource specified in the request was not found. Check the resource, and then try again.</p>
        capo_appsync.errors.unauthorized_exception.UnauthorizedException: <p>You aren't authorized to perform this operation.</p>
        capo_appsync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appsync.types.get_function_request.GetFunctionRequest]",
    ) -> AsyncOperationResponse[
        "capo_appsync.types.get_function_response.GetFunctionResponse"
    ]:
        import capo_appsync._operations.aws_deepdish_control_plane_service.get_function

        (
            output,
            http_response,
        ) = await capo_appsync._operations.aws_deepdish_control_plane_service.get_function.async_get_function(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetFunction")
    )
    input_: capo_appsync.types.get_function_request.GetFunctionRequest = {
        "api_id": api_id,
        "function_id": function_id,
    }

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