Skip to content

Commit 863c982

Browse files
committed
Rename proxy_dict to proxies; include reference to the requests docs
1 parent d36477a commit 863c982

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

docs/user/quickstart.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,13 @@ directly by providing the OAuth information.
150150
redirect_uri=redirect_uri
151151
)
152152
153-
You can also pass a proxy configuration upon initialization in case you are behind a firewall.
153+
You can also pass a proxy configuration upon initialization in case you are behind a firewall. See the `requests
154+
documentation on Proxies <https://2.python-requests.org/en/master/user/advanced/#proxies>`_ for details.
154155

155156
.. code-block:: python
156157
>>> from webexteamssdk import WebexTeamsAPI
157-
>>> proxy = {'https': '<proxy_ip>:<proxy_port>'}
158-
>>> api = WebexTeamsAPI(access_token=<your_access_token>, proxy_dict=proxy)
158+
>>> proxy = {'https': 'http://<proxy_ip>:<proxy_port>'}
159+
>>> api = WebexTeamsAPI(access_token=<your_access_token>, proxies=proxy)
159160
160161
161162
Making API Calls

webexteamssdk/api/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(self, access_token=None, base_url=DEFAULT_BASE_URL,
6767
client_secret=None,
6868
oauth_code=None,
6969
redirect_uri=None,
70-
proxy_dict=None):
70+
proxies=None):
7171
"""Create a new WebexTeamsAPI object.
7272
7373
An access token must be used when interacting with the Webex Teams API.
@@ -109,7 +109,7 @@ def __init__(self, access_token=None, base_url=DEFAULT_BASE_URL,
109109
the user oauth process.
110110
oauth_redirect_uri(basestring): The redirect URI used in the user
111111
OAuth process.
112-
proxy_dict(dict): Dictionary of proxies passed on to the requests
112+
proxies(dict): Dictionary of proxies passed on to the requests
113113
session.
114114
115115
Returns:
@@ -129,7 +129,7 @@ def __init__(self, access_token=None, base_url=DEFAULT_BASE_URL,
129129
check_type(client_secret, basestring, may_be_none=True)
130130
check_type(oauth_code, basestring, may_be_none=True)
131131
check_type(redirect_uri, basestring, may_be_none=True)
132-
check_type(proxy_dict, dict, may_be_none=True)
132+
check_type(proxies, dict, may_be_none=True)
133133

134134
access_token = access_token or WEBEX_TEAMS_ACCESS_TOKEN
135135

@@ -167,7 +167,7 @@ def __init__(self, access_token=None, base_url=DEFAULT_BASE_URL,
167167
base_url=base_url,
168168
single_request_timeout=single_request_timeout,
169169
wait_on_rate_limit=wait_on_rate_limit,
170-
proxy_dict=proxy_dict
170+
proxies=proxies
171171
)
172172

173173
# API wrappers

webexteamssdk/restsession.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class RestSession(object):
100100
def __init__(self, access_token, base_url,
101101
single_request_timeout=DEFAULT_SINGLE_REQUEST_TIMEOUT,
102102
wait_on_rate_limit=DEFAULT_WAIT_ON_RATE_LIMIT,
103-
proxy_dict=None):
103+
proxies=None):
104104
"""Initialize a new RestSession object.
105105
106106
Args:
@@ -112,7 +112,7 @@ def __init__(self, access_token, base_url,
112112
HTTP REST API request.
113113
wait_on_rate_limit(bool): Enable or disable automatic rate-limit
114114
handling.
115-
proxy_dict(dict): Dictionary of proxies passed on to the requests
115+
proxies(dict): Dictionary of proxies passed on to the requests
116116
session.
117117
118118
Raises:
@@ -123,7 +123,7 @@ def __init__(self, access_token, base_url,
123123
check_type(base_url, basestring, may_be_none=False)
124124
check_type(single_request_timeout, int)
125125
check_type(wait_on_rate_limit, bool, may_be_none=False)
126-
check_type(proxy_dict, dict, may_be_none=True)
126+
check_type(proxies, dict, may_be_none=True)
127127

128128
super(RestSession, self).__init__()
129129

@@ -136,8 +136,8 @@ def __init__(self, access_token, base_url,
136136
# Initialize a new `requests` session
137137
self._req_session = requests.session()
138138

139-
if proxy_dict is not None:
140-
self._req_session.proxies.update(proxy_dict)
139+
if proxies is not None:
140+
self._req_session.proxies.update(proxies)
141141

142142
# Update the headers of the `requests` session
143143
self.update_headers({'Authorization': 'Bearer ' + access_token,

0 commit comments

Comments
 (0)