Пример #1
0
def getTimesheet_users(userId,start_date):
    """
    method call planview service to get timesheet entry for multiple users

    """
 
    client, sessionId  = getSession()
    req_data_fe = {'sessionId': sessionId,
        'userIds': userId, 'startYYYYMMDD': start_date}
    
    res = client.service.getTimesheetForUsers(**req_data_fe)
    serialized_res = zeep.helpers.serialize_object(res)
    timesheet_entry = pd.DataFrame(serialized_res)
    return timesheet_entry
Пример #2
0
def deleteTimesheet_entries(timesheetId, entryId):
    """
    method call planview service to delete multiple timesheet entries

    """
    print(timesheetId)
    client, sessionId = getSession()
    req_data_fe = {
        'sessionId': sessionId,
        'timesheetId': timesheetId,
        'timesheetEntryId': entryId
    }

    client.service.deleteTimesheetEntries(**req_data_fe)
Пример #3
0
def getEntityFields(entityTypeId):
    """
    method call planview service to get schema definition for given entity

    Args:
    integer: entityTypeId is predefined identifier in plan view to pull entity information

    Returns:
    json:  send json response given by planview service call
    """
 
    client, sessionId  = getSession()
    req_data_fe = {'sessionId': sessionId,
        'entityTypeId': entityTypeId, 'mode' : '0' }
    
    res = client.service.getEntityFields(**req_data_fe)
    serialized_res = zeep.helpers.serialize_object(res)
    return str(json.dumps(serialized_res)).replace("\'","")
Пример #4
0
def getData(entityTypeId, fieldList):
    """
    method calls planview service to get data fro given entity type

    Args:
    integer: entityTypeId is predefined identifier in plan view to pull respective data

    Returns:
    json:  send json response given by planview service call
    """
    client, sessionId  = getSession()
    req_data_fe = {'sessionId': sessionId,
        'entityTypeId': entityTypeId, 'fieldsRequest': fieldList}
    
    res = client.service.findEntity(**req_data_fe)
    serialized_res = zeep.helpers.serialize_object(res)
    project_df = pd.DataFrame(serialized_res)
    return project_df
Пример #5
0
def insertTimesheet(user_ts):
    """
    method call planview service to put timesheet entry for an user
    
    Args:
    List: list of timesheet entries 

    Returns:
    List: on usccess it return list of timesheet entries inserted to planview
    """
 
    client, sessionId  = getSession()
    ordered_dict_ts = {'sessionId': sessionId}
    ordered_dict_ts['timesheet'] = user_ts

    res = client.service.createOrReplaceTimesheetEntries(**ordered_dict_ts)
    serialized_res = zeep.helpers.serialize_object(res)
    timesheet_entry = pd.DataFrame(serialized_res)
    return timesheet_entry
Пример #6
0
 def test_planview_login(self):
     client, sessionId = getSession()
     self.assertTrue(sessionId)