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
)
–
Raises:
Source code in docs_src/capo_mturk/_services/async_m_turk.py
| async def list_bonus_payments(
self,
*,
config_overrides: Optional[AsyncMTurkClientConfig] = 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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_mturk.types.list_bonus_payments_request.ListBonusPaymentsRequest]",
) -> AsyncOperationResponse[
"capo_mturk.types.list_bonus_payments_response.ListBonusPaymentsResponse"
]:
import capo_mturk._operations.m_turk_requester_service_v20170117.list_bonus_payments
(
output,
http_response,
) = await capo_mturk._operations.m_turk_requester_service_v20170117.list_bonus_payments.async_list_bonus_payments(
req.options, req.input
)
return AsyncOperationResponse(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 = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|