from typing import Dict, List

class UseCase:
    '''
    represents the mapping from an internal layer with a set of attributes and what
    attributes from the dataset correspond to each one
    '''

    def __init__(self, name: str):
        '''
        Creates a new instance of LayerAdapter

         @params:
            name                - Required : unique identifier for the layer
            properties          - Required : maps InternalPropertyName->DatasetPropertyName
            cluster_properties  - Required : subset of the keys of properties, marks properties to cluster with
            use_case            - Required : identifier for the use-case this layer belongs to
        '''
        self.name = name

    def to_serializable_dict(self) -> Dict:
        return {
            "name": self.name,
        }

    @staticmethod
    def from_serializable_dict(user_dict: Dict):
        '''
        creates a layer object from a dictionary. has to have the following keys:
            - name
            - properties
            - cluster_properties
            - use_case
        '''
        return UseCase(
            user_dict["name"],
        )
