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.
Deletes invitations to become a Security Hub CSPM member account.
A Security Hub CSPM administrator account can use this operation to delete invitations sent to one or more prospective member accounts.
This operation is only used to delete invitations that are sent to prospective member accounts that aren't part of an Amazon Web Services organization. Organization accounts don't receive invitations.
Parameters:
-
account_ids
(Optional[AccountIdList], default:
None
)
–
The list of member account IDs that received the invitations you want to delete.
Raises:
Examples:
To delete a custom insight
The following example deletes an invitation sent by the Security Hub administrator account to a prospective member account. This operation is used only for invitations sent to accounts that aren't part of an organization. Organization accounts don't receive invitations.
>>> await client.delete_invitations(account_ids=['123456789012'])
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
| async def delete_invitations(
self,
*,
config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
account_ids: Optional[
"capo_securityhub.types.account_id_list.AccountIdList"
] = None,
) -> "capo_securityhub.types.delete_invitations_response.DeleteInvitationsResponse":
"""<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>Deletes invitations to become a Security Hub CSPM member account.</p> <p>A Security Hub CSPM administrator account can use this operation to delete invitations sent to one or more prospective member accounts.</p> <p>This operation is only used to delete invitations that are sent to prospective member accounts that aren't part of an Amazon Web Services organization. Organization accounts don't receive invitations.</p>
Args:
account_ids: <p>The list of member account IDs that received the invitations you want to delete.</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.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To delete a custom insight
The following example deletes an invitation sent by the Security Hub administrator account to a prospective member account. This operation is used only for invitations sent to accounts that aren't part of an organization. Organization accounts don't receive invitations.
>>> await client.delete_invitations(account_ids=['123456789012'])
"""
async def _handler(
req: "AsyncOperationRequest[capo_securityhub.types.delete_invitations_request.DeleteInvitationsRequest]",
) -> AsyncOperationResponse[
"capo_securityhub.types.delete_invitations_response.DeleteInvitationsResponse"
]:
import capo_securityhub._operations.security_hub_api_service.delete_invitations
(
output,
http_response,
) = await capo_securityhub._operations.security_hub_api_service.delete_invitations.async_delete_invitations(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteInvitations")
)
input_: capo_securityhub.types.delete_invitations_request.DeleteInvitationsRequest = {}
if account_ids is not None:
input_["account_ids"] = account_ids
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|