예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
    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
예제 #4
0
    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
예제 #5
0
    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
예제 #6
0
    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
예제 #7
0
    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
예제 #8
0
    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
예제 #9
0
    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
예제 #10
0
 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
예제 #11
0
    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"]
예제 #12
0
    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