Exemplo n.º 1
0
    def report(self, key):
        url = self.api_url + '/v2/reports/' + str(key)
        params = self.params_data

        process = ProcessRequest()
        data = process.get(url, params)

        if isinstance(data, Error):
            return data

        if data['status'] == 'ok':
            return Model(data)
Exemplo n.º 2
0
    def user(self):
        url = self.api_url + '/v2/user'
        params = self.params_data

        process = ProcessRequest()
        data = process.get(url, params)

        if isinstance(data, Error):
            return data

        if data['status'] == 'ok':
            return Model(data)
Exemplo n.º 3
0
    def website(self, id):
        url = self.api_url + '/v2/websites/' + str(id)
        params = self.params_data

        process = ProcessRequest()
        data = process.get(url, params)

        if isinstance(data, Error):
            return data

        if data['status'] == 'ok':
            return Model(data)
Exemplo n.º 4
0
    def credits(self, options):
        url = self.api_url + '/v2/credits'
        params = self.params_data
        params['limit'] = options['limit']
        params['offset'] = options['offset']
        params['active'] = options['active']

        process = ProcessRequest()
        data = process.get(url, params)

        if isinstance(data, Error):
            return data

        if data['status'] == 'ok':
            return ModelCollection(data)