toJson method
Implementation
@override
Map<String, Object?> toJson() => {
"id": encodeValue(id),
"purpose": encodeValue(purpose),
"status": encodeValue(status),
"active": encodeValue(active),
if (fileId != null) "file_id": encodeValue(fileId),
if (uploadUrl != null) "upload_url": encodeValue(uploadUrl),
"constraints": encodeValue(constraints),
"display": encodeValue(display),
"subject": encodeValue(subject),
"recipient": encodeValue(recipient),
"resource": encodeValue(resource),
"requester": encodeValue(requester),
"attempts": encodeValue(attempts),
if (latestError != null) "latest_error": encodeValue(latestError),
if (canceledBy != null) "canceled_by": encodeValue(canceledBy),
if (customData != null) "custom_data": encodeValue(customData),
if (metadata != null) "metadata": encodeValue(metadata),
"created_at": encodeValue(createdAt),
"updated_at": encodeValue(updatedAt),
"expires_at": encodeValue(expiresAt),
if (uploadingAt != null) "uploading_at": encodeValue(uploadingAt),
if (fulfilledAt != null) "fulfilled_at": encodeValue(fulfilledAt),
if (expiredAt != null) "expired_at": encodeValue(expiredAt),
if (canceledAt != null) "canceled_at": encodeValue(canceledAt),
if (attempt != null) "attempt": encodeValue(attempt),
};