The DeleteWorkerBlock operation allows you to reinstate a blocked Worker to work on your HITs. This operation reverses the effects of the CreateWorkerBlock operation. You need the Worker ID to use this operation. If the Worker ID is missing or invalid, this operation fails and returns the message “WorkerId is invalid.” If the specified Worker is not blocked, this operation returns successfully.
Parameters:
-
worker_id
(CustomerId)
–
The ID of the Worker to unblock.
-
reason
(Optional[String], default:
None
)
–
A message that explains the reason for unblocking the Worker. The Worker does not see this message.
Raises:
Source code in docs_src/capo_mturk/_services/m_turk.py
| def delete_worker_block(
self,
worker_id: "capo_mturk.types.customer_id.CustomerId",
*,
config_overrides: Optional[MTurkClientConfig] = None,
reason: Optional["capo_mturk.types.string.String"] = None,
) -> "capo_mturk.types.delete_worker_block_response.DeleteWorkerBlockResponse":
"""<p>The <code>DeleteWorkerBlock</code> operation allows you to reinstate a blocked Worker to work on your HITs. This operation reverses the effects of the CreateWorkerBlock operation. You need the Worker ID to use this operation. If the Worker ID is missing or invalid, this operation fails and returns the message “WorkerId is invalid.” If the specified Worker is not blocked, this operation returns successfully.</p>
Args:
worker_id: <p>The ID of the Worker to unblock.</p>
reason: <p>A message that explains the reason for unblocking the Worker. The Worker does not see this message.</p>
Raises:
capo_mturk.errors.request_error.RequestError: <p>Your request is invalid.</p>
capo_mturk.errors.service_fault.ServiceFault: <p>Amazon Mechanical Turk is temporarily unable to process your request. Try your call again.</p>
capo_mturk.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_mturk.types.delete_worker_block_request.DeleteWorkerBlockRequest]",
) -> OperationResponse[
"capo_mturk.types.delete_worker_block_response.DeleteWorkerBlockResponse"
]:
import capo_mturk._operations.m_turk_requester_service_v20170117.delete_worker_block
output, http_response = (
capo_mturk._operations.m_turk_requester_service_v20170117.delete_worker_block.delete_worker_block(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteWorkerBlock")
)
input_: capo_mturk.types.delete_worker_block_request.DeleteWorkerBlockRequest = {
"worker_id": worker_id
}
if reason is not None:
input_["reason"] = reason
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|