Disables the specified user in the user pool. Users can't sign in to WorkSpaces Applications until they are re-enabled. This action does not delete the user.
Parameters:
-
user_name
(Optional[Username], default:
None
)
–
The email address of the user.
Users' email addresses are case-sensitive.
-
authentication_type
(Optional[AuthenticationType], default:
None
)
–
The authentication type for the user. You must specify USERPOOL.
Raises:
Source code in docs_src/capo_appstream/_services/app_stream.py
| def disable_user(
self,
*,
config_overrides: Optional[AppStreamClientConfig] = None,
user_name: Optional["capo_appstream.types.username.Username"] = None,
authentication_type: Optional[
"capo_appstream.types.authentication_type.AuthenticationType"
] = None,
) -> "capo_appstream.types.disable_user_result.DisableUserResult":
"""<p>Disables the specified user in the user pool. Users can't sign in to WorkSpaces Applications until they are re-enabled. This action does not delete the user. </p>
Args:
user_name: <p>The email address of the user.</p> <note> <p>Users' email addresses are case-sensitive.</p> </note>
authentication_type: <p>The authentication type for the user. You must specify USERPOOL.</p>
Raises:
capo_appstream.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
capo_appstream.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_appstream.types.disable_user_request.DisableUserRequest]",
) -> OperationResponse[
"capo_appstream.types.disable_user_result.DisableUserResult"
]:
import capo_appstream._operations.photon_admin_proxy_service.disable_user
output, http_response = (
capo_appstream._operations.photon_admin_proxy_service.disable_user.disable_user(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_appstream.types.disable_user_request.DisableUserRequest",
) -> dict[str, Any]:
import capo_appstream.types.disable_user_request
return capo_appstream.types.disable_user_request.redact_sensitive(input_)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("DisableUser", redact_input=_redact_input),
)
input_: capo_appstream.types.disable_user_request.DisableUserRequest = {}
if user_name is not None:
input_["user_name"] = user_name
if authentication_type is not None:
input_["authentication_type"] = authentication_type
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|