Skip to content

disable_security_hub_v2 async

disable_security_hub_v2(
    *, config_overrides: Optional[AsyncSecurityHubClientConfig] = None
) -> DisableSecurityHubV2Response

Disable the service for the current Amazon Web Services Region or specified Amazon Web Services Region. Disabling the service also disables all opt-in features that are currently enabled in that Region.

Raises:

Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def disable_security_hub_v2(
    self, *, config_overrides: Optional[AsyncSecurityHubClientConfig] = None
) -> "capo_securityhub.types.disable_security_hub_v2_response.DisableSecurityHubV2Response":
    """<p>Disable the service for the current Amazon Web Services Region or specified Amazon Web Services Region. Disabling the service also disables all opt-in features that are currently enabled in that Region.</p>

    Raises:
        capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
        capo_securityhub.errors.internal_server_exception.InternalServerException: <p> The request has failed due to an internal failure of the service. </p>
        capo_securityhub.errors.throttling_exception.ThrottlingException: <p> The limit on the number of requests per second was exceeded. </p>
        capo_securityhub.errors.validation_exception.ValidationException: <p>The request has failed validation because it's missing required fields or has invalid inputs.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.disable_security_hub_v2_request.DisableSecurityHubV2Request]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.disable_security_hub_v2_response.DisableSecurityHubV2Response"
    ]:
        import capo_securityhub._operations.security_hub_api_service.disable_security_hub_v2

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.disable_security_hub_v2.async_disable_security_hub_v2(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisableSecurityHubV2")
    )
    input_: capo_securityhub.types.disable_security_hub_v2_request.DisableSecurityHubV2Request = {}

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