Skip to content

update_api async

update_api(
    api_id: String,
    name: ApiName,
    event_config: EventConfig,
    *,
    config_overrides: Optional[AsyncAppSyncClientConfig] = None,
    owner_contact: Optional[String] = None,
) -> UpdateApiResponse

Updates an Api.

Parameters:

  • api_id (String) –

    The Api ID.

  • name (ApiName) –

    The name of the Api.

  • owner_contact (Optional[String], default: None ) –

    The owner contact information for the Api.

  • event_config (EventConfig) –

    The new event configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.

Raises:

  • AccessDeniedException –

    You don't have access to perform this operation on this resource.

  • BadRequestException –

    The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.

  • ConcurrentModificationException –

    Another modification is in progress at this time and it must complete before you can make your change.

  • InternalFailureException –

    An internal AppSync error occurred. Try your request again.

  • NotFoundException –

    The resource specified in the request was not found. Check the resource, and then try again.

  • UnauthorizedException –

    You aren't authorized to perform this operation.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_appsync/_services/async_app_sync.py
async def update_api(
    self,
    api_id: "capo_appsync.types.string.String",
    name: "capo_appsync.types.api_name.ApiName",
    event_config: "capo_appsync.types.event_config.EventConfig",
    *,
    config_overrides: Optional[AsyncAppSyncClientConfig] = None,
    owner_contact: Optional["capo_appsync.types.string.String"] = None,
) -> "capo_appsync.types.update_api_response.UpdateApiResponse":
    """<p>Updates an <code>Api</code>.</p>

    Args:
        api_id: <p>The <code>Api</code> ID.</p>
        name: <p>The name of the Api.</p>
        owner_contact: <p>The owner contact information for the <code>Api</code>.</p>
        event_config: <p>The new event configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.</p>

    Raises:
        capo_appsync.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to perform this operation on this resource.</p>
        capo_appsync.errors.bad_request_exception.BadRequestException: <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.</p>
        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.internal_failure_exception.InternalFailureException: <p>An internal AppSync error occurred. Try your request again.</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.update_api_request.UpdateApiRequest]",
    ) -> AsyncOperationResponse[
        "capo_appsync.types.update_api_response.UpdateApiResponse"
    ]:
        import capo_appsync._operations.aws_deepdish_control_plane_service.update_api

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateApi")
    )
    input_: capo_appsync.types.update_api_request.UpdateApiRequest = {
        "api_id": api_id,
        "name": name,
        "event_config": event_config,
    }
    if owner_contact is not None:
        input_["owner_contact"] = owner_contact

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