@classmethod<EOL><INDENT>def data_endpoint(cls, in_data, ignore=[]):<DEDENT>
obj, obj_type, res, res_type = cls.obj_res(in_data, fail_on=[])<EOL>data = {}<EOL>if '<STR_LIT>' in ignore:<EOL><INDENT>obj = None<EOL><DEDENT>if '<STR_LIT>' in ignore:<EOL><INDENT>res = None<EOL><DEDENT>if obj and obj_type == '<STR_LIT:user>':<EOL><INDENT>data['<STR_LIT>'] = obj<EOL><DEDENT>if obj and obj_type == '<STR_LIT>':<EOL><INDENT>endpoint = '<STR_LIT>' % (grammar.pluralize(obj_type), obj)<EOL>if res is not None:<EOL><INDENT>data['<STR_LIT>'] = res<EOL><DEDENT><DEDENT>elif res:<EOL><INDENT>endpoint = '<STR_LIT>' % (grammar.pluralize(res_type), res)<EOL><DEDENT>else:<EOL><INDENT>endpoint = '<STR_LIT>'<EOL><DEDENT>if in_data.get('<STR_LIT:type>', False):<EOL><INDENT>data['<STR_LIT>'] = '<STR_LIT>' % in_data['<STR_LIT:type>'].lower()<EOL><DEDENT>for key, value in in_data.items():<EOL><INDENT>if key not in RESOURCE_FIELDS and key not in ['<STR_LIT:type>', '<STR_LIT:user>', '<STR_LIT>']:<EOL><INDENT>data[key] = value<EOL><DEDENT><DEDENT>return data, endpoint<EOL>
Converts a set of CLI input arguments, `in_data`, into
request data and an endpoint that can be used to look
up a role or list of roles.

Also changes the format of `type` in data to what the server
expects for the role model, as it exists in the database.