function overwritingVersioning(objMD, metadataStoreParams) {
    metadataStoreParams.updateMicroVersionId = true;
    metadataStoreParams.amzStorageClass = objMD['x-amz-storage-class'];

    // set correct originOp
    metadataStoreParams.originOp = 's3:ObjectRestore:Completed';

    // When restoring an MPU with different number of parts the etag changes
    // as it's calculated based on the etags of the parts. We keep the original
    // etag to allow proper expiration of the restored object.
    if (metadataStoreParams.contentMD5 !== objMD['content-md5']) {
        metadataStoreParams.restoredEtag = metadataStoreParams.contentMD5;
        metadataStoreParams.contentMD5 = objMD['content-md5'];
    }

    // update restore
    const days = objMD.archive?.restoreRequestedDays;
    const now = Date.now();
    metadataStoreParams.archive = {
        archiveInfo: objMD.archive?.archiveInfo,
        restoreRequestedAt: objMD.archive?.restoreRequestedAt,
        restoreRequestedDays: objMD.archive?.restoreRequestedDays,
        restoreCompletedAt: new Date(now),
        restoreWillExpireAt: new Date(now + (days * scaledMsPerDay)),
    };

    /* eslint-enable no-param-reassign */

    const versionId = objMD.versionId || undefined;
    const options = {
        versionId,
        isNull: objMD.isNull,
    };
    if (objMD.nullVersionId) {
        options.extraMD = {
            nullVersionId: objMD.nullVersionId,
        };
    }

    restoreMetadata(objMD, metadataStoreParams);

    return options;
}
overwritingVersioning - return versioning information for S3 to handle
storing version metadata with a specific version id.
@param {object} objMD - obj metadata
@param {object} metadataStoreParams - custom built object containing resource details.
@return {object} options
options.versionId - specific versionId to overwrite in metadata
options.isNull - (true/undefined) whether new version is null or not
options.nullVersionId - if storing a null version in version history, the
 version id of the null version