from typing import Dict
from typing import Any


def get_update_mask(args: Dict[str, Any]) -> Dict:
    """ Creates the 'updateMask' parameter for the command
    which is a comma separated list of fields to update.

    Args:
        args(dict): Demisto args indicating which field to update.

    Returns:
        A Dict to use as the params for update command.
    """
    update_mask = []
    if args.get('labels') is not None:
        update_mask.append('labels')

    if args.get('next_rotation_time') is not None:
        update_mask.append('next_rotation_time')

    if args.get('purpose') is not None:
        update_mask.append('purpose')

    if args.get('rotation_period') is not None:
        update_mask.append('rotation_period')

    if args.get('attestation') is not None:
        update_mask.append('primary.attestation')

    if args.get('state') is not None:
        update_mask.append('primary.state')

    if args.get('algorithm') is not None:
        update_mask.append('version_template.algorithm')

    if args.get('protection_level') is not None:
        update_mask.append('version_template.protection_level')

    return {
        'paths': update_mask
    }