Skip to content

get_subscription_state async

get_subscription_state(
    *, config_overrides: Optional[AsyncShieldClientConfig] = None
) -> GetSubscriptionStateResponse

Returns the SubscriptionState, either Active or Inactive.

Raises:

  • InternalErrorException –

    Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.

  • UnknownServiceError –

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

Source code in docs_src/capo_shield/_services/async_shield.py
async def get_subscription_state(
    self, *, config_overrides: Optional[AsyncShieldClientConfig] = None
) -> (
    "capo_shield.types.get_subscription_state_response.GetSubscriptionStateResponse"
):
    """<p>Returns the <code>SubscriptionState</code>, either <code>Active</code> or <code>Inactive</code>.</p>

    Raises:
        capo_shield.errors.internal_error_exception.InternalErrorException: <p>Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.</p>
        capo_shield.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_shield.types.get_subscription_state_request.GetSubscriptionStateRequest]",
    ) -> AsyncOperationResponse[
        "capo_shield.types.get_subscription_state_response.GetSubscriptionStateResponse"
    ]:
        import capo_shield._operations.aws_shield_20160616.get_subscription_state

        (
            output,
            http_response,
        ) = await capo_shield._operations.aws_shield_20160616.get_subscription_state.async_get_subscription_state(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetSubscriptionState")
    )
    input_: capo_shield.types.get_subscription_state_request.GetSubscriptionStateRequest = {}

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