How to use the predicthq.endpoints.decorators.accepts function in predicthq

To help you get started, we’ve selected a few predicthq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github predicthq / sdk-py / tests / endpoints / decorators_tests.py View on Github external
            @decorators.accepts(SchemaExample, query_string=False)
            def func(self, **kwargs):
                return kwargs
github predicthq / sdk-py / tests / endpoints / decorators_tests.py View on Github external
            @decorators.accepts(SchemaExample)
            def func(self, **kwargs):
                return kwargs
github predicthq / sdk-py / predicthq / endpoints / v1 / signals / endpoint.py View on Github external
    @accepts(SignalID)
    def delete(self, id):
        self.client.delete(self.build_url('v1', 'signals/{}'.format(id)))
github predicthq / sdk-py / predicthq / endpoints / v1 / signals / endpoint.py View on Github external
    @accepts(SignalID)
    @returns(SavedSignal)
    def get(self, id):
        return self.client.get(self.build_url('v1', 'signals/{}'.format(id)))
github predicthq / sdk-py / predicthq / endpoints / v1 / events / endpoint.py View on Github external
    @accepts(CalendarParams)
    @returns(CalendarResultSet)
    def calendar(self, **params):
        return self.client.get(self.build_url('v1', 'events/calendar'), params=params)
github predicthq / sdk-py / predicthq / endpoints / v1 / signals / endpoint.py View on Github external
    @accepts(SignalsSearchParams)
    @returns(SignalResultSet)
    def search(self, **params):
        return self.client.get(self.build_url('v1', 'signals'), params=params)
github predicthq / sdk-py / predicthq / endpoints / v1 / signals / endpoint.py View on Github external
    @accepts(AnalysisParams)
    @returns(AnalysisResultSet)
    def analysis(self, id, **params):
        return self.client.get(self.build_url('v1', 'signals/{}/analysis'.format(id)), params=params)
github predicthq / sdk-py / predicthq / endpoints / oauth2 / endpoint.py View on Github external
    @accepts(GetTokenParams)
    @returns(AccessToken)
    def get_token(self, client_id, client_secret, scope, grant_type, **kwargs):
        data = {
            "grant_type": grant_type,
            "scope": scope,
        }
        data.update(kwargs)
        return self.client.post('/oauth2/token/', auth=(client_id, client_secret), data=data)