Skip to content

list_bonus_payments

list_bonus_payments(
    *,
    config_overrides: Optional[MTurkClientConfig] = None,
    hit_id: Optional[EntityId] = None,
    assignment_id: Optional[EntityId] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[ResultSize] = None,
) -> ListBonusPaymentsResponse

The ListBonusPayments operation retrieves the amounts of bonuses you have paid to Workers for a given HIT or assignment.

Parameters:

  • hit_id (Optional[EntityId], default: None ) –

    The ID of the HIT associated with the bonus payments to retrieve. If not specified, all bonus payments for all assignments for the given HIT are returned. Either the HITId parameter or the AssignmentId parameter must be specified

  • assignment_id (Optional[EntityId], default: None ) –

    The ID of the assignment associated with the bonus payments to retrieve. If specified, only bonus payments for the given assignment are returned. Either the HITId parameter or the AssignmentId parameter must be specified

  • next_token (Optional[PaginationToken], default: None ) –

    Pagination token

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/m_turk.py
def list_bonus_payments(
    self,
    *,
    config_overrides: Optional[MTurkClientConfig] = None,
    hit_id: Optional["capo_mturk.types.entity_id.EntityId"] = None,
    assignment_id: Optional["capo_mturk.types.entity_id.EntityId"] = None,
    next_token: Optional[
        "capo_mturk.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional["capo_mturk.types.result_size.ResultSize"] = None,
) -> "capo_mturk.types.list_bonus_payments_response.ListBonusPaymentsResponse":
    """<p> The <code>ListBonusPayments</code> operation retrieves the amounts of bonuses you have paid to Workers for a given HIT or assignment. </p>

    Args:
        hit_id: <p>The ID of the HIT associated with the bonus payments to retrieve. If not specified, all bonus payments for all assignments for the given HIT are returned. Either the HITId parameter or the AssignmentId parameter must be specified</p>
        assignment_id: <p>The ID of the assignment associated with the bonus payments to retrieve. If specified, only bonus payments for the given assignment are returned. Either the HITId parameter or the AssignmentId parameter must be specified</p>
        next_token: <p>Pagination token</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.list_bonus_payments_request.ListBonusPaymentsRequest]",
    ) -> OperationResponse[
        "capo_mturk.types.list_bonus_payments_response.ListBonusPaymentsResponse"
    ]:
        import capo_mturk._operations.m_turk_requester_service_v20170117.list_bonus_payments

        output, http_response = (
            capo_mturk._operations.m_turk_requester_service_v20170117.list_bonus_payments.list_bonus_payments(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListBonusPayments")
    )
    input_: capo_mturk.types.list_bonus_payments_request.ListBonusPaymentsRequest = {}
    if hit_id is not None:
        input_["hit_id"] = hit_id
    if assignment_id is not None:
        input_["assignment_id"] = assignment_id
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output