Skip to content

update_connection async

update_connection(
    name: ConnectionName,
    *,
    config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = None,
    description: Optional[ConnectionDescription] = None,
    authorization_type: Optional[ConnectionAuthorizationType] = None,
    auth_parameters: Optional[UpdateConnectionAuthRequestParameters] = None,
) -> UpdateConnectionResponse

Updates settings for a connection.

Parameters:

Raises:

Source code in docs_src/capo_cloudwatch_events/_services/async_cloud_watch_events.py
async def update_connection(
    self,
    name: "capo_cloudwatch_events.types.connection_name.ConnectionName",
    *,
    config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = None,
    description: Optional[
        "capo_cloudwatch_events.types.connection_description.ConnectionDescription"
    ] = None,
    authorization_type: Optional[
        "capo_cloudwatch_events.types.connection_authorization_type.ConnectionAuthorizationType"
    ] = None,
    auth_parameters: Optional[
        "capo_cloudwatch_events.types.update_connection_auth_request_parameters.UpdateConnectionAuthRequestParameters"
    ] = None,
) -> "capo_cloudwatch_events.types.update_connection_response.UpdateConnectionResponse":
    """<p>Updates settings for a connection.</p>

    Args:
        name: <p>The name of the connection to update.</p>
        description: <p>A description for the connection.</p>
        authorization_type: <p>The type of authorization to use for the connection.</p>
        auth_parameters: <p>The authorization parameters to use for the connection.</p>

    Raises:
        capo_cloudwatch_events.errors.concurrent_modification_exception.ConcurrentModificationException: <p>There is concurrent modification on a rule, target, archive, or replay.</p>
        capo_cloudwatch_events.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_cloudwatch_events.errors.limit_exceeded_exception.LimitExceededException: <p>The request failed because it attempted to create resource beyond the allowed service quota.</p>
        capo_cloudwatch_events.errors.resource_not_found_exception.ResourceNotFoundException: <p>An entity that you specified does not exist.</p>
        capo_cloudwatch_events.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_events.types.update_connection_request.UpdateConnectionRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_events.types.update_connection_response.UpdateConnectionResponse"
    ]:
        import capo_cloudwatch_events._operations.aws_events.update_connection

        (
            output,
            http_response,
        ) = await capo_cloudwatch_events._operations.aws_events.update_connection.async_update_connection(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_cloudwatch_events.types.update_connection_request.UpdateConnectionRequest",
    ) -> dict[str, Any]:
        import capo_cloudwatch_events.types.update_connection_request

        return (
            capo_cloudwatch_events.types.update_connection_request.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateConnection", redact_input=_redact_input),
    )
    input_: capo_cloudwatch_events.types.update_connection_request.UpdateConnectionRequest = {
        "name": name
    }
    if description is not None:
        input_["description"] = description
    if authorization_type is not None:
        input_["authorization_type"] = authorization_type
    if auth_parameters is not None:
        input_["auth_parameters"] = auth_parameters

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