'Create a component inside a project and return a Resource for it.
:param name: name of the component
:param project: key of the project to create the component in
:param description: a description of the component
:param leadUserName: the username of the user responsible for this component
:param assigneeType: see the ComponentBean.AssigneeType class for valid values
:param isAssigneeTypeValid: boolean specifying whether the assignee type is acceptable'

@translate_resource_args
def create_component(self, name, project, description=None, leadUserName=None, assigneeType=None, isAssigneeTypeValid=False):

    data = {u'name': name, u'project': project, u'isAssigneeTypeValid': isAssigneeTypeValid}
    if (description is not None):
        data[u'description'] = description
    if (leadUserName is not None):
        data[u'leadUserName'] = leadUserName
    if (assigneeType is not None):
        data[u'assigneeType'] = assigneeType
    url = self._get_url(u'component')
    r = self._session.post(url, data=json.dumps(data))
    component = Component(self._options, self._session, raw=json_loads(r))
    return component
