updateExpirationForHIT method

Future<void> updateExpirationForHIT({
  1. required DateTime expireAt,
  2. required String hITId,
})

The UpdateExpirationForHIT operation allows you update the expiration time of a HIT. If you update it to a time in the past, the HIT will be immediately expired.

May throw ServiceFault. May throw RequestError.

Parameter expireAt : The date and time at which you want the HIT to expire

Parameter hITId : The HIT to update.

Implementation

Future<void> updateExpirationForHIT({
  required DateTime expireAt,
  required String hITId,
}) async {
  ArgumentError.checkNotNull(expireAt, 'expireAt');
  ArgumentError.checkNotNull(hITId, 'hITId');
  _s.validateStringLength(
    'hITId',
    hITId,
    1,
    64,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'MTurkRequesterServiceV20170117.UpdateExpirationForHIT'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ExpireAt': unixTimestampToJson(expireAt),
      'HITId': hITId,
    },
  );
}