getCaseAttachmentUploadUrl method
Uploads an attachment to a case.
Parameter caseId :
Required element for GetCaseAttachmentUploadUrl to identify the case ID
for uploading an attachment.
Parameter contentLength :
Required element for GetCaseAttachmentUploadUrl to identify the size of
the file attachment.
Parameter fileName :
Required element for GetCaseAttachmentUploadUrl to identify the file name
of the attachment to upload.
Parameter clientToken :
Implementation
Future<GetCaseAttachmentUploadUrlResponse> getCaseAttachmentUploadUrl({
required String caseId,
required int contentLength,
required String fileName,
String? clientToken,
}) async {
_s.validateNumRange(
'contentLength',
contentLength,
1,
104857600,
isRequired: true,
);
final $payload = <String, dynamic>{
'contentLength': contentLength,
'fileName': fileName,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v1/cases/${Uri.encodeComponent(caseId)}/get-presigned-url',
exceptionFnMap: _exceptionFns,
);
return GetCaseAttachmentUploadUrlResponse.fromJson(response);
}