Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_http_client(self, type=REST_TYPE):
if self.http_client:
return self.http_client
if type == CONVERSATION_TYPE:
return HttpClient(self.conversation_api_root, self.access_key, USER_AGENT)
if type == VOICE_TYPE:
return HttpClient(VOICE_API_ROOT, self.access_key, USER_AGENT)
if type == NUMBER_TYPE:
return HttpClient(NUMBER_API_ROOT, self.access_key, USER_AGENT)
return HttpClient(ENDPOINT, self.access_key, USER_AGENT)
def _get_http_client(self, type=REST_TYPE):
if self.http_client:
return self.http_client
if type == CONVERSATION_TYPE:
return HttpClient(self.conversation_api_root, self.access_key, USER_AGENT)
if type == VOICE_TYPE:
return HttpClient(VOICE_API_ROOT, self.access_key, USER_AGENT)
if type == NUMBER_TYPE:
return HttpClient(NUMBER_API_ROOT, self.access_key, USER_AGENT)
return HttpClient(ENDPOINT, self.access_key, USER_AGENT)
def _get_http_client(self, type=REST_TYPE):
if self.http_client:
return self.http_client
if type == CONVERSATION_TYPE:
return HttpClient(self.conversation_api_root, self.access_key, USER_AGENT)
if type == VOICE_TYPE:
return HttpClient(VOICE_API_ROOT, self.access_key, USER_AGENT)
if type == NUMBER_TYPE:
return HttpClient(NUMBER_API_ROOT, self.access_key, USER_AGENT)
return HttpClient(ENDPOINT, self.access_key, USER_AGENT)
def _get_http_client(self, type=REST_TYPE):
if self.http_client:
return self.http_client
if type == CONVERSATION_TYPE:
return HttpClient(self.conversation_api_root, self.access_key, USER_AGENT)
if type == VOICE_TYPE:
return HttpClient(VOICE_API_ROOT, self.access_key, USER_AGENT)
if type == NUMBER_TYPE:
return HttpClient(NUMBER_API_ROOT, self.access_key, USER_AGENT)
return HttpClient(ENDPOINT, self.access_key, USER_AGENT)
def __init__(self, access_key, http_client=None):
self.access_key = access_key
if http_client is None:
http_client = HttpClient(CONVERSATION_API_ROOT, access_key, USER_AGENT)
self.client = Client(access_key, http_client)