Skip to content

get_invitations_count

get_invitations_count(
    *, config_overrides: Optional[SecurityHubClientConfig] = None
) -> GetInvitationsCountResponse

We recommend using Organizations instead of Security Hub CSPM invitations to manage your member accounts. For information, see Managing Security Hub CSPM administrator and member accounts with Organizations in the Security Hub CSPM User Guide.

Returns the count of all Security Hub CSPM membership invitations that were sent to the calling member account, not including the currently accepted invitation.

Raises:

  • InternalException –

    Internal server error.

  • InvalidAccessException –

    The account doesn't have permission to perform this action.

  • InvalidInputException –

    The request was rejected because you supplied an invalid or out-of-range value for an input parameter.

  • LimitExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.

  • UnknownServiceError –

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

Examples:

To get a count of membership invitations The following example returns a count of invitations that the Security Hub administrator sent to the current member account, not including the currently accepted invitation.

>>> client.get_invitations_count()
Source code in docs_src/capo_securityhub/_services/security_hub.py
def get_invitations_count(
    self, *, config_overrides: Optional[SecurityHubClientConfig] = None
) -> "capo_securityhub.types.get_invitations_count_response.GetInvitationsCountResponse":
    """<note> <p>We recommend using Organizations instead of Security Hub CSPM invitations to manage your member accounts. For information, see <a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts-orgs.html">Managing Security Hub CSPM administrator and member accounts with Organizations</a> in the <i>Security Hub CSPM User Guide</i>.</p> </note> <p>Returns the count of all Security Hub CSPM membership invitations that were sent to the calling member account, not including the currently accepted invitation. </p>

    Raises:
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To get a count of membership invitations
        The following example returns a count of invitations that the Security Hub administrator sent to the current member account, not including the currently accepted invitation.



        >>> client.get_invitations_count()
    """

    def _handler(
        req: "OperationRequest[capo_securityhub.types.get_invitations_count_request.GetInvitationsCountRequest]",
    ) -> OperationResponse[
        "capo_securityhub.types.get_invitations_count_response.GetInvitationsCountResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.get_invitations_count

        output, http_response = (
            capo_securityhub._operations.security_hub_api_service.get_invitations_count.get_invitations_count(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetInvitationsCount")
    )
    input_: capo_securityhub.types.get_invitations_count_request.GetInvitationsCountRequest = {}

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output