import time


def baseline_creation_payload(catalog_identifier: int, repo_identifier: int, device_details: dict) -> dict:
    """
    Creates the JSON payload required to create the baseline

    Args:
        catalog_identifier: The ID for the target catalog
        repo_identifier: The ID of the repository associated with the catalog
        device_details: A dictionary containing the device type IDs and the device type names

    Returns: A dictionary with the payload required to create a new baseline in OME

    """
    baseline_payload = {'Name': "Dell baseline update" + time.strftime(":%Y:%m:%d-%H:%M:%S"),
                        'Description': "Baseline update job launched via the OME API", 'CatalogId': catalog_identifier,
                        'RepositoryId': repo_identifier, 'DowngradeEnabled': True,
                        'Is64Bit': True, 'Targets': []}

    for target_id, target_type_dictionary in device_details.items():
        baseline_payload['Targets'].append({
            "Id": target_id,
            "Type": target_type_dictionary
        })

    return baseline_payload