# Path: shelf/metadata/keys.py
# class Keys(object):
#     MD5 = "md5Hash"
#     PATH = "artifactPath"
#     NAME = "artifactName"
#     CREATED_DATE = "createdDate"


from shelf.metadata.keys import Keys
from datetime import datetime
        # the keys.  In the case of a List it will use the items.
        # This line checks to see if the required set is a not a subset
        # of the metadata keys.  In other words, if the required list has
        # a key that is not in the metadata set.
        if set(required) <= set(metadata):
            needs_update = False

        return needs_update

    def update(self, identity, metadata):
        """
            Updates the metadata to have the required keys.
            Note: This does not update it in the cloud.

            Args:
                metadata(schemas/metadata.json)
                resource(shelf.resource_identity.ResourceIdentity)

            Returns:
                metadata(schemas/metadata.json): But updated
        """
        with self.container.create_cloud_storage() as storage:
            etag = storage.get_etag(identity.cloud)
            metadata[Keys.MD5] = self.mapper.create_response_property(Keys.MD5, etag, True)

        if Keys.CREATED_DATE not in metadata:
            created = self._get_created_date()
            metadata[Keys.CREATED_DATE] = self.mapper.create_response_property(Keys.CREATED_DATE, created, True)

        metadata[Keys.PATH] = self.mapper.create_response_property(Keys.PATH, identity.resource_path, True)

# Path: shelf/metadata/keys.py
# class Keys(object):
#     MD5 = "md5Hash"
#     PATH = "artifactPath"
#     NAME = "artifactName"
#     CREATED_DATE = "createdDate"


# Path: shelf/metadata/initializer.py
from shelf.metadata.keys import Keys
from datetime import datetime

        # the keys.  In the case of a List it will use the items.
        # This line checks to see if the required set is a not a subset
        # of the metadata keys.  In other words, if the required list has
        # a key that is not in the metadata set.
        if set(required) <= set(metadata):
            needs_update = False

        return needs_update

    def update(self, identity, metadata):
        """
            Updates the metadata to have the required keys.
            Note: This does not update it in the cloud.

            Args:
                metadata(schemas/metadata.json)
                resource(shelf.resource_identity.ResourceIdentity)

            Returns:
                metadata(schemas/metadata.json): But updated
        """
        with self.container.create_cloud_storage() as storage:
            etag = storage.get_etag(identity.cloud)
            metadata[Keys.MD5] = self.mapper.create_response_property(Keys.MD5, etag, True)

        if Keys.CREATED_DATE not in metadata:
            created = self._get_created_date()
            metadata[Keys.CREATED_DATE] = self.mapper.create_response_property(Keys.CREATED_DATE, created, True)

        metadata[Keys.PATH] = self.mapper.create_response_property(Keys.PATH, identity.resource_path, True)

        metadata[Keys.NAME] = self.mapper.create_response_property(Keys.NAME, identity.artifact_name, True)