@exc.on_http_error(exc.GitlabCreateError)<EOL><INDENT>def create(self, data, **kwargs):<DEDENT>
self._check_missing_create_attrs(data)<EOL>files = {}<EOL>types = getattr(self, '<STR_LIT>', {})<EOL>if types:<EOL><INDENT>data = data.copy()<EOL>for attr_name, type_cls in types.items():<EOL><INDENT>if attr_name in data.keys():<EOL><INDENT>type_obj = type_cls(data[attr_name])<EOL>if issubclass(type_cls, g_types.FileAttribute):<EOL><INDENT>k = type_obj.get_file_name(attr_name)<EOL>files[attr_name] = (k, data.pop(attr_name))<EOL><DEDENT>else:<EOL><INDENT>data[attr_name] = type_obj.get_for_api()<EOL><DEDENT><DEDENT><DEDENT><DEDENT>path = kwargs.pop('<STR_LIT:path>', self.path)<EOL>server_data = self.gitlab.http_post(path, post_data=data, files=files,<EOL>**kwargs)<EOL>return self._obj_cls(self, server_data)<EOL>
Create a new object.

        Args:
            data (dict): parameters to send to the server to create the
                         resource
            **kwargs: Extra options to send to the server (e.g. sudo)

        Returns:
            RESTObject: a new instance of the managed object class built with
                the data sent by the server

        Raises:
            GitlabAuthenticationError: If authentication is not correct
            GitlabCreateError: If the server cannot perform the request