|
38 | 38 | from typing import Any |
39 | 39 |
|
40 | 40 | from ..models import Empty |
| 41 | +from ..models import Callheader |
| 42 | +from ..models import Callmessage |
41 | 43 | from ..models import ErrorBody |
42 | 44 | from ..models import MediaRegions |
43 | 45 | from ..models import SIPSearchPublicRequest |
@@ -133,6 +135,167 @@ def get_telephony_mediaregions(self, **kwargs) -> 'MediaRegions': |
133 | 135 | callback=params.get('callback')) |
134 | 136 | return response |
135 | 137 |
|
| 138 | + def get_telephony_sipmessages_conversation(self, conversation_id: str, **kwargs) -> 'Callmessage': |
| 139 | + """ |
| 140 | + Get a SIP message. |
| 141 | + Get the raw form of the SIP message |
| 142 | + get_telephony_sipmessages_conversation is a preview method and is subject to both breaking and non-breaking changes at any time without notice |
| 143 | +
|
| 144 | + This method makes a synchronous HTTP request by default. To make an |
| 145 | + asynchronous HTTP request, please define a `callback` function |
| 146 | + to be invoked when receiving the response. |
| 147 | + >>> def callback_function(response): |
| 148 | + >>> pprint(response) |
| 149 | + >>> |
| 150 | + >>> thread = api.get_telephony_sipmessages_conversation(conversation_id, callback=callback_function) |
| 151 | +
|
| 152 | + :param callback function: The callback function |
| 153 | + for asynchronous request. (optional) |
| 154 | + :param str conversation_id: Conversation id (required) |
| 155 | + :return: Callmessage |
| 156 | + If the method is called asynchronously, |
| 157 | + returns the request thread. |
| 158 | + """ |
| 159 | + |
| 160 | + all_params = ['conversation_id'] |
| 161 | + all_params.append('callback') |
| 162 | + |
| 163 | + params = locals() |
| 164 | + for key, val in iteritems(params['kwargs']): |
| 165 | + if key not in all_params: |
| 166 | + raise TypeError( |
| 167 | + "Got an unexpected keyword argument '%s'" |
| 168 | + " to method get_telephony_sipmessages_conversation" % key |
| 169 | + ) |
| 170 | + params[key] = val |
| 171 | + del params['kwargs'] |
| 172 | + |
| 173 | + # verify the required parameter 'conversation_id' is set |
| 174 | + if ('conversation_id' not in params) or (params['conversation_id'] is None): |
| 175 | + raise ValueError("Missing the required parameter `conversation_id` when calling `get_telephony_sipmessages_conversation`") |
| 176 | + |
| 177 | + |
| 178 | + resource_path = '/api/v2/telephony/sipmessages/conversations/{conversationId}'.replace('{format}', 'json') |
| 179 | + path_params = {} |
| 180 | + if 'conversation_id' in params: |
| 181 | + path_params['conversationId'] = params['conversation_id'] |
| 182 | + |
| 183 | + query_params = {} |
| 184 | + |
| 185 | + header_params = {} |
| 186 | + |
| 187 | + form_params = [] |
| 188 | + local_var_files = {} |
| 189 | + |
| 190 | + body_params = None |
| 191 | + |
| 192 | + # HTTP header `Accept` |
| 193 | + header_params['Accept'] = self.api_client.\ |
| 194 | + select_header_accept(['application/json']) |
| 195 | + if not header_params['Accept']: |
| 196 | + del header_params['Accept'] |
| 197 | + |
| 198 | + # HTTP header `Content-Type` |
| 199 | + header_params['Content-Type'] = self.api_client.\ |
| 200 | + select_header_content_type(['application/json']) |
| 201 | + |
| 202 | + # Authentication setting |
| 203 | + auth_settings = ['PureCloud OAuth'] |
| 204 | + |
| 205 | + response = self.api_client.call_api(resource_path, 'GET', |
| 206 | + path_params, |
| 207 | + query_params, |
| 208 | + header_params, |
| 209 | + body=body_params, |
| 210 | + post_params=form_params, |
| 211 | + files=local_var_files, |
| 212 | + response_type='Callmessage', |
| 213 | + auth_settings=auth_settings, |
| 214 | + callback=params.get('callback')) |
| 215 | + return response |
| 216 | + |
| 217 | + def get_telephony_sipmessages_conversation_headers(self, conversation_id: str, **kwargs) -> 'Callheader': |
| 218 | + """ |
| 219 | + Get SIP headers. |
| 220 | + Get parsed SIP headers. Returns specific headers if key query parameters are added. |
| 221 | + get_telephony_sipmessages_conversation_headers is a preview method and is subject to both breaking and non-breaking changes at any time without notice |
| 222 | +
|
| 223 | + This method makes a synchronous HTTP request by default. To make an |
| 224 | + asynchronous HTTP request, please define a `callback` function |
| 225 | + to be invoked when receiving the response. |
| 226 | + >>> def callback_function(response): |
| 227 | + >>> pprint(response) |
| 228 | + >>> |
| 229 | + >>> thread = api.get_telephony_sipmessages_conversation_headers(conversation_id, callback=callback_function) |
| 230 | +
|
| 231 | + :param callback function: The callback function |
| 232 | + for asynchronous request. (optional) |
| 233 | + :param str conversation_id: Conversation id (required) |
| 234 | + :param list[str] keys: comma-separated list of header identifiers to query. e.g. ruri,to,from |
| 235 | + :return: Callheader |
| 236 | + If the method is called asynchronously, |
| 237 | + returns the request thread. |
| 238 | + """ |
| 239 | + |
| 240 | + all_params = ['conversation_id', 'keys'] |
| 241 | + all_params.append('callback') |
| 242 | + |
| 243 | + params = locals() |
| 244 | + for key, val in iteritems(params['kwargs']): |
| 245 | + if key not in all_params: |
| 246 | + raise TypeError( |
| 247 | + "Got an unexpected keyword argument '%s'" |
| 248 | + " to method get_telephony_sipmessages_conversation_headers" % key |
| 249 | + ) |
| 250 | + params[key] = val |
| 251 | + del params['kwargs'] |
| 252 | + |
| 253 | + # verify the required parameter 'conversation_id' is set |
| 254 | + if ('conversation_id' not in params) or (params['conversation_id'] is None): |
| 255 | + raise ValueError("Missing the required parameter `conversation_id` when calling `get_telephony_sipmessages_conversation_headers`") |
| 256 | + |
| 257 | + |
| 258 | + resource_path = '/api/v2/telephony/sipmessages/conversations/{conversationId}/headers'.replace('{format}', 'json') |
| 259 | + path_params = {} |
| 260 | + if 'conversation_id' in params: |
| 261 | + path_params['conversationId'] = params['conversation_id'] |
| 262 | + |
| 263 | + query_params = {} |
| 264 | + if 'keys' in params: |
| 265 | + query_params['keys'] = params['keys'] |
| 266 | + |
| 267 | + header_params = {} |
| 268 | + |
| 269 | + form_params = [] |
| 270 | + local_var_files = {} |
| 271 | + |
| 272 | + body_params = None |
| 273 | + |
| 274 | + # HTTP header `Accept` |
| 275 | + header_params['Accept'] = self.api_client.\ |
| 276 | + select_header_accept(['application/json']) |
| 277 | + if not header_params['Accept']: |
| 278 | + del header_params['Accept'] |
| 279 | + |
| 280 | + # HTTP header `Content-Type` |
| 281 | + header_params['Content-Type'] = self.api_client.\ |
| 282 | + select_header_content_type(['application/json']) |
| 283 | + |
| 284 | + # Authentication setting |
| 285 | + auth_settings = ['PureCloud OAuth'] |
| 286 | + |
| 287 | + response = self.api_client.call_api(resource_path, 'GET', |
| 288 | + path_params, |
| 289 | + query_params, |
| 290 | + header_params, |
| 291 | + body=body_params, |
| 292 | + post_params=form_params, |
| 293 | + files=local_var_files, |
| 294 | + response_type='Callheader', |
| 295 | + auth_settings=auth_settings, |
| 296 | + callback=params.get('callback')) |
| 297 | + return response |
| 298 | + |
136 | 299 | def get_telephony_siptraces(self, date_start: datetime, date_end: datetime, **kwargs) -> 'SipSearchResult': |
137 | 300 | """ |
138 | 301 | Fetch SIP metadata |
|
0 commit comments