def create_file_manifest()

in src/loading_manifest/common_manifest.py [0:0]


def create_file_manifest(
        kind,
        schema_format_type,
        acl,
        legal,
        resource_security_classificaton,
        preload_file_path,
        file_source,
        file_name=None):
    file = dict()
    file[FileManifest.TAG_ID] = ""
    file[FileManifest.TAG_KIND] = kind
    file[FileManifest.TAG_ACL] = acl
    file[FileManifest.TAG_LEGAL] = legal

    file_data = dict()
    file[FileManifest.TAG_DATA] = file_data

    file_data[FileManifest.TAG_RESOURCE_SECURITY_CLASSIFICATION] \
        = resource_security_classificaton

    if schema_format_type is not None and len(schema_format_type) > 0:
        file_data[FileManifest.TAG_DATA_SCHEMA_FORMAT_TYPE_ID] = schema_format_type

    ds_props = dict()
    ds_props_fs_info = dict()
    if file_source is not None and len(file_source) > 0:
        ds_props_fs_info[FileManifest.TAG_DATA_FILE_SOURCE] = file_source
    else:
        ds_props_fs_info[FileManifest.TAG_DATA_FILE_SOURCE] = preload_file_path
    if file_name is not None:
        ds_props_fs_info[FileManifest.TAG_DATA_NAME] = file_name
    ds_props_fs_info[FileManifest.TAG_DATA_PRELOAD_FILE_PATH] = preload_file_path
    ds_props[FileManifest.TAG_DATA_DATASET_PROPERTIES_FS_INFO] = ds_props_fs_info
    file_data[FileManifest.TAG_DATA_DATASET_PROPERTIES] = ds_props

    return file