The CreateWorkerBlock operation allows you to prevent a Worker from working on your HITs. For example, you can block a Worker who is producing poor quality work. You can block up to 100,000 Workers.
Parameters:
-
worker_id
(CustomerId)
–
The ID of the Worker to block.
-
reason
(String)
–
A message explaining the reason for blocking the Worker. This parameter enables you to keep track of your Workers. The Worker does not see this message.
Raises:
Source code in docs_src/capo_mturk/_services/m_turk.py
| def create_worker_block(
self,
worker_id: "capo_mturk.types.customer_id.CustomerId",
reason: "capo_mturk.types.string.String",
*,
config_overrides: Optional[MTurkClientConfig] = None,
) -> "capo_mturk.types.create_worker_block_response.CreateWorkerBlockResponse":
"""<p>The <code>CreateWorkerBlock</code> operation allows you to prevent a Worker from working on your HITs. For example, you can block a Worker who is producing poor quality work. You can block up to 100,000 Workers.</p>
Args:
worker_id: <p>The ID of the Worker to block.</p>
reason: <p>A message explaining the reason for blocking the Worker. This parameter enables you to keep track of your Workers. 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.create_worker_block_request.CreateWorkerBlockRequest]",
) -> OperationResponse[
"capo_mturk.types.create_worker_block_response.CreateWorkerBlockResponse"
]:
import capo_mturk._operations.m_turk_requester_service_v20170117.create_worker_block
output, http_response = (
capo_mturk._operations.m_turk_requester_service_v20170117.create_worker_block.create_worker_block(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateWorkerBlock")
)
input_: capo_mturk.types.create_worker_block_request.CreateWorkerBlockRequest = {
"worker_id": worker_id,
"reason": reason,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|