def getAgreements(self): request = self.base + Woffu_Requests.agreements response = self.doCurlAPI(request, None) if response is not None: if (self.debug): helper.dump_json(response) return response
def getUsers(self, company=None): request = self.base + Woffu_Requests.users if (company): request += helper.doDict2QueryString({'companyId': company}) users = self.doCurlAPI(request, None) if users is not None: if (self.debug): helper.dump_json(users) return users
def getUser(self, user_id): url = self.base + Woffu_Requests.user print(">>User: {}".format(user_id)) request = url.replace('[USER]', str(user_id)) response = self.doCurlAPI(request, None) if response is not None: if (self.debug): helper.dump_json(response) return response
def getOffice(self, office_id): url = self.base + Woffu_Requests.offices print(">>Office: {}".format(office_id)) request = url.replace('[OFFICE]', str(office_id)) response = self.doCurlAPI(request, None) if response is not None: if (self.debug): helper.dump_json(response) return response
def getDepartment(self, department_id): url = self.base + Woffu_Requests.departments print(">>Department: {}".format(department_id)) request = url.replace('[DEPARTMENT]', str(department_id)) response = self.doCurlAPI(request, None) if response is not None: if (self.debug): helper.dump_json(response) return response
def getJobTitle(self, jobtitle_id): url = self.base + Woffu_Requests.jobtitles print(">>JobTitle: {}".format(jobtitle_id)) request = url.replace('[JOBTITLE]', str(jobtitle_id)) response = self.doCurlAPI(request, None) if response is not None: if (self.debug): helper.dump_json(response) return response
def getSchedule(self, schedule_id): url = self.base + Woffu_Requests.schedule print(">>Schedule: {}".format(schedule_id)) request = url.replace('[SCHEDULE]', str(schedule_id)) response = self.doCurlAPI(request, None) if response is not None: if (self.debug): helper.dump_json(response) return response
def getAgreementEvent(self, event_id): url = self.base + Woffu_Requests.agreementevent print(">>AgreementEvent: {}".format(event_id)) request = url.replace('[EVENT]', str(event_id)) response = self.doCurlAPI(request, None) if response is not None: if (self.debug): helper.dump_json(response) return response
def getRequestsDocuments(self, requests_id): url = self.base + Woffu_Requests.requests_documents print(">>Request: {}".format(requests_id)) request = url.replace('[REQUEST]', str(requests_id)) response = self.doCurlAPI(request, None) if response is not None: if (self.debug): helper.dump_json(response) return response
def getRequests(self, params=None): request = self.base + Woffu_Requests.requests + '?' if params['fromDate'] is None: params.update({'fromDate': helper.getDateFrom(1)}) request += helper.doDict2QueryString(params) # request += helper.doDict2QueryString({'fromDate': helper.getDateFrom(1)}) #else: # request += helper.doDict2QueryString({'fromDate': params}) response = self.doCurlAPI(request, None) if response is not None: if (self.debug): helper.dump_json(response) return response
def getCompanyName(self, company_id): if (company_id not in self.companies): url = self.base + Woffu_Requests.company print(">>Company: {}".format(company_id)) request = url.replace('[COMPANY]', str(company_id)) response = self.doCurlAPI(request, None) if response is not None: if (self.debug): helper.dump_json(response) self.companies[company_id] = response return self.companies[company_id]["Name"]
def getAgreementEvents(self, agreements): url = self.base + Woffu_Requests.events response = dict() ids = self.getAgreementsId(agreements) if isinstance(ids, list): for agreement in ids: print(">>Agreement: {}".format(agreement)) request = url.replace('[AGREEMENT]', str(agreement)) agreement_response = self.doCurlAPI(request, None) #parsed = json.loads() response.update(agreement=agreement_response) else: print(">>Agreement: {}".format(ids)) request = url.replace('[AGREEMENT]', str(ids)) agreement_response = self.doCurlAPI(request, None) response.update({ids: agreement_response}) if response is not None: if (self.debug): helper.dump_json(response) return response