def __init__(self, *args, **kwargs): props = ConnectionProperties( api_url='graph.facebook.com', secure_http=True, ) self.setClient(Client(*args, **kwargs)) self.setConnectionProperties(props)
def __init__(self, *args, **kwargs): props = ConnectionProperties( api_url='na1.salesforce.com', secure_http=True, ) self.setClient(Client(*args, **kwargs)) self.setConnectionProperties(props)
def __init__(self, *args, **kwargs): props = ConnectionProperties( api_url='api.openweathermap.org', secure_http=False, ) self.setClient(Client(*args, **kwargs)) self.setConnectionProperties(props)
def __init__(self, token, accept='application/json', *args, **kwargs): extra_headers = dict(Accept=accept, Authorization='Bearer {0}'.format(token)) props = ConnectionProperties(api_url='ci.appveyor.com', secure_http=True, extra_headers=extra_headers) self.setClient(Client(*args, **kwargs)) self.setConnectionProperties(props)
def __init__(self, *args, **kwargs): props = ConnectionProperties( api_url='search.maven.org', url_prefix='/solrsearch', secure_http=True, ) self.setClient(Client(*args, **kwargs)) self.setConnectionProperties(props)
def __init__(self, token=None, *args, **kwargs): props = ConnectionProperties( api_url='api.bitbucket.org', url_prefix='/2.0', secure_http=True, extra_headers=self.generateAuthHeader(token), ) self.setClient(Client(*args, **kwargs)) self.setConnectionProperties(props)
def __init__(self, token=None, *args, **kwargs): props = ConnectionProperties( api_url='api.digitalocean.com', url_prefix='/v2', secure_http=True, extra_headers={'authorization': self.generateAuthHeader(token)}, ) self.setClient(Client(*args, **kwargs)) self.setConnectionProperties(props)
def __init__(self, username=None, password=None, auth_token=None, **kwargs): self._username = username self._password = password self._login_lock = Lock() props = ConnectionProperties( api_url=kwargs.pop('api_url', 'hub.docker.com'), secure_http=True ) self.setClient(DockerHubClient(auth_token)) self.setConnectionProperties(props)
def __init__(self, username=None, password=None, token=None, *args, **kwargs): extraHeaders = {'accept': 'application/vnd.github.v3+json'} auth = self.generateAuthHeader(username, password, token) if auth is not None: extraHeaders['authorization'] = auth props = ConnectionProperties(api_url=kwargs.pop( 'api_url', 'api.github.com'), secure_http=True, extra_headers=extraHeaders) self.setClient(GitHubClient(*args, **kwargs)) self.setConnectionProperties(props)