completeAttachmentUpload method

Future<void> completeAttachmentUpload({
  1. required List<String> attachmentIds,
  2. required String connectionToken,
  3. String? clientToken,
})

Allows you to confirm that the attachment has been uploaded using the pre-signed URL provided in StartAttachmentUpload API.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException. May throw ServiceQuotaExceededException. May throw ConflictException.

Parameter attachmentIds : A list of unique identifiers for the attachments.

Parameter connectionToken : The authentication token associated with the participant's connection.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Implementation

Future<void> completeAttachmentUpload({
  required List<String> attachmentIds,
  required String connectionToken,
  String? clientToken,
}) async {
  ArgumentError.checkNotNull(attachmentIds, 'attachmentIds');
  ArgumentError.checkNotNull(connectionToken, 'connectionToken');
  _s.validateStringLength(
    'connectionToken',
    connectionToken,
    1,
    1000,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientToken',
    clientToken,
    1,
    500,
  );
  final headers = <String, String>{
    'X-Amz-Bearer': connectionToken.toString(),
  };
  final $payload = <String, dynamic>{
    'AttachmentIds': attachmentIds,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/participant/complete-attachment-upload',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}