@@ -51,7 +51,9 @@ <h1 class="title">Module <code>livechat.agent.web.base</code></h1>
51
51
access_token: str,
52
52
version: str = stable_version,
53
53
base_url: str = api_url,
54
- http2: bool = False
54
+ http2: bool = False,
55
+ proxies: dict = None,
56
+ verify: bool = True
55
57
) -> Union[AgentWebV33, AgentWebV34, AgentWebV35]:
56
58
''' Returns client for specific API version.
57
59
@@ -62,6 +64,11 @@ <h1 class="title">Module <code>livechat.agent.web.base</code></h1>
62
64
base_url (str): API's base url. Defaults to API's production URL.
63
65
http2 (bool): A boolean indicating if HTTP/2 support should be
64
66
enabled. Defaults to `False`.
67
+ proxies (dict): A dictionary mapping proxy keys to proxy URLs.
68
+ verify (bool): SSL certificates (a.k.a CA bundle) used to
69
+ verify the identity of requested hosts. Either `True` (default CA bundle),
70
+ a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
71
+ (which will disable verification). Defaults to `True`.
65
72
66
73
Returns:
67
74
API client object for specified version.
@@ -70,9 +77,9 @@ <h1 class="title">Module <code>livechat.agent.web.base</code></h1>
70
77
ValueError: If the specified version does not exist.
71
78
'''
72
79
client = {
73
- '3.3': AgentWebV33(access_token, base_url, http2),
74
- '3.4': AgentWebV34(access_token, base_url, http2),
75
- '3.5': AgentWebV35(access_token, base_url, http2),
80
+ '3.3': AgentWebV33(access_token, base_url, http2, proxies, verify ),
81
+ '3.4': AgentWebV34(access_token, base_url, http2, proxies, verify ),
82
+ '3.5': AgentWebV35(access_token, base_url, http2, proxies, verify ),
76
83
}.get(version)
77
84
if not client:
78
85
raise ValueError('Provided version does not exist.')
@@ -106,7 +113,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
106
113
access_token: str,
107
114
version: str = stable_version,
108
115
base_url: str = api_url,
109
- http2: bool = False
116
+ http2: bool = False,
117
+ proxies: dict = None,
118
+ verify: bool = True
110
119
) -> Union[AgentWebV33, AgentWebV34, AgentWebV35]:
111
120
''' Returns client for specific API version.
112
121
@@ -117,6 +126,11 @@ <h2 class="section-title" id="header-classes">Classes</h2>
117
126
base_url (str): API's base url. Defaults to API's production URL.
118
127
http2 (bool): A boolean indicating if HTTP/2 support should be
119
128
enabled. Defaults to `False`.
129
+ proxies (dict): A dictionary mapping proxy keys to proxy URLs.
130
+ verify (bool): SSL certificates (a.k.a CA bundle) used to
131
+ verify the identity of requested hosts. Either `True` (default CA bundle),
132
+ a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
133
+ (which will disable verification). Defaults to `True`.
120
134
121
135
Returns:
122
136
API client object for specified version.
@@ -125,9 +139,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
125
139
ValueError: If the specified version does not exist.
126
140
'''
127
141
client = {
128
- '3.3': AgentWebV33(access_token, base_url, http2),
129
- '3.4': AgentWebV34(access_token, base_url, http2),
130
- '3.5': AgentWebV35(access_token, base_url, http2),
142
+ '3.3': AgentWebV33(access_token, base_url, http2, proxies, verify ),
143
+ '3.4': AgentWebV34(access_token, base_url, http2, proxies, verify ),
144
+ '3.5': AgentWebV35(access_token, base_url, http2, proxies, verify ),
131
145
}.get(version)
132
146
if not client:
133
147
raise ValueError('Provided version does not exist.')
@@ -136,7 +150,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
136
150
< h3 > Static methods</ h3 >
137
151
< dl >
138
152
< dt id ="livechat.agent.web.base.AgentWeb.get_client "> < code class ="name flex ">
139
- < span > def < span class ="ident "> get_client</ span > </ span > (< span > access_token: str, version: str = '3.4', base_url: str = 'api.livechatinc.com', http2: bool = False) ‑> Union[< a title ="livechat.agent.web.api.v33.AgentWebV33 " href ="api/v33.html#livechat.agent.web.api.v33.AgentWebV33 "> AgentWebV33</ a > , < a title ="livechat.agent.web.api.v34.AgentWebV34 " href ="api/v34.html#livechat.agent.web.api.v34.AgentWebV34 "> AgentWebV34</ a > , < a title ="livechat.agent.web.api.v35.AgentWebV35 " href ="api/v35.html#livechat.agent.web.api.v35.AgentWebV35 "> AgentWebV35</ a > ]</ span >
153
+ < span > def < span class ="ident "> get_client</ span > </ span > (< span > access_token: str, version: str = '3.4', base_url: str = 'api.livechatinc.com', http2: bool = False, proxies: dict = None, verify: bool = True ) ‑> Union[< a title ="livechat.agent.web.api.v33.AgentWebV33 " href ="api/v33.html#livechat.agent.web.api.v33.AgentWebV33 "> AgentWebV33</ a > , < a title ="livechat.agent.web.api.v34.AgentWebV34 " href ="api/v34.html#livechat.agent.web.api.v34.AgentWebV34 "> AgentWebV34</ a > , < a title ="livechat.agent.web.api.v35.AgentWebV35 " href ="api/v35.html#livechat.agent.web.api.v35.AgentWebV35 "> AgentWebV35</ a > ]</ span >
140
154
</ code > </ dt >
141
155
< dd >
142
156
< div class ="desc "> < p > Returns client for specific API version.</ p >
@@ -152,6 +166,13 @@ <h2 id="args">Args</h2>
152
166
< dt > < strong > < code > http2</ code > </ strong > : < code > bool</ code > </ dt >
153
167
< dd > A boolean indicating if HTTP/2 support should be
154
168
enabled. Defaults to < code > False</ code > .</ dd >
169
+ < dt > < strong > < code > proxies</ code > </ strong > : < code > dict</ code > </ dt >
170
+ < dd > A dictionary mapping proxy keys to proxy URLs.</ dd >
171
+ < dt > < strong > < code > verify</ code > </ strong > : < code > bool</ code > </ dt >
172
+ < dd > SSL certificates (a.k.a CA bundle) used to
173
+ verify the identity of requested hosts. Either < code > True</ code > (default CA bundle),
174
+ a path to an SSL certificate file, an < code > ssl.SSLContext</ code > , or < code > False</ code >
175
+ (which will disable verification). Defaults to < code > True</ code > .</ dd >
155
176
</ dl >
156
177
< h2 id ="returns "> Returns</ h2 >
157
178
< p > API client object for specified version.</ p >
@@ -169,7 +190,9 @@ <h2 id="raises">Raises</h2>
169
190
access_token: str,
170
191
version: str = stable_version,
171
192
base_url: str = api_url,
172
- http2: bool = False
193
+ http2: bool = False,
194
+ proxies: dict = None,
195
+ verify: bool = True
173
196
) -> Union[AgentWebV33, AgentWebV34, AgentWebV35]:
174
197
''' Returns client for specific API version.
175
198
@@ -180,6 +203,11 @@ <h2 id="raises">Raises</h2>
180
203
base_url (str): API's base url. Defaults to API's production URL.
181
204
http2 (bool): A boolean indicating if HTTP/2 support should be
182
205
enabled. Defaults to `False`.
206
+ proxies (dict): A dictionary mapping proxy keys to proxy URLs.
207
+ verify (bool): SSL certificates (a.k.a CA bundle) used to
208
+ verify the identity of requested hosts. Either `True` (default CA bundle),
209
+ a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
210
+ (which will disable verification). Defaults to `True`.
183
211
184
212
Returns:
185
213
API client object for specified version.
@@ -188,9 +216,9 @@ <h2 id="raises">Raises</h2>
188
216
ValueError: If the specified version does not exist.
189
217
'''
190
218
client = {
191
- '3.3': AgentWebV33(access_token, base_url, http2),
192
- '3.4': AgentWebV34(access_token, base_url, http2),
193
- '3.5': AgentWebV35(access_token, base_url, http2),
219
+ '3.3': AgentWebV33(access_token, base_url, http2, proxies, verify ),
220
+ '3.4': AgentWebV34(access_token, base_url, http2, proxies, verify ),
221
+ '3.5': AgentWebV35(access_token, base_url, http2, proxies, verify ),
194
222
}.get(version)
195
223
if not client:
196
224
raise ValueError('Provided version does not exist.')
0 commit comments