batch_toggle_user_suspend_status
¶
batch_toggle_user_suspend_status(
network_id: NetworkId,
suspend: bool,
user_ids: UserIds,
*,
config_overrides: Optional[WickrClientConfig] = None,
client_token: Optional[ClientToken] = None,
) -> BatchToggleUserSuspendStatusResponse
Suspends or unsuspends multiple users in a Wickr network. Suspended users cannot access the network until they are unsuspended. This operation is useful for temporarily restricting access without deleting user accounts.
Parameters:
-
network_id(NetworkId) –The ID of the Wickr network where users will be suspended or unsuspended.
-
suspend(bool) –A boolean value indicating whether to suspend (true) or unsuspend (false) the specified users.
-
user_ids(UserIds) –A list of user IDs identifying the users whose suspend status will be toggled. Maximum 50 users per batch request.
-
client_token(Optional[ClientToken], default:None) –A unique identifier for this request to ensure idempotency.
Raises:
-
BadRequestError–The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.
-
ForbiddenError–Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.
-
InternalServerError–An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.
-
RateLimitError–The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.
-
ResourceNotFoundError–The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.
-
UnauthorizedError–The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.
-
ValidationError–One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Suspend multiple users
>>> client.batch_toggle_user_suspend_status(network_id='12345678', user_ids=['123', '456'], suspend=True, client_token='6ba7b815-9dad-11d1-80b4-00c04fd430c8')
Unsuspend users with partial failure
>>> client.batch_toggle_user_suspend_status(network_id='12345678', user_ids=['123', '456'], suspend=False)