def set_directory_metadata(self, share_name, directory_name, metadata=None, timeout=None):
_validate_not_none('<STR_LIT>', share_name)<EOL>_validate_not_none('<STR_LIT>', directory_name)<EOL>request = HTTPRequest()<EOL>request.method = '<STR_LIT>'<EOL>request.host_locations = self._get_host_locations()<EOL>request.path = _get_path(share_name, directory_name)<EOL>request.query = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': _int_to_str(timeout),<EOL>}<EOL>_add_metadata_headers(metadata, request)<EOL>self._perform_request(request)<EOL>
Sets one or more user-defined name-value pairs for the specified
directory. Each call to this operation replaces all existing metadata
attached to the directory. To remove all metadata from the directory,
call this operation with no metadata dict.

:param str share_name:
    Name of existing share.
:param str directory_name:
    The path to the directory.
:param metadata:
    A dict containing name-value pairs to associate with the directory
    as metadata. Example: {'category':'test'}
:type metadata: A dict mapping str to str.
:param int timeout:
    The timeout parameter is expressed in seconds.