Skip to content

update_hit_review_status async

update_hit_review_status(
    hit_id: EntityId,
    *,
    config_overrides: Optional[AsyncMTurkClientConfig] = None,
    revert: Optional[Boolean] = None,
) -> UpdateHITReviewStatusResponse

The UpdateHITReviewStatus operation updates the status of a HIT. If the status is Reviewable, this operation can update the status to Reviewing, or it can revert a Reviewing HIT back to the Reviewable status.

Parameters:

  • hit_id (EntityId) –

    The ID of the HIT to update.

  • revert (Optional[Boolean], default: None ) –

    Specifies how to update the HIT status. Default is False.

    • Setting this to false will only transition a HIT from Reviewable to Reviewing

    • Setting this to true will only transition a HIT from Reviewing to Reviewable

Raises:

  • RequestError –

    Your request is invalid.

  • ServiceFault –

    Amazon Mechanical Turk is temporarily unable to process your request. Try your call again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_mturk/_services/async_m_turk.py
async def update_hit_review_status(
    self,
    hit_id: "capo_mturk.types.entity_id.EntityId",
    *,
    config_overrides: Optional[AsyncMTurkClientConfig] = None,
    revert: Optional["capo_mturk.types.boolean.Boolean"] = None,
) -> "capo_mturk.types.update_hit_review_status_response.UpdateHITReviewStatusResponse":
    """<p> The <code>UpdateHITReviewStatus</code> operation updates the status of a HIT. If the status is Reviewable, this operation can update the status to Reviewing, or it can revert a Reviewing HIT back to the Reviewable status. </p>

    Args:
        hit_id: <p> The ID of the HIT to update. </p>
        revert: <p> Specifies how to update the HIT status. Default is <code>False</code>. </p> <ul> <li> <p> Setting this to false will only transition a HIT from <code>Reviewable</code> to <code>Reviewing</code> </p> </li> <li> <p> Setting this to true will only transition a HIT from <code>Reviewing</code> to <code>Reviewable</code> </p> </li> </ul>

    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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mturk.types.update_hit_review_status_request.UpdateHITReviewStatusRequest]",
    ) -> AsyncOperationResponse[
        "capo_mturk.types.update_hit_review_status_response.UpdateHITReviewStatusResponse"
    ]:
        import capo_mturk._operations.m_turk_requester_service_v20170117.update_hit_review_status

        (
            output,
            http_response,
        ) = await capo_mturk._operations.m_turk_requester_service_v20170117.update_hit_review_status.async_update_hit_review_status(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateHITReviewStatus")
    )
    input_: capo_mturk.types.update_hit_review_status_request.UpdateHITReviewStatusRequest = {
        "hit_id": hit_id
    }
    if revert is not None:
        input_["revert"] = revert

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output