The AssociateQualificationWithWorker operation gives a Worker a Qualification. AssociateQualificationWithWorker does not require that the Worker submit a Qualification request. It gives the Qualification directly to the Worker.
You can only assign a Qualification of a Qualification type that you created (using the CreateQualificationType operation).
Note: AssociateQualificationWithWorker does not affect any pending Qualification requests for the Qualification by the Worker. If you assign a Qualification to a Worker, then later grant a Qualification request made by the Worker, the granting of the request may modify the Qualification score. To resolve a pending Qualification request without affecting the Qualification the Worker already has, reject the request with the RejectQualificationRequest operation.
Parameters:
-
qualification_type_id
(EntityId)
–
The ID of the Qualification type to use for the assigned Qualification.
-
worker_id
(CustomerId)
–
The ID of the Worker to whom the Qualification is being assigned. Worker IDs are included with submitted HIT assignments and Qualification requests.
-
integer_value
(Optional[Integer], default:
None
)
–
The value of the Qualification to assign.
-
send_notification
(Optional[Boolean], default:
None
)
–
Specifies whether to send a notification email message to the Worker saying that the qualification was assigned to the Worker. Note: this is true by default.
Raises:
Source code in docs_src/capo_mturk/_services/m_turk.py
| def associate_qualification_with_worker(
self,
qualification_type_id: "capo_mturk.types.entity_id.EntityId",
worker_id: "capo_mturk.types.customer_id.CustomerId",
*,
config_overrides: Optional[MTurkClientConfig] = None,
integer_value: Optional["capo_mturk.types.integer.Integer"] = None,
send_notification: Optional["capo_mturk.types.boolean.Boolean"] = None,
) -> "capo_mturk.types.associate_qualification_with_worker_response.AssociateQualificationWithWorkerResponse":
"""<p> The <code>AssociateQualificationWithWorker</code> operation gives a Worker a Qualification. <code>AssociateQualificationWithWorker</code> does not require that the Worker submit a Qualification request. It gives the Qualification directly to the Worker. </p> <p> You can only assign a Qualification of a Qualification type that you created (using the <code>CreateQualificationType</code> operation). </p> <note> <p> Note: <code>AssociateQualificationWithWorker</code> does not affect any pending Qualification requests for the Qualification by the Worker. If you assign a Qualification to a Worker, then later grant a Qualification request made by the Worker, the granting of the request may modify the Qualification score. To resolve a pending Qualification request without affecting the Qualification the Worker already has, reject the request with the <code>RejectQualificationRequest</code> operation. </p> </note>
Args:
qualification_type_id: <p>The ID of the Qualification type to use for the assigned Qualification.</p>
worker_id: <p> The ID of the Worker to whom the Qualification is being assigned. Worker IDs are included with submitted HIT assignments and Qualification requests. </p>
integer_value: <p>The value of the Qualification to assign.</p>
send_notification: <p> Specifies whether to send a notification email message to the Worker saying that the qualification was assigned to the Worker. Note: this is true by default. </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.associate_qualification_with_worker_request.AssociateQualificationWithWorkerRequest]",
) -> OperationResponse[
"capo_mturk.types.associate_qualification_with_worker_response.AssociateQualificationWithWorkerResponse"
]:
import capo_mturk._operations.m_turk_requester_service_v20170117.associate_qualification_with_worker
output, http_response = (
capo_mturk._operations.m_turk_requester_service_v20170117.associate_qualification_with_worker.associate_qualification_with_worker(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateQualificationWithWorker")
)
input_: capo_mturk.types.associate_qualification_with_worker_request.AssociateQualificationWithWorkerRequest = {
"qualification_type_id": qualification_type_id,
"worker_id": worker_id,
}
if integer_value is not None:
input_["integer_value"] = integer_value
if send_notification is not None:
input_["send_notification"] = send_notification
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|