From e8515702f2408c1d7d6c62f762b4be51a18b4d5a Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Fri, 1 Dec 2017 10:49:25 +0100 Subject: [PATCH 01/12] call transfer --- README.md | 4 +- docs/CallTransferResult.md | 10 ++ docs/CallsApi.md | 57 +++++++++ docs/IvrStep.md | 2 +- liveagent_api/__init__.py | 1 + liveagent_api/apis/calls_api.py | 80 ++++++++++++ liveagent_api/models/__init__.py | 1 + liveagent_api/models/call_transfer_result.py | 126 +++++++++++++++++++ liveagent_api/models/ivr_step.py | 6 +- 9 files changed, 282 insertions(+), 5 deletions(-) create mode 100644 docs/CallTransferResult.md create mode 100644 liveagent_api/models/call_transfer_result.py diff --git a/README.md b/README.md index 2be4c91..e5faa95 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-11-29T13:18:25.520+01:00 +- Build date: 2017-12-01T10:49:16.519+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. @@ -111,6 +111,7 @@ Class | Method | HTTP request | Description *CallsApi* | [**call_start**](docs/CallsApi.md#call_start) | **POST** /call/_start | Starts new outcoming / internal call *CallsApi* | [**call_start_failed**](docs/CallsApi.md#call_start_failed) | **POST** /call/_startFailed | Callback that starting call failed *CallsApi* | [**call_stop**](docs/CallsApi.md#call_stop) | **POST** /calls/{callId}/_stop | Stops the call +*CallsApi* | [**call_transfer**](docs/CallsApi.md#call_transfer) | **POST** /calls/{callId}/_transfer | Transfers call to different department / agent *CallsApi* | [**confirm_ring**](docs/CallsApi.md#confirm_ring) | **POST** /calls/{callId}/_confirmRing | Confirm that call is ringing *CallsApi* | [**get_calls_list**](docs/CallsApi.md#get_calls_list) | **GET** /calls | Gets list of calls *CallsApi* | [**merge**](docs/CallsApi.md#merge) | **POST** /calls/{callId}/_merge | Merge two calls @@ -221,6 +222,7 @@ Class | Method | HTTP request | Description - [CallListItem](docs/CallListItem.md) - [CallMessage](docs/CallMessage.md) - [CallStatus](docs/CallStatus.md) + - [CallTransferResult](docs/CallTransferResult.md) - [CannedMessage](docs/CannedMessage.md) - [Company](docs/Company.md) - [CompanyListItem](docs/CompanyListItem.md) diff --git a/docs/CallTransferResult.md b/docs/CallTransferResult.md new file mode 100644 index 0000000..e5a6860 --- /dev/null +++ b/docs/CallTransferResult.md @@ -0,0 +1,10 @@ +# CallTransferResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**callee_status** | **str** | O - online, F - offline | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CallsApi.md b/docs/CallsApi.md index 69f7849..473e1b7 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**call_start**](CallsApi.md#call_start) | **POST** /call/_start | Starts new outcoming / internal call [**call_start_failed**](CallsApi.md#call_start_failed) | **POST** /call/_startFailed | Callback that starting call failed [**call_stop**](CallsApi.md#call_stop) | **POST** /calls/{callId}/_stop | Stops the call +[**call_transfer**](CallsApi.md#call_transfer) | **POST** /calls/{callId}/_transfer | Transfers call to different department / agent [**confirm_ring**](CallsApi.md#confirm_ring) | **POST** /calls/{callId}/_confirmRing | Confirm that call is ringing [**get_calls_list**](CallsApi.md#get_calls_list) | **GET** /calls | Gets list of calls [**merge**](CallsApi.md#merge) | **POST** /calls/{callId}/_merge | Merge two calls @@ -730,6 +731,62 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **call_transfer** +> CallTransferResult call_transfer(call_id, to=to) + +Transfers call to different department / agent + +Transfer can be called on incoming calls before they start ringing to agents + +### Example +```python +import time +import liveagent_api +from liveagent_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: privileges +liveagent_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' +# Configure API key authorization: apikey +liveagent_api.configuration.api_key['apikey'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed +# liveagent_api.configuration.api_key_prefix['apikey'] = 'BEARER' + +# create an instance of the API class +api_instance = liveagent_api.CallsApi() +call_id = 'call_id_example' # str | +to = 'to_example' # str | Department ID or extension (optional) + +try: + # Transfers call to different department / agent + api_response = api_instance.call_transfer(call_id, to=to) + pprint(api_response) +except ApiException as e: + print "Exception when calling CallsApi->call_transfer: %s\n" % e +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **call_id** | **str**| | + **to** | **str**| Department ID or extension | [optional] + +### Return type + +[**CallTransferResult**](CallTransferResult.md) + +### Authorization + +[privileges](../README.md#privileges), [apikey](../README.md#apikey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **confirm_ring** > OkResponse confirm_ring(call_id, to_number=to_number, channel_id=channel_id) diff --git a/docs/IvrStep.md b/docs/IvrStep.md index 19b8491..b0e9cf8 100644 --- a/docs/IvrStep.md +++ b/docs/IvrStep.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **str** | P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (message URL in params, choices) G - goto (IVR name in params) | +**type** | **str** | P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (choices), G - goto (IVR name in params), T - transfer (optional ivr settings in params {\"O\":\"online\",\"F\":\"offline\",\"Q\":\"queue\"}) | **params** | **str** | | [optional] **choices** | [**list[IvrChoice]**](IvrChoice.md) | | [optional] diff --git a/liveagent_api/__init__.py b/liveagent_api/__init__.py index 35d9f71..b5381e4 100644 --- a/liveagent_api/__init__.py +++ b/liveagent_api/__init__.py @@ -19,6 +19,7 @@ from .models.call_list_item import CallListItem from .models.call_message import CallMessage from .models.call_status import CallStatus +from .models.call_transfer_result import CallTransferResult from .models.canned_message import CannedMessage from .models.company import Company from .models.company_list_item import CompanyListItem diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index 8e0aeda..0f1a5be 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -1136,6 +1136,86 @@ def call_stop(self, call_id, **kwargs): callback=params.get('callback')) return response + def call_transfer(self, call_id, **kwargs): + """ + Transfers call to different department / agent + Transfer can be called on incoming calls before they start ringing to agents + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.call_transfer(call_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str call_id: (required) + :param str to: Department ID or extension + :return: CallTransferResult + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['call_id', 'to'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method call_transfer" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'call_id' is set + if ('call_id' not in params) or (params['call_id'] is None): + raise ValueError("Missing the required parameter `call_id` when calling `call_transfer`") + + resource_path = '/calls/{callId}/_transfer'.replace('{format}', 'json') + path_params = {} + if 'call_id' in params: + path_params['callId'] = params['call_id'] + + query_params = {} + if 'to' in params: + query_params['to'] = params['to'] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = ['privileges', 'apikey'] + + response = self.api_client.call_api(resource_path, 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CallTransferResult', + auth_settings=auth_settings, + callback=params.get('callback')) + return response + def confirm_ring(self, call_id, **kwargs): """ Confirm that call is ringing diff --git a/liveagent_api/models/__init__.py b/liveagent_api/models/__init__.py index 0beeb0d..9518f41 100644 --- a/liveagent_api/models/__init__.py +++ b/liveagent_api/models/__init__.py @@ -19,6 +19,7 @@ from .call_list_item import CallListItem from .call_message import CallMessage from .call_status import CallStatus +from .call_transfer_result import CallTransferResult from .canned_message import CannedMessage from .company import Company from .company_list_item import CompanyListItem diff --git a/liveagent_api/models/call_transfer_result.py b/liveagent_api/models/call_transfer_result.py new file mode 100644 index 0000000..67ade9c --- /dev/null +++ b/liveagent_api/models/call_transfer_result.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" +Copyright 2016 SmartBear Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Ref: https://github.com/swagger-api/swagger-codegen +""" + +from pprint import pformat +from six import iteritems + + +class CallTransferResult(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + CallTransferResult - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'callee_status': 'str' + } + + self.attribute_map = { + 'callee_status': 'callee_status' + } + + self._callee_status = None + + @property + def callee_status(self): + """ + Gets the callee_status of this CallTransferResult. + O - online, F - offline + + :return: The callee_status of this CallTransferResult. + :rtype: str + """ + return self._callee_status + + @callee_status.setter + def callee_status(self, callee_status): + """ + Sets the callee_status of this CallTransferResult. + O - online, F - offline + + :param callee_status: The callee_status of this CallTransferResult. + :type: str + """ + allowed_values = ["O", "F"] + if callee_status not in allowed_values: + raise ValueError( + "Invalid value for `callee_status`, must be one of {0}" + .format(allowed_values) + ) + self._callee_status = callee_status + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other + diff --git a/liveagent_api/models/ivr_step.py b/liveagent_api/models/ivr_step.py index 696b041..45c43ee 100644 --- a/liveagent_api/models/ivr_step.py +++ b/liveagent_api/models/ivr_step.py @@ -56,7 +56,7 @@ def __init__(self): def type(self): """ Gets the type of this IvrStep. - P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (message URL in params, choices) G - goto (IVR name in params) + P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (choices), G - goto (IVR name in params), T - transfer (optional ivr settings in params {\"O\":\"online\",\"F\":\"offline\",\"Q\":\"queue\"}) :return: The type of this IvrStep. :rtype: str @@ -67,12 +67,12 @@ def type(self): def type(self, type): """ Sets the type of this IvrStep. - P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (message URL in params, choices) G - goto (IVR name in params) + P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (choices), G - goto (IVR name in params), T - transfer (optional ivr settings in params {\"O\":\"online\",\"F\":\"offline\",\"Q\":\"queue\"}) :param type: The type of this IvrStep. :type: str """ - allowed_values = ["P", "R", "V", "D", "G"] + allowed_values = ["P", "R", "V", "D", "G", "T"] if type not in allowed_values: raise ValueError( "Invalid value for `type`, must be one of {0}" From b6d4c39b3867ded740b41d80d8f2a37a2291ec4d Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Fri, 1 Dec 2017 14:26:08 +0100 Subject: [PATCH 02/12] fetchIvr --- README.md | 3 +- docs/CallsApi.md | 55 +++++++++++++++++++++ docs/IvrStep.md | 2 +- liveagent_api/apis/calls_api.py | 83 ++++++++++++++++++++++++++++++++ liveagent_api/models/ivr_step.py | 6 +-- 5 files changed, 144 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e5faa95..1afd512 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-01T10:49:16.519+01:00 +- Build date: 2017-12-01T14:26:02.213+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. @@ -103,6 +103,7 @@ Class | Method | HTTP request | Description *CallsApi* | [**call_answer**](docs/CallsApi.md#call_answer) | **POST** /calls/{callId}/_answer | Set call as answered by agent *CallsApi* | [**call_change_channel_status**](docs/CallsApi.md#call_change_channel_status) | **PUT** /calls/{callId}/channels/{channelId}/_status | Change channel status *CallsApi* | [**call_create**](docs/CallsApi.md#call_create) | **POST** /calls/{callId} | Create new call +*CallsApi* | [**call_fetch_ivr**](docs/CallsApi.md#call_fetch_ivr) | **POST** /calls/{callId}/_fetchIvr | Fetches IVR for the call from external URL *CallsApi* | [**call_get_status**](docs/CallsApi.md#call_get_status) | **GET** /calls/{callId}/status | Return the status of call *CallsApi* | [**call_move_channel**](docs/CallsApi.md#call_move_channel) | **POST** /calls/{callId}/channels/{channelId}/_move | Moves existing channel to target call *CallsApi* | [**call_remove_channel**](docs/CallsApi.md#call_remove_channel) | **DELETE** /calls/{callId}/channels/{channelId} | Removes channel from the call diff --git a/docs/CallsApi.md b/docs/CallsApi.md index 473e1b7..44225c7 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -9,6 +9,7 @@ Method | HTTP request | Description [**call_answer**](CallsApi.md#call_answer) | **POST** /calls/{callId}/_answer | Set call as answered by agent [**call_change_channel_status**](CallsApi.md#call_change_channel_status) | **PUT** /calls/{callId}/channels/{channelId}/_status | Change channel status [**call_create**](CallsApi.md#call_create) | **POST** /calls/{callId} | Create new call +[**call_fetch_ivr**](CallsApi.md#call_fetch_ivr) | **POST** /calls/{callId}/_fetchIvr | Fetches IVR for the call from external URL [**call_get_status**](CallsApi.md#call_get_status) | **GET** /calls/{callId}/status | Return the status of call [**call_move_channel**](CallsApi.md#call_move_channel) | **POST** /calls/{callId}/channels/{channelId}/_move | Moves existing channel to target call [**call_remove_channel**](CallsApi.md#call_remove_channel) | **DELETE** /calls/{callId}/channels/{channelId} | Removes channel from the call @@ -305,6 +306,60 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **call_fetch_ivr** +> list[Ivr] call_fetch_ivr(call_id, url) + +Fetches IVR for the call from external URL + +### Example +```python +import time +import liveagent_api +from liveagent_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: privileges +liveagent_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' +# Configure API key authorization: apikey +liveagent_api.configuration.api_key['apikey'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed +# liveagent_api.configuration.api_key_prefix['apikey'] = 'BEARER' + +# create an instance of the API class +api_instance = liveagent_api.CallsApi() +call_id = 'call_id_example' # str | +url = 'url_example' # str | + +try: + # Fetches IVR for the call from external URL + api_response = api_instance.call_fetch_ivr(call_id, url) + pprint(api_response) +except ApiException as e: + print "Exception when calling CallsApi->call_fetch_ivr: %s\n" % e +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **call_id** | **str**| | + **url** | **str**| | + +### Return type + +[**list[Ivr]**](Ivr.md) + +### Authorization + +[privileges](../README.md#privileges), [apikey](../README.md#apikey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **call_get_status** > CallStatus call_get_status(call_id) diff --git a/docs/IvrStep.md b/docs/IvrStep.md index b0e9cf8..482b851 100644 --- a/docs/IvrStep.md +++ b/docs/IvrStep.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **str** | P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (choices), G - goto (IVR name in params), T - transfer (optional ivr settings in params {\"O\":\"online\",\"F\":\"offline\",\"Q\":\"queue\"}) | +**type** | **str** | P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (choices), G - goto (IVR name in params), T - transfer (optional ivr settings in choices {\"1\":\"online\",\"0\":\"offline\",\"9\":\"queue\"}), F - fetch next IVR steps from URL in params | **params** | **str** | | [optional] **choices** | [**list[IvrChoice]**](IvrChoice.md) | | [optional] diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index 0f1a5be..299fce9 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -481,6 +481,89 @@ def call_create(self, call_id, to_number, from_number, **kwargs): callback=params.get('callback')) return response + def call_fetch_ivr(self, call_id, url, **kwargs): + """ + Fetches IVR for the call from external URL + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.call_fetch_ivr(call_id, url, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str call_id: (required) + :param str url: (required) + :return: list[Ivr] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['call_id', 'url'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method call_fetch_ivr" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'call_id' is set + if ('call_id' not in params) or (params['call_id'] is None): + raise ValueError("Missing the required parameter `call_id` when calling `call_fetch_ivr`") + # verify the required parameter 'url' is set + if ('url' not in params) or (params['url'] is None): + raise ValueError("Missing the required parameter `url` when calling `call_fetch_ivr`") + + resource_path = '/calls/{callId}/_fetchIvr'.replace('{format}', 'json') + path_params = {} + if 'call_id' in params: + path_params['callId'] = params['call_id'] + + query_params = {} + if 'url' in params: + query_params['url'] = params['url'] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = ['privileges', 'apikey'] + + response = self.api_client.call_api(resource_path, 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Ivr]', + auth_settings=auth_settings, + callback=params.get('callback')) + return response + def call_get_status(self, call_id, **kwargs): """ Return the status of call diff --git a/liveagent_api/models/ivr_step.py b/liveagent_api/models/ivr_step.py index 45c43ee..d890b6a 100644 --- a/liveagent_api/models/ivr_step.py +++ b/liveagent_api/models/ivr_step.py @@ -56,7 +56,7 @@ def __init__(self): def type(self): """ Gets the type of this IvrStep. - P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (choices), G - goto (IVR name in params), T - transfer (optional ivr settings in params {\"O\":\"online\",\"F\":\"offline\",\"Q\":\"queue\"}) + P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (choices), G - goto (IVR name in params), T - transfer (optional ivr settings in choices {\"1\":\"online\",\"0\":\"offline\",\"9\":\"queue\"}), F - fetch next IVR steps from URL in params :return: The type of this IvrStep. :rtype: str @@ -67,12 +67,12 @@ def type(self): def type(self, type): """ Sets the type of this IvrStep. - P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (choices), G - goto (IVR name in params), T - transfer (optional ivr settings in params {\"O\":\"online\",\"F\":\"offline\",\"Q\":\"queue\"}) + P - play message (URL in params), R - ring to agent (optional departmentId in params), V - redirect to voicemail, D - choice (choices), G - goto (IVR name in params), T - transfer (optional ivr settings in choices {\"1\":\"online\",\"0\":\"offline\",\"9\":\"queue\"}), F - fetch next IVR steps from URL in params :param type: The type of this IvrStep. :type: str """ - allowed_values = ["P", "R", "V", "D", "G", "T"] + allowed_values = ["P", "R", "V", "D", "G", "T", "F"] if type not in allowed_values: raise ValueError( "Invalid value for `type`, must be one of {0}" From 063183ece45016e53574a5f6ec9559f9136792a0 Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Fri, 1 Dec 2017 14:56:00 +0100 Subject: [PATCH 03/12] known ivrs --- README.md | 2 +- docs/CallsApi.md | 6 ++++-- liveagent_api/apis/calls_api.py | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1afd512..b76c817 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-01T14:26:02.213+01:00 +- Build date: 2017-12-01T14:55:50.574+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/docs/CallsApi.md b/docs/CallsApi.md index 44225c7..174d685 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -307,7 +307,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **call_fetch_ivr** -> list[Ivr] call_fetch_ivr(call_id, url) +> list[Ivr] call_fetch_ivr(call_id, url, ivrs=ivrs) Fetches IVR for the call from external URL @@ -329,10 +329,11 @@ liveagent_api.configuration.api_key['apikey'] = 'YOUR_API_KEY' api_instance = liveagent_api.CallsApi() call_id = 'call_id_example' # str | url = 'url_example' # str | +ivrs = ['ivrs_example'] # list[str] | List of globally known ivrs (optional) try: # Fetches IVR for the call from external URL - api_response = api_instance.call_fetch_ivr(call_id, url) + api_response = api_instance.call_fetch_ivr(call_id, url, ivrs=ivrs) pprint(api_response) except ApiException as e: print "Exception when calling CallsApi->call_fetch_ivr: %s\n" % e @@ -344,6 +345,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **call_id** | **str**| | **url** | **str**| | + **ivrs** | [**list[str]**](str.md)| List of globally known ivrs | [optional] ### Return type diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index 299fce9..8d29b2a 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -498,12 +498,13 @@ def call_fetch_ivr(self, call_id, url, **kwargs): for asynchronous request. (optional) :param str call_id: (required) :param str url: (required) + :param list[str] ivrs: List of globally known ivrs :return: list[Ivr] If the method is called asynchronously, returns the request thread. """ - all_params = ['call_id', 'url'] + all_params = ['call_id', 'url', 'ivrs'] all_params.append('callback') params = locals() @@ -531,6 +532,8 @@ def call_fetch_ivr(self, call_id, url, **kwargs): query_params = {} if 'url' in params: query_params['url'] = params['url'] + if 'ivrs' in params: + query_params['ivrs'] = params['ivrs'] header_params = {} From 275e994ff5f3857fa0ea95d9e28b07c2b0c7ade3 Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Fri, 1 Dec 2017 15:00:51 +0100 Subject: [PATCH 04/12] s --- README.md | 2 +- docs/CallsApi.md | 6 ++++-- liveagent_api/apis/calls_api.py | 12 +++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b76c817..1273bd4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-01T14:55:50.574+01:00 +- Build date: 2017-12-01T15:00:46.299+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/docs/CallsApi.md b/docs/CallsApi.md index 174d685..9f8155c 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -307,7 +307,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **call_fetch_ivr** -> list[Ivr] call_fetch_ivr(call_id, url, ivrs=ivrs) +> list[Ivr] call_fetch_ivr(call_id, prefix, url, ivrs=ivrs) Fetches IVR for the call from external URL @@ -328,12 +328,13 @@ liveagent_api.configuration.api_key['apikey'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = liveagent_api.CallsApi() call_id = 'call_id_example' # str | +prefix = 'prefix_example' # str | In order to avoid name clash, use unique fetch for each prefix url = 'url_example' # str | ivrs = ['ivrs_example'] # list[str] | List of globally known ivrs (optional) try: # Fetches IVR for the call from external URL - api_response = api_instance.call_fetch_ivr(call_id, url, ivrs=ivrs) + api_response = api_instance.call_fetch_ivr(call_id, prefix, url, ivrs=ivrs) pprint(api_response) except ApiException as e: print "Exception when calling CallsApi->call_fetch_ivr: %s\n" % e @@ -344,6 +345,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **call_id** | **str**| | + **prefix** | **str**| In order to avoid name clash, use unique fetch for each prefix | **url** | **str**| | **ivrs** | [**list[str]**](str.md)| List of globally known ivrs | [optional] diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index 8d29b2a..3e0cd92 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -481,7 +481,7 @@ def call_create(self, call_id, to_number, from_number, **kwargs): callback=params.get('callback')) return response - def call_fetch_ivr(self, call_id, url, **kwargs): + def call_fetch_ivr(self, call_id, prefix, url, **kwargs): """ Fetches IVR for the call from external URL @@ -492,11 +492,12 @@ def call_fetch_ivr(self, call_id, url, **kwargs): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.call_fetch_ivr(call_id, url, callback=callback_function) + >>> thread = api.call_fetch_ivr(call_id, prefix, url, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str call_id: (required) + :param str prefix: In order to avoid name clash, use unique fetch for each prefix (required) :param str url: (required) :param list[str] ivrs: List of globally known ivrs :return: list[Ivr] @@ -504,7 +505,7 @@ def call_fetch_ivr(self, call_id, url, **kwargs): returns the request thread. """ - all_params = ['call_id', 'url', 'ivrs'] + all_params = ['call_id', 'prefix', 'url', 'ivrs'] all_params.append('callback') params = locals() @@ -520,6 +521,9 @@ def call_fetch_ivr(self, call_id, url, **kwargs): # verify the required parameter 'call_id' is set if ('call_id' not in params) or (params['call_id'] is None): raise ValueError("Missing the required parameter `call_id` when calling `call_fetch_ivr`") + # verify the required parameter 'prefix' is set + if ('prefix' not in params) or (params['prefix'] is None): + raise ValueError("Missing the required parameter `prefix` when calling `call_fetch_ivr`") # verify the required parameter 'url' is set if ('url' not in params) or (params['url'] is None): raise ValueError("Missing the required parameter `url` when calling `call_fetch_ivr`") @@ -530,6 +534,8 @@ def call_fetch_ivr(self, call_id, url, **kwargs): path_params['callId'] = params['call_id'] query_params = {} + if 'prefix' in params: + query_params['prefix'] = params['prefix'] if 'url' in params: query_params['url'] = params['url'] if 'ivrs' in params: From ae49ee9bf931fa5987bff8db342342a719f42389 Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Mon, 4 Dec 2017 12:20:16 +0100 Subject: [PATCH 05/12] update --- README.md | 2 +- liveagent_api/apis/calls_api.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1273bd4..43cff90 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-01T15:00:46.299+01:00 +- Build date: 2017-12-04T12:20:11.170+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index 3e0cd92..92a7708 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -534,17 +534,17 @@ def call_fetch_ivr(self, call_id, prefix, url, **kwargs): path_params['callId'] = params['call_id'] query_params = {} - if 'prefix' in params: - query_params['prefix'] = params['prefix'] - if 'url' in params: - query_params['url'] = params['url'] - if 'ivrs' in params: - query_params['ivrs'] = params['ivrs'] header_params = {} form_params = [] local_var_files = {} + if 'prefix' in params: + form_params.append(('prefix', params['prefix'])) + if 'url' in params: + form_params.append(('url', params['url'])) + if 'ivrs' in params: + form_params.append(('ivrs', params['ivrs'])) body_params = None From bfb2689b6b973e080da3eaa4da6622253841d96b Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Mon, 4 Dec 2017 12:28:28 +0100 Subject: [PATCH 06/12] update --- README.md | 2 +- docs/CallsApi.md | 2 +- liveagent_api/apis/calls_api.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 43cff90..79a583b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-04T12:20:11.170+01:00 +- Build date: 2017-12-04T12:28:23.698+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/docs/CallsApi.md b/docs/CallsApi.md index 9f8155c..ea985db 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -359,7 +359,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index 92a7708..c55af81 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -556,7 +556,7 @@ def call_fetch_ivr(self, call_id, prefix, url, **kwargs): # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + select_header_content_type(['application/x-www-form-urlencoded']) # Authentication setting auth_settings = ['privileges', 'apikey'] From 1da371b8dc6195b650c7df5084b28cc954b4ecc3 Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Mon, 4 Dec 2017 12:46:30 +0100 Subject: [PATCH 07/12] update --- README.md | 2 +- liveagent_api/apis/calls_api.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 79a583b..db1fe71 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-04T12:28:23.698+01:00 +- Build date: 2017-12-04T12:46:25.713+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index c55af81..0b8cba3 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -534,17 +534,17 @@ def call_fetch_ivr(self, call_id, prefix, url, **kwargs): path_params['callId'] = params['call_id'] query_params = {} + if 'prefix' in params: + query_params['prefix'] = params['prefix'] + if 'url' in params: + query_params['url'] = params['url'] + if 'ivrs' in params: + query_params['ivrs'] = params['ivrs'] header_params = {} form_params = [] local_var_files = {} - if 'prefix' in params: - form_params.append(('prefix', params['prefix'])) - if 'url' in params: - form_params.append(('url', params['url'])) - if 'ivrs' in params: - form_params.append(('ivrs', params['ivrs'])) body_params = None From 2098232e84f55338d2a513bb35f5899d8396d1de Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Mon, 4 Dec 2017 12:53:55 +0100 Subject: [PATCH 08/12] update --- README.md | 2 +- liveagent_api/apis/calls_api.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index db1fe71..a5d5de4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-04T12:46:25.713+01:00 +- Build date: 2017-12-04T12:53:54.533+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index 0b8cba3..c55af81 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -534,17 +534,17 @@ def call_fetch_ivr(self, call_id, prefix, url, **kwargs): path_params['callId'] = params['call_id'] query_params = {} - if 'prefix' in params: - query_params['prefix'] = params['prefix'] - if 'url' in params: - query_params['url'] = params['url'] - if 'ivrs' in params: - query_params['ivrs'] = params['ivrs'] header_params = {} form_params = [] local_var_files = {} + if 'prefix' in params: + form_params.append(('prefix', params['prefix'])) + if 'url' in params: + form_params.append(('url', params['url'])) + if 'ivrs' in params: + form_params.append(('ivrs', params['ivrs'])) body_params = None From 572c8f6369f71bd4cbcf174d9a81a98d5610c115 Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Mon, 4 Dec 2017 13:05:53 +0100 Subject: [PATCH 09/12] update --- README.md | 2 +- docs/CallsApi.md | 2 +- liveagent_api/apis/calls_api.py | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a5d5de4..7382375 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-04T12:53:54.533+01:00 +- Build date: 2017-12-04T13:05:52.946+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/docs/CallsApi.md b/docs/CallsApi.md index ea985db..9f8155c 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -359,7 +359,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded + - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index c55af81..3e0cd92 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -534,17 +534,17 @@ def call_fetch_ivr(self, call_id, prefix, url, **kwargs): path_params['callId'] = params['call_id'] query_params = {} + if 'prefix' in params: + query_params['prefix'] = params['prefix'] + if 'url' in params: + query_params['url'] = params['url'] + if 'ivrs' in params: + query_params['ivrs'] = params['ivrs'] header_params = {} form_params = [] local_var_files = {} - if 'prefix' in params: - form_params.append(('prefix', params['prefix'])) - if 'url' in params: - form_params.append(('url', params['url'])) - if 'ivrs' in params: - form_params.append(('ivrs', params['ivrs'])) body_params = None @@ -556,7 +556,7 @@ def call_fetch_ivr(self, call_id, prefix, url, **kwargs): # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/x-www-form-urlencoded']) + select_header_content_type(['application/json']) # Authentication setting auth_settings = ['privileges', 'apikey'] From a470e58e61d4f0a80ce434cb2a240c521afd1c02 Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Wed, 6 Dec 2017 15:37:15 +0100 Subject: [PATCH 10/12] update --- README.md | 9 +- docs/CallsApi.md | 77 +++- docs/InvoiceList.md | 11 + docs/IvrFetch.md | 11 + docs/IvrFetchParam.md | 11 + docs/PhoneNumber.md | 1 + docs/PhonenumbersApi.md | 10 +- docs/SubscriptionsApi.md | 4 +- docs/TicketInformation.md | 22 + docs/TicketListItem.md | 24 + docs/TicketsApi.md | 55 +++ liveagent_api/__init__.py | 5 + liveagent_api/apis/calls_api.py | 119 ++++- liveagent_api/apis/phonenumbers_api.py | 7 +- liveagent_api/apis/subscriptions_api.py | 4 +- liveagent_api/apis/tickets_api.py | 74 +++ liveagent_api/models/__init__.py | 5 + liveagent_api/models/invoice_list.py | 145 ++++++ liveagent_api/models/ivr_fetch.py | 145 ++++++ liveagent_api/models/ivr_fetch_param.py | 145 ++++++ liveagent_api/models/phone_number.py | 25 ++ liveagent_api/models/ticket_information.py | 420 ++++++++++++++++++ liveagent_api/models/ticket_list_item.py | 494 +++++++++++++++++++++ 23 files changed, 1781 insertions(+), 42 deletions(-) create mode 100644 docs/InvoiceList.md create mode 100644 docs/IvrFetch.md create mode 100644 docs/IvrFetchParam.md create mode 100644 docs/TicketInformation.md create mode 100644 docs/TicketListItem.md create mode 100644 liveagent_api/models/invoice_list.py create mode 100644 liveagent_api/models/ivr_fetch.py create mode 100644 liveagent_api/models/ivr_fetch_param.py create mode 100644 liveagent_api/models/ticket_information.py create mode 100644 liveagent_api/models/ticket_list_item.py diff --git a/README.md b/README.md index 7382375..86da12c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-04T13:05:52.946+01:00 +- Build date: 2017-12-06T15:37:14.622+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. @@ -110,6 +110,7 @@ Class | Method | HTTP request | Description *CallsApi* | [**call_reroute**](docs/CallsApi.md#call_reroute) | **POST** /calls/{callId}/_reroute | Let the call ring to another agent *CallsApi* | [**call_ring**](docs/CallsApi.md#call_ring) | **POST** /calls/{callId}/_ring | Let the call ring *CallsApi* | [**call_start**](docs/CallsApi.md#call_start) | **POST** /call/_start | Starts new outcoming / internal call +*CallsApi* | [**call_start_canceled**](docs/CallsApi.md#call_start_canceled) | **POST** /call/_startCanceled | Callback that starting call canceled *CallsApi* | [**call_start_failed**](docs/CallsApi.md#call_start_failed) | **POST** /call/_startFailed | Callback that starting call failed *CallsApi* | [**call_stop**](docs/CallsApi.md#call_stop) | **POST** /calls/{callId}/_stop | Stops the call *CallsApi* | [**call_transfer**](docs/CallsApi.md#call_transfer) | **POST** /calls/{callId}/_transfer | Transfers call to different department / agent @@ -191,6 +192,7 @@ Class | Method | HTTP request | Description *TagsApi* | [**get_tag_by_id**](docs/TagsApi.md#get_tag_by_id) | **GET** /tags/{tagId} | Get tag by tag id *TagsApi* | [**get_tags_list**](docs/TagsApi.md#get_tags_list) | **GET** /tags | Gets list of tags *TagsApi* | [**update_tag**](docs/TagsApi.md#update_tag) | **PUT** /tags/{tagId} | Update tag +*TicketsApi* | [**create_ticket**](docs/TicketsApi.md#create_ticket) | **POST** /tickets | Create ticket *TicketsApi* | [**delete_ticket**](docs/TicketsApi.md#delete_ticket) | **DELETE** /tickets/{ticketId} | Deletes ticket *TicketsApi* | [**get_ticket**](docs/TicketsApi.md#get_ticket) | **GET** /tickets/{ticketId} | Gets ticket *TicketsApi* | [**get_ticket_attribute**](docs/TicketsApi.md#get_ticket_attribute) | **GET** /tickets/{ticketId}/attributes/{attributeName} | Gets ticket attribute @@ -242,8 +244,11 @@ Class | Method | HTTP request | Description - [HostingInfo](docs/HostingInfo.md) - [Invoice](docs/Invoice.md) - [InvoiceItem](docs/InvoiceItem.md) + - [InvoiceList](docs/InvoiceList.md) - [Ivr](docs/Ivr.md) - [IvrChoice](docs/IvrChoice.md) + - [IvrFetch](docs/IvrFetch.md) + - [IvrFetchParam](docs/IvrFetchParam.md) - [IvrStep](docs/IvrStep.md) - [OkResponse](docs/OkResponse.md) - [PaymentInfo](docs/PaymentInfo.md) @@ -261,6 +266,8 @@ Class | Method | HTTP request | Description - [Tag](docs/Tag.md) - [Ticket](docs/Ticket.md) - [TicketAttribute](docs/TicketAttribute.md) + - [TicketInformation](docs/TicketInformation.md) + - [TicketListItem](docs/TicketListItem.md) - [TicketPostpone](docs/TicketPostpone.md) - [TicketSla](docs/TicketSla.md) - [TicketUpdatable](docs/TicketUpdatable.md) diff --git a/docs/CallsApi.md b/docs/CallsApi.md index 9f8155c..58859c4 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -16,6 +16,7 @@ Method | HTTP request | Description [**call_reroute**](CallsApi.md#call_reroute) | **POST** /calls/{callId}/_reroute | Let the call ring to another agent [**call_ring**](CallsApi.md#call_ring) | **POST** /calls/{callId}/_ring | Let the call ring [**call_start**](CallsApi.md#call_start) | **POST** /call/_start | Starts new outcoming / internal call +[**call_start_canceled**](CallsApi.md#call_start_canceled) | **POST** /call/_startCanceled | Callback that starting call canceled [**call_start_failed**](CallsApi.md#call_start_failed) | **POST** /call/_startFailed | Callback that starting call failed [**call_stop**](CallsApi.md#call_stop) | **POST** /calls/{callId}/_stop | Stops the call [**call_transfer**](CallsApi.md#call_transfer) | **POST** /calls/{callId}/_transfer | Transfers call to different department / agent @@ -307,7 +308,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **call_fetch_ivr** -> list[Ivr] call_fetch_ivr(call_id, prefix, url, ivrs=ivrs) +> list[Ivr] call_fetch_ivr(call_id, prefix, fetch) Fetches IVR for the call from external URL @@ -329,12 +330,11 @@ liveagent_api.configuration.api_key['apikey'] = 'YOUR_API_KEY' api_instance = liveagent_api.CallsApi() call_id = 'call_id_example' # str | prefix = 'prefix_example' # str | In order to avoid name clash, use unique fetch for each prefix -url = 'url_example' # str | -ivrs = ['ivrs_example'] # list[str] | List of globally known ivrs (optional) +fetch = liveagent_api.IvrFetch() # IvrFetch | try: # Fetches IVR for the call from external URL - api_response = api_instance.call_fetch_ivr(call_id, prefix, url, ivrs=ivrs) + api_response = api_instance.call_fetch_ivr(call_id, prefix, fetch) pprint(api_response) except ApiException as e: print "Exception when calling CallsApi->call_fetch_ivr: %s\n" % e @@ -346,8 +346,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **call_id** | **str**| | **prefix** | **str**| In order to avoid name clash, use unique fetch for each prefix | - **url** | **str**| | - **ivrs** | [**list[str]**](str.md)| List of globally known ivrs | [optional] + **fetch** | [**IvrFetch**](IvrFetch.md)| | ### Return type @@ -633,7 +632,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **call_start** -> OkResponse call_start(to_number, from_number, ticket_id=ticket_id) +> OkResponse call_start(to_number, from_number, via_number, ticket_id) Starts new outcoming / internal call @@ -653,11 +652,12 @@ liveagent_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = liveagent_api.CallsApi() to_number = 'to_number_example' # str | callee number from_number = 'from_number_example' # str | caller number -ticket_id = 'ticket_id_example' # str | ticket id or code (optional) +via_number = 'via_number_example' # str | trunk number via which call was made +ticket_id = 'ticket_id_example' # str | ticket id or code try: # Starts new outcoming / internal call - api_response = api_instance.call_start(to_number, from_number, ticket_id=ticket_id) + api_response = api_instance.call_start(to_number, from_number, via_number, ticket_id) pprint(api_response) except ApiException as e: print "Exception when calling CallsApi->call_start: %s\n" % e @@ -669,7 +669,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **to_number** | **str**| callee number | **from_number** | **str**| caller number | - **ticket_id** | **str**| ticket id or code | [optional] + **via_number** | **str**| trunk number via which call was made | + **ticket_id** | **str**| ticket id or code | ### Return type @@ -686,12 +687,62 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **call_start_canceled** +> OkResponse call_start_canceled(call_id) + +Callback that starting call canceled + +Callback is delivered only of HW phones + +### Example +```python +import time +import liveagent_api +from liveagent_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: privileges +liveagent_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = liveagent_api.CallsApi() +call_id = 'call_id_example' # str | Call ID + +try: + # Callback that starting call canceled + api_response = api_instance.call_start_canceled(call_id) + pprint(api_response) +except ApiException as e: + print "Exception when calling CallsApi->call_start_canceled: %s\n" % e +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **call_id** | **str**| Call ID | + +### Return type + +[**OkResponse**](OkResponse.md) + +### Authorization + +[privileges](../README.md#privileges) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **call_start_failed** > OkResponse call_start_failed(call_id) Callback that starting call failed -Callback is delivered only of HW phones\n +Callback is delivered only of HW phones ### Example ```python @@ -705,7 +756,7 @@ liveagent_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_instance = liveagent_api.CallsApi() -call_id = 'call_id_example' # str | Call ID. +call_id = 'call_id_example' # str | Call ID try: # Callback that starting call failed @@ -719,7 +770,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **call_id** | **str**| Call ID. | + **call_id** | **str**| Call ID | ### Return type diff --git a/docs/InvoiceList.md b/docs/InvoiceList.md new file mode 100644 index 0000000..d00f562 --- /dev/null +++ b/docs/InvoiceList.md @@ -0,0 +1,11 @@ +# InvoiceList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | **int** | | [optional] +**items** | [**list[Invoice]**](Invoice.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IvrFetch.md b/docs/IvrFetch.md new file mode 100644 index 0000000..cd8a30f --- /dev/null +++ b/docs/IvrFetch.md @@ -0,0 +1,11 @@ +# IvrFetch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | | [optional] +**params** | [**list[IvrFetchParam]**](IvrFetchParam.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IvrFetchParam.md b/docs/IvrFetchParam.md new file mode 100644 index 0000000..313f2e6 --- /dev/null +++ b/docs/IvrFetchParam.md @@ -0,0 +1,11 @@ +# IvrFetchParam + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**value** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PhoneNumber.md b/docs/PhoneNumber.md index 32ac8e5..a1c65a0 100644 --- a/docs/PhoneNumber.md +++ b/docs/PhoneNumber.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes **id** | **str** | | **type** | **str** | A - API controlled number, T - Twilio number, T-O - Twilio outgoing number, D - Digitale, S - Asterisk | [optional] **dial_out_prefix** | **int** | Prefix needed to orifinate call using this number | [optional] +**record_call** | **bool** | | [optional] **number** | **str** | | **name** | **str** | | [optional] **departmentid** | **str** | | [optional] diff --git a/docs/PhonenumbersApi.md b/docs/PhonenumbersApi.md index 0b69a66..e32b924 100644 --- a/docs/PhonenumbersApi.md +++ b/docs/PhonenumbersApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **add_number** -> PhoneNumber add_number(type, number, status, dial_out_prefix=dial_out_prefix, name=name, departmentid=departmentid, host_settings=host_settings, host=host, port=port, user=user, password=password, providerid=providerid, ivr=ivr) +> PhoneNumber add_number(type, number, status, dial_out_prefix=dial_out_prefix, record_call=record_call, name=name, departmentid=departmentid, host_settings=host_settings, host=host, port=port, user=user, password=password, providerid=providerid, ivr=ivr) Add new number @@ -36,7 +36,8 @@ api_instance = liveagent_api.PhonenumbersApi() type = 'type_example' # str | A - API controlled number, T - Twilio number, T-O - Twilio outgoing number, D - Digitale, S - Asterisk number = 'number_example' # str | status = 'status_example' # str | A - Active, I - Inactive -dial_out_prefix = 56 # int | Prefix needed to orifinate call using this number (optional) +dial_out_prefix = 56 # int | Prefix needed to originate call using this number (optional) +record_call = true # bool | (optional) name = 'name_example' # str | (optional) departmentid = 'departmentid_example' # str | (optional) host_settings = 'host_settings_example' # str | json encoded host settings (optional) @@ -49,7 +50,7 @@ ivr = 'ivr_example' # str | (optional) try: # Add new number - api_response = api_instance.add_number(type, number, status, dial_out_prefix=dial_out_prefix, name=name, departmentid=departmentid, host_settings=host_settings, host=host, port=port, user=user, password=password, providerid=providerid, ivr=ivr) + api_response = api_instance.add_number(type, number, status, dial_out_prefix=dial_out_prefix, record_call=record_call, name=name, departmentid=departmentid, host_settings=host_settings, host=host, port=port, user=user, password=password, providerid=providerid, ivr=ivr) pprint(api_response) except ApiException as e: print "Exception when calling PhonenumbersApi->add_number: %s\n" % e @@ -62,7 +63,8 @@ Name | Type | Description | Notes **type** | **str**| A - API controlled number, T - Twilio number, T-O - Twilio outgoing number, D - Digitale, S - Asterisk | **number** | **str**| | **status** | **str**| A - Active, I - Inactive | - **dial_out_prefix** | **int**| Prefix needed to orifinate call using this number | [optional] + **dial_out_prefix** | **int**| Prefix needed to originate call using this number | [optional] + **record_call** | **bool**| | [optional] **name** | **str**| | [optional] **departmentid** | **str**| | [optional] **host_settings** | **str**| json encoded host settings | [optional] diff --git a/docs/SubscriptionsApi.md b/docs/SubscriptionsApi.md index d004949..95712dd 100644 --- a/docs/SubscriptionsApi.md +++ b/docs/SubscriptionsApi.md @@ -685,7 +685,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_subscription_invoices** -> list[Invoice] get_subscription_invoices(subscription_id, page=page, per_page=per_page, sort_dir=sort_dir, sort_field=sort_field, filters=filters, _from=_from, to=to) +> InvoiceList get_subscription_invoices(subscription_id, page=page, per_page=per_page, sort_dir=sort_dir, sort_field=sort_field, filters=filters, _from=_from, to=to) Subscription invoice list @@ -739,7 +739,7 @@ Name | Type | Description | Notes ### Return type -[**list[Invoice]**](Invoice.md) +[**InvoiceList**](InvoiceList.md) ### Authorization diff --git a/docs/TicketInformation.md b/docs/TicketInformation.md new file mode 100644 index 0000000..dd9d72c --- /dev/null +++ b/docs/TicketInformation.md @@ -0,0 +1,22 @@ +# TicketInformation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**ownerid** | **str** | | [optional] +**owner_contactid** | **str** | | [optional] +**departmentid** | **str** | | [optional] +**agentid** | **str** | | [optional] +**status** | **str** | | [optional] +**tags** | **str** | | [optional] +**code** | **str** | | [optional] +**channel_type** | **str** | | [optional] +**date_created** | **str** | | [optional] +**public_access_urlcode** | **str** | | [optional] +**subject** | **str** | | [optional] +**custom_fields** | [**list[CustomFields]**](CustomFields.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TicketListItem.md b/docs/TicketListItem.md new file mode 100644 index 0000000..fc40fab --- /dev/null +++ b/docs/TicketListItem.md @@ -0,0 +1,24 @@ +# TicketListItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**useridentifier** | **str** | | +**subject** | **str** | | +**departmentid** | **str** | | +**recipient** | **str** | | +**message** | **str** | | +**recipient_name** | **str** | | [optional] +**carbon_copy** | **str** | | [optional] +**status** | **str** | <br> I - init<br> N - new<br> T - chatting<br> P - calling<br> R - resolved<br> X - deleted<br> B - spam<br> A - answered<br> C - open<br> W - postponed | [optional] [default to 'N'] +**mail_message_id** | **str** | | [optional] +**do_not_send_mail** | **str** | Y - yes, N - no | [optional] [default to 'N'] +**use_template** | **str** | Y - yes, N - no | [optional] [default to 'Y'] +**is_html_message** | **str** | Y - yes, N - no | [optional] [default to 'N'] +**custom_fields** | [**list[CustomFields]**](CustomFields.md) | | [optional] +**tags** | **list[str]** | array of tags id | [optional] +**attachments** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TicketsApi.md b/docs/TicketsApi.md index 59a4b5a..92d00d8 100644 --- a/docs/TicketsApi.md +++ b/docs/TicketsApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://localhost/api/v3* Method | HTTP request | Description ------------- | ------------- | ------------- +[**create_ticket**](TicketsApi.md#create_ticket) | **POST** /tickets | Create ticket [**delete_ticket**](TicketsApi.md#delete_ticket) | **DELETE** /tickets/{ticketId} | Deletes ticket [**get_ticket**](TicketsApi.md#get_ticket) | **GET** /tickets/{ticketId} | Gets ticket [**get_ticket_attribute**](TicketsApi.md#get_ticket_attribute) | **GET** /tickets/{ticketId}/attributes/{attributeName} | Gets ticket attribute @@ -14,6 +15,60 @@ Method | HTTP request | Description [**update_ticket**](TicketsApi.md#update_ticket) | **PUT** /tickets/{ticketId} | Updates ticket +# **create_ticket** +> TicketInformation create_ticket(ticket=ticket) + +Create ticket + +Create new ticket + +### Example +```python +import time +import liveagent_api +from liveagent_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: privileges +liveagent_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' +# Configure API key authorization: apikey +liveagent_api.configuration.api_key['apikey'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed +# liveagent_api.configuration.api_key_prefix['apikey'] = 'BEARER' + +# create an instance of the API class +api_instance = liveagent_api.TicketsApi() +ticket = liveagent_api.TicketListItem() # TicketListItem | (optional) + +try: + # Create ticket + api_response = api_instance.create_ticket(ticket=ticket) + pprint(api_response) +except ApiException as e: + print "Exception when calling TicketsApi->create_ticket: %s\n" % e +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ticket** | [**TicketListItem**](TicketListItem.md)| | [optional] + +### Return type + +[**TicketInformation**](TicketInformation.md) + +### Authorization + +[privileges](../README.md#privileges), [apikey](../README.md#apikey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **delete_ticket** > OkResponse delete_ticket(ticket_id) diff --git a/liveagent_api/__init__.py b/liveagent_api/__init__.py index b5381e4..d15af04 100644 --- a/liveagent_api/__init__.py +++ b/liveagent_api/__init__.py @@ -38,8 +38,11 @@ from .models.hosting_info import HostingInfo from .models.invoice import Invoice from .models.invoice_item import InvoiceItem +from .models.invoice_list import InvoiceList from .models.ivr import Ivr from .models.ivr_choice import IvrChoice +from .models.ivr_fetch import IvrFetch +from .models.ivr_fetch_param import IvrFetchParam from .models.ivr_step import IvrStep from .models.ok_response import OkResponse from .models.payment_info import PaymentInfo @@ -57,6 +60,8 @@ from .models.tag import Tag from .models.ticket import Ticket from .models.ticket_attribute import TicketAttribute +from .models.ticket_information import TicketInformation +from .models.ticket_list_item import TicketListItem from .models.ticket_postpone import TicketPostpone from .models.ticket_sla import TicketSla from .models.ticket_updatable import TicketUpdatable diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index 3e0cd92..9242718 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -481,7 +481,7 @@ def call_create(self, call_id, to_number, from_number, **kwargs): callback=params.get('callback')) return response - def call_fetch_ivr(self, call_id, prefix, url, **kwargs): + def call_fetch_ivr(self, call_id, prefix, fetch, **kwargs): """ Fetches IVR for the call from external URL @@ -492,20 +492,19 @@ def call_fetch_ivr(self, call_id, prefix, url, **kwargs): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.call_fetch_ivr(call_id, prefix, url, callback=callback_function) + >>> thread = api.call_fetch_ivr(call_id, prefix, fetch, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str call_id: (required) :param str prefix: In order to avoid name clash, use unique fetch for each prefix (required) - :param str url: (required) - :param list[str] ivrs: List of globally known ivrs + :param IvrFetch fetch: (required) :return: list[Ivr] If the method is called asynchronously, returns the request thread. """ - all_params = ['call_id', 'prefix', 'url', 'ivrs'] + all_params = ['call_id', 'prefix', 'fetch'] all_params.append('callback') params = locals() @@ -524,9 +523,9 @@ def call_fetch_ivr(self, call_id, prefix, url, **kwargs): # verify the required parameter 'prefix' is set if ('prefix' not in params) or (params['prefix'] is None): raise ValueError("Missing the required parameter `prefix` when calling `call_fetch_ivr`") - # verify the required parameter 'url' is set - if ('url' not in params) or (params['url'] is None): - raise ValueError("Missing the required parameter `url` when calling `call_fetch_ivr`") + # verify the required parameter 'fetch' is set + if ('fetch' not in params) or (params['fetch'] is None): + raise ValueError("Missing the required parameter `fetch` when calling `call_fetch_ivr`") resource_path = '/calls/{callId}/_fetchIvr'.replace('{format}', 'json') path_params = {} @@ -536,10 +535,6 @@ def call_fetch_ivr(self, call_id, prefix, url, **kwargs): query_params = {} if 'prefix' in params: query_params['prefix'] = params['prefix'] - if 'url' in params: - query_params['url'] = params['url'] - if 'ivrs' in params: - query_params['ivrs'] = params['ivrs'] header_params = {} @@ -547,6 +542,8 @@ def call_fetch_ivr(self, call_id, prefix, url, **kwargs): local_var_files = {} body_params = None + if 'fetch' in params: + body_params = params['fetch'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ @@ -985,7 +982,7 @@ def call_ring(self, call_id, **kwargs): callback=params.get('callback')) return response - def call_start(self, to_number, from_number, **kwargs): + def call_start(self, to_number, from_number, via_number, ticket_id, **kwargs): """ Starts new outcoming / internal call Starts new call by ringing agent device and the dialing customer after agent has picked up his phone\n @@ -996,19 +993,20 @@ def call_start(self, to_number, from_number, **kwargs): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.call_start(to_number, from_number, callback=callback_function) + >>> thread = api.call_start(to_number, from_number, via_number, ticket_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str to_number: callee number (required) :param str from_number: caller number (required) - :param str ticket_id: ticket id or code + :param str via_number: trunk number via which call was made (required) + :param str ticket_id: ticket id or code (required) :return: OkResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['to_number', 'from_number', 'ticket_id'] + all_params = ['to_number', 'from_number', 'via_number', 'ticket_id'] all_params.append('callback') params = locals() @@ -1027,6 +1025,12 @@ def call_start(self, to_number, from_number, **kwargs): # verify the required parameter 'from_number' is set if ('from_number' not in params) or (params['from_number'] is None): raise ValueError("Missing the required parameter `from_number` when calling `call_start`") + # verify the required parameter 'via_number' is set + if ('via_number' not in params) or (params['via_number'] is None): + raise ValueError("Missing the required parameter `via_number` when calling `call_start`") + # verify the required parameter 'ticket_id' is set + if ('ticket_id' not in params) or (params['ticket_id'] is None): + raise ValueError("Missing the required parameter `ticket_id` when calling `call_start`") resource_path = '/call/_start'.replace('{format}', 'json') path_params = {} @@ -1036,6 +1040,8 @@ def call_start(self, to_number, from_number, **kwargs): query_params['to_number'] = params['to_number'] if 'from_number' in params: query_params['from_number'] = params['from_number'] + if 'via_number' in params: + query_params['via_number'] = params['via_number'] if 'ticket_id' in params: query_params['ticketId'] = params['ticket_id'] @@ -1071,10 +1077,87 @@ def call_start(self, to_number, from_number, **kwargs): callback=params.get('callback')) return response + def call_start_canceled(self, call_id, **kwargs): + """ + Callback that starting call canceled + Callback is delivered only of HW phones + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.call_start_canceled(call_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str call_id: Call ID (required) + :return: OkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['call_id'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method call_start_canceled" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'call_id' is set + if ('call_id' not in params) or (params['call_id'] is None): + raise ValueError("Missing the required parameter `call_id` when calling `call_start_canceled`") + + resource_path = '/call/_startCanceled'.replace('{format}', 'json') + path_params = {} + + query_params = {} + if 'call_id' in params: + query_params['callId'] = params['call_id'] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = ['privileges'] + + response = self.api_client.call_api(resource_path, 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OkResponse', + auth_settings=auth_settings, + callback=params.get('callback')) + return response + def call_start_failed(self, call_id, **kwargs): """ Callback that starting call failed - Callback is delivered only of HW phones\n + Callback is delivered only of HW phones This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -1086,7 +1169,7 @@ def call_start_failed(self, call_id, **kwargs): :param callback function: The callback function for asynchronous request. (optional) - :param str call_id: Call ID. (required) + :param str call_id: Call ID (required) :return: OkResponse If the method is called asynchronously, returns the request thread. diff --git a/liveagent_api/apis/phonenumbers_api.py b/liveagent_api/apis/phonenumbers_api.py index 64e1d28..2d88210 100644 --- a/liveagent_api/apis/phonenumbers_api.py +++ b/liveagent_api/apis/phonenumbers_api.py @@ -63,7 +63,8 @@ def add_number(self, type, number, status, **kwargs): :param str type: A - API controlled number, T - Twilio number, T-O - Twilio outgoing number, D - Digitale, S - Asterisk (required) :param str number: (required) :param str status: A - Active, I - Inactive (required) - :param int dial_out_prefix: Prefix needed to orifinate call using this number + :param int dial_out_prefix: Prefix needed to originate call using this number + :param bool record_call: :param str name: :param str departmentid: :param str host_settings: json encoded host settings @@ -78,7 +79,7 @@ def add_number(self, type, number, status, **kwargs): returns the request thread. """ - all_params = ['type', 'number', 'status', 'dial_out_prefix', 'name', 'departmentid', 'host_settings', 'host', 'port', 'user', 'password', 'providerid', 'ivr'] + all_params = ['type', 'number', 'status', 'dial_out_prefix', 'record_call', 'name', 'departmentid', 'host_settings', 'host', 'port', 'user', 'password', 'providerid', 'ivr'] all_params.append('callback') params = locals() @@ -114,6 +115,8 @@ def add_number(self, type, number, status, **kwargs): form_params.append(('type', params['type'])) if 'dial_out_prefix' in params: form_params.append(('dial_out_prefix', params['dial_out_prefix'])) + if 'record_call' in params: + form_params.append(('record_call', params['record_call'])) if 'number' in params: form_params.append(('number', params['number'])) if 'status' in params: diff --git a/liveagent_api/apis/subscriptions_api.py b/liveagent_api/apis/subscriptions_api.py index f390ad3..45baff5 100644 --- a/liveagent_api/apis/subscriptions_api.py +++ b/liveagent_api/apis/subscriptions_api.py @@ -1007,7 +1007,7 @@ def get_subscription_invoices(self, subscription_id, **kwargs): :param str filters: Filters (json object {column:value, ...}) :param int _from: Result set start. Takes precedence over _page. :param int to: Result set end. Used only if _from is used. - :return: list[Invoice] + :return: InvoiceList If the method is called asynchronously, returns the request thread. """ @@ -1077,7 +1077,7 @@ def get_subscription_invoices(self, subscription_id, **kwargs): body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Invoice]', + response_type='InvoiceList', auth_settings=auth_settings, callback=params.get('callback')) return response diff --git a/liveagent_api/apis/tickets_api.py b/liveagent_api/apis/tickets_api.py index 6779c23..c8a447c 100644 --- a/liveagent_api/apis/tickets_api.py +++ b/liveagent_api/apis/tickets_api.py @@ -45,6 +45,80 @@ def __init__(self, api_client=None): config.api_client = ApiClient() self.api_client = config.api_client + def create_ticket(self, **kwargs): + """ + Create ticket + Create new ticket + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.create_ticket(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param TicketListItem ticket: + :return: TicketInformation + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticket'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_ticket" % key + ) + params[key] = val + del params['kwargs'] + + + resource_path = '/tickets'.replace('{format}', 'json') + path_params = {} + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'ticket' in params: + body_params = params['ticket'] + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = ['privileges', 'apikey'] + + response = self.api_client.call_api(resource_path, 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TicketInformation', + auth_settings=auth_settings, + callback=params.get('callback')) + return response + def delete_ticket(self, ticket_id, **kwargs): """ Deletes ticket diff --git a/liveagent_api/models/__init__.py b/liveagent_api/models/__init__.py index 9518f41..3690fdd 100644 --- a/liveagent_api/models/__init__.py +++ b/liveagent_api/models/__init__.py @@ -38,8 +38,11 @@ from .hosting_info import HostingInfo from .invoice import Invoice from .invoice_item import InvoiceItem +from .invoice_list import InvoiceList from .ivr import Ivr from .ivr_choice import IvrChoice +from .ivr_fetch import IvrFetch +from .ivr_fetch_param import IvrFetchParam from .ivr_step import IvrStep from .ok_response import OkResponse from .payment_info import PaymentInfo @@ -57,6 +60,8 @@ from .tag import Tag from .ticket import Ticket from .ticket_attribute import TicketAttribute +from .ticket_information import TicketInformation +from .ticket_list_item import TicketListItem from .ticket_postpone import TicketPostpone from .ticket_sla import TicketSla from .ticket_updatable import TicketUpdatable diff --git a/liveagent_api/models/invoice_list.py b/liveagent_api/models/invoice_list.py new file mode 100644 index 0000000..85312e5 --- /dev/null +++ b/liveagent_api/models/invoice_list.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" +Copyright 2016 SmartBear Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Ref: https://github.com/swagger-api/swagger-codegen +""" + +from pprint import pformat +from six import iteritems + + +class InvoiceList(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + InvoiceList - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'size': 'int', + 'items': 'list[Invoice]' + } + + self.attribute_map = { + 'size': 'size', + 'items': 'items' + } + + self._size = None + self._items = None + + @property + def size(self): + """ + Gets the size of this InvoiceList. + + + :return: The size of this InvoiceList. + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """ + Sets the size of this InvoiceList. + + + :param size: The size of this InvoiceList. + :type: int + """ + self._size = size + + @property + def items(self): + """ + Gets the items of this InvoiceList. + + + :return: The items of this InvoiceList. + :rtype: list[Invoice] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this InvoiceList. + + + :param items: The items of this InvoiceList. + :type: list[Invoice] + """ + self._items = items + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other + diff --git a/liveagent_api/models/ivr_fetch.py b/liveagent_api/models/ivr_fetch.py new file mode 100644 index 0000000..1b67902 --- /dev/null +++ b/liveagent_api/models/ivr_fetch.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" +Copyright 2016 SmartBear Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Ref: https://github.com/swagger-api/swagger-codegen +""" + +from pprint import pformat +from six import iteritems + + +class IvrFetch(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + IvrFetch - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'url': 'str', + 'params': 'list[IvrFetchParam]' + } + + self.attribute_map = { + 'url': 'url', + 'params': 'params' + } + + self._url = None + self._params = None + + @property + def url(self): + """ + Gets the url of this IvrFetch. + + + :return: The url of this IvrFetch. + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """ + Sets the url of this IvrFetch. + + + :param url: The url of this IvrFetch. + :type: str + """ + self._url = url + + @property + def params(self): + """ + Gets the params of this IvrFetch. + + + :return: The params of this IvrFetch. + :rtype: list[IvrFetchParam] + """ + return self._params + + @params.setter + def params(self, params): + """ + Sets the params of this IvrFetch. + + + :param params: The params of this IvrFetch. + :type: list[IvrFetchParam] + """ + self._params = params + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other + diff --git a/liveagent_api/models/ivr_fetch_param.py b/liveagent_api/models/ivr_fetch_param.py new file mode 100644 index 0000000..63f4ab4 --- /dev/null +++ b/liveagent_api/models/ivr_fetch_param.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" +Copyright 2016 SmartBear Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Ref: https://github.com/swagger-api/swagger-codegen +""" + +from pprint import pformat +from six import iteritems + + +class IvrFetchParam(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + IvrFetchParam - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'name': 'str', + 'value': 'str' + } + + self.attribute_map = { + 'name': 'name', + 'value': 'value' + } + + self._name = None + self._value = None + + @property + def name(self): + """ + Gets the name of this IvrFetchParam. + + + :return: The name of this IvrFetchParam. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this IvrFetchParam. + + + :param name: The name of this IvrFetchParam. + :type: str + """ + self._name = name + + @property + def value(self): + """ + Gets the value of this IvrFetchParam. + + + :return: The value of this IvrFetchParam. + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """ + Sets the value of this IvrFetchParam. + + + :param value: The value of this IvrFetchParam. + :type: str + """ + self._value = value + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other + diff --git a/liveagent_api/models/phone_number.py b/liveagent_api/models/phone_number.py index b212aff..12f0374 100644 --- a/liveagent_api/models/phone_number.py +++ b/liveagent_api/models/phone_number.py @@ -40,6 +40,7 @@ def __init__(self): 'id': 'str', 'type': 'str', 'dial_out_prefix': 'int', + 'record_call': 'bool', 'number': 'str', 'name': 'str', 'departmentid': 'str', @@ -58,6 +59,7 @@ def __init__(self): 'id': 'id', 'type': 'type', 'dial_out_prefix': 'dial_out_prefix', + 'record_call': 'record_call', 'number': 'number', 'name': 'name', 'departmentid': 'departmentid', @@ -75,6 +77,7 @@ def __init__(self): self._id = None self._type = None self._dial_out_prefix = None + self._record_call = None self._number = None self._name = None self._departmentid = None @@ -160,6 +163,28 @@ def dial_out_prefix(self, dial_out_prefix): """ self._dial_out_prefix = dial_out_prefix + @property + def record_call(self): + """ + Gets the record_call of this PhoneNumber. + + + :return: The record_call of this PhoneNumber. + :rtype: bool + """ + return self._record_call + + @record_call.setter + def record_call(self, record_call): + """ + Sets the record_call of this PhoneNumber. + + + :param record_call: The record_call of this PhoneNumber. + :type: bool + """ + self._record_call = record_call + @property def number(self): """ diff --git a/liveagent_api/models/ticket_information.py b/liveagent_api/models/ticket_information.py new file mode 100644 index 0000000..da4735a --- /dev/null +++ b/liveagent_api/models/ticket_information.py @@ -0,0 +1,420 @@ +# coding: utf-8 + +""" +Copyright 2016 SmartBear Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Ref: https://github.com/swagger-api/swagger-codegen +""" + +from pprint import pformat +from six import iteritems + + +class TicketInformation(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + TicketInformation - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'id': 'str', + 'ownerid': 'str', + 'owner_contactid': 'str', + 'departmentid': 'str', + 'agentid': 'str', + 'status': 'str', + 'tags': 'str', + 'code': 'str', + 'channel_type': 'str', + 'date_created': 'str', + 'public_access_urlcode': 'str', + 'subject': 'str', + 'custom_fields': 'list[CustomFields]' + } + + self.attribute_map = { + 'id': 'id', + 'ownerid': 'ownerid', + 'owner_contactid': 'owner_contactid', + 'departmentid': 'departmentid', + 'agentid': 'agentid', + 'status': 'status', + 'tags': 'tags', + 'code': 'code', + 'channel_type': 'channel_type', + 'date_created': 'date_created', + 'public_access_urlcode': 'public_access_urlcode', + 'subject': 'subject', + 'custom_fields': 'custom_fields' + } + + self._id = None + self._ownerid = None + self._owner_contactid = None + self._departmentid = None + self._agentid = None + self._status = None + self._tags = None + self._code = None + self._channel_type = None + self._date_created = None + self._public_access_urlcode = None + self._subject = None + self._custom_fields = None + + @property + def id(self): + """ + Gets the id of this TicketInformation. + + + :return: The id of this TicketInformation. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this TicketInformation. + + + :param id: The id of this TicketInformation. + :type: str + """ + self._id = id + + @property + def ownerid(self): + """ + Gets the ownerid of this TicketInformation. + + + :return: The ownerid of this TicketInformation. + :rtype: str + """ + return self._ownerid + + @ownerid.setter + def ownerid(self, ownerid): + """ + Sets the ownerid of this TicketInformation. + + + :param ownerid: The ownerid of this TicketInformation. + :type: str + """ + self._ownerid = ownerid + + @property + def owner_contactid(self): + """ + Gets the owner_contactid of this TicketInformation. + + + :return: The owner_contactid of this TicketInformation. + :rtype: str + """ + return self._owner_contactid + + @owner_contactid.setter + def owner_contactid(self, owner_contactid): + """ + Sets the owner_contactid of this TicketInformation. + + + :param owner_contactid: The owner_contactid of this TicketInformation. + :type: str + """ + self._owner_contactid = owner_contactid + + @property + def departmentid(self): + """ + Gets the departmentid of this TicketInformation. + + + :return: The departmentid of this TicketInformation. + :rtype: str + """ + return self._departmentid + + @departmentid.setter + def departmentid(self, departmentid): + """ + Sets the departmentid of this TicketInformation. + + + :param departmentid: The departmentid of this TicketInformation. + :type: str + """ + self._departmentid = departmentid + + @property + def agentid(self): + """ + Gets the agentid of this TicketInformation. + + + :return: The agentid of this TicketInformation. + :rtype: str + """ + return self._agentid + + @agentid.setter + def agentid(self, agentid): + """ + Sets the agentid of this TicketInformation. + + + :param agentid: The agentid of this TicketInformation. + :type: str + """ + self._agentid = agentid + + @property + def status(self): + """ + Gets the status of this TicketInformation. + + + :return: The status of this TicketInformation. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this TicketInformation. + + + :param status: The status of this TicketInformation. + :type: str + """ + self._status = status + + @property + def tags(self): + """ + Gets the tags of this TicketInformation. + + + :return: The tags of this TicketInformation. + :rtype: str + """ + return self._tags + + @tags.setter + def tags(self, tags): + """ + Sets the tags of this TicketInformation. + + + :param tags: The tags of this TicketInformation. + :type: str + """ + self._tags = tags + + @property + def code(self): + """ + Gets the code of this TicketInformation. + + + :return: The code of this TicketInformation. + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """ + Sets the code of this TicketInformation. + + + :param code: The code of this TicketInformation. + :type: str + """ + self._code = code + + @property + def channel_type(self): + """ + Gets the channel_type of this TicketInformation. + + + :return: The channel_type of this TicketInformation. + :rtype: str + """ + return self._channel_type + + @channel_type.setter + def channel_type(self, channel_type): + """ + Sets the channel_type of this TicketInformation. + + + :param channel_type: The channel_type of this TicketInformation. + :type: str + """ + self._channel_type = channel_type + + @property + def date_created(self): + """ + Gets the date_created of this TicketInformation. + + + :return: The date_created of this TicketInformation. + :rtype: str + """ + return self._date_created + + @date_created.setter + def date_created(self, date_created): + """ + Sets the date_created of this TicketInformation. + + + :param date_created: The date_created of this TicketInformation. + :type: str + """ + self._date_created = date_created + + @property + def public_access_urlcode(self): + """ + Gets the public_access_urlcode of this TicketInformation. + + + :return: The public_access_urlcode of this TicketInformation. + :rtype: str + """ + return self._public_access_urlcode + + @public_access_urlcode.setter + def public_access_urlcode(self, public_access_urlcode): + """ + Sets the public_access_urlcode of this TicketInformation. + + + :param public_access_urlcode: The public_access_urlcode of this TicketInformation. + :type: str + """ + self._public_access_urlcode = public_access_urlcode + + @property + def subject(self): + """ + Gets the subject of this TicketInformation. + + + :return: The subject of this TicketInformation. + :rtype: str + """ + return self._subject + + @subject.setter + def subject(self, subject): + """ + Sets the subject of this TicketInformation. + + + :param subject: The subject of this TicketInformation. + :type: str + """ + self._subject = subject + + @property + def custom_fields(self): + """ + Gets the custom_fields of this TicketInformation. + + + :return: The custom_fields of this TicketInformation. + :rtype: list[CustomFields] + """ + return self._custom_fields + + @custom_fields.setter + def custom_fields(self, custom_fields): + """ + Sets the custom_fields of this TicketInformation. + + + :param custom_fields: The custom_fields of this TicketInformation. + :type: list[CustomFields] + """ + self._custom_fields = custom_fields + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other + diff --git a/liveagent_api/models/ticket_list_item.py b/liveagent_api/models/ticket_list_item.py new file mode 100644 index 0000000..97290b3 --- /dev/null +++ b/liveagent_api/models/ticket_list_item.py @@ -0,0 +1,494 @@ +# coding: utf-8 + +""" +Copyright 2016 SmartBear Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Ref: https://github.com/swagger-api/swagger-codegen +""" + +from pprint import pformat +from six import iteritems + + +class TicketListItem(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + TicketListItem - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'useridentifier': 'str', + 'subject': 'str', + 'departmentid': 'str', + 'recipient': 'str', + 'message': 'str', + 'recipient_name': 'str', + 'carbon_copy': 'str', + 'status': 'str', + 'mail_message_id': 'str', + 'do_not_send_mail': 'str', + 'use_template': 'str', + 'is_html_message': 'str', + 'custom_fields': 'list[CustomFields]', + 'tags': 'list[str]', + 'attachments': 'str' + } + + self.attribute_map = { + 'useridentifier': 'useridentifier', + 'subject': 'subject', + 'departmentid': 'departmentid', + 'recipient': 'recipient', + 'message': 'message', + 'recipient_name': 'recipient_name', + 'carbon_copy': 'carbon_copy', + 'status': 'status', + 'mail_message_id': 'mail_message_id', + 'do_not_send_mail': 'do_not_send_mail', + 'use_template': 'use_template', + 'is_html_message': 'is_html_message', + 'custom_fields': 'custom_fields', + 'tags': 'tags', + 'attachments': 'attachments' + } + + self._useridentifier = None + self._subject = None + self._departmentid = None + self._recipient = None + self._message = None + self._recipient_name = None + self._carbon_copy = None + self._status = 'N' + self._mail_message_id = None + self._do_not_send_mail = 'N' + self._use_template = 'Y' + self._is_html_message = 'N' + self._custom_fields = None + self._tags = None + self._attachments = None + + @property + def useridentifier(self): + """ + Gets the useridentifier of this TicketListItem. + + + :return: The useridentifier of this TicketListItem. + :rtype: str + """ + return self._useridentifier + + @useridentifier.setter + def useridentifier(self, useridentifier): + """ + Sets the useridentifier of this TicketListItem. + + + :param useridentifier: The useridentifier of this TicketListItem. + :type: str + """ + self._useridentifier = useridentifier + + @property + def subject(self): + """ + Gets the subject of this TicketListItem. + + + :return: The subject of this TicketListItem. + :rtype: str + """ + return self._subject + + @subject.setter + def subject(self, subject): + """ + Sets the subject of this TicketListItem. + + + :param subject: The subject of this TicketListItem. + :type: str + """ + self._subject = subject + + @property + def departmentid(self): + """ + Gets the departmentid of this TicketListItem. + + + :return: The departmentid of this TicketListItem. + :rtype: str + """ + return self._departmentid + + @departmentid.setter + def departmentid(self, departmentid): + """ + Sets the departmentid of this TicketListItem. + + + :param departmentid: The departmentid of this TicketListItem. + :type: str + """ + self._departmentid = departmentid + + @property + def recipient(self): + """ + Gets the recipient of this TicketListItem. + + + :return: The recipient of this TicketListItem. + :rtype: str + """ + return self._recipient + + @recipient.setter + def recipient(self, recipient): + """ + Sets the recipient of this TicketListItem. + + + :param recipient: The recipient of this TicketListItem. + :type: str + """ + self._recipient = recipient + + @property + def message(self): + """ + Gets the message of this TicketListItem. + + + :return: The message of this TicketListItem. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this TicketListItem. + + + :param message: The message of this TicketListItem. + :type: str + """ + self._message = message + + @property + def recipient_name(self): + """ + Gets the recipient_name of this TicketListItem. + + + :return: The recipient_name of this TicketListItem. + :rtype: str + """ + return self._recipient_name + + @recipient_name.setter + def recipient_name(self, recipient_name): + """ + Sets the recipient_name of this TicketListItem. + + + :param recipient_name: The recipient_name of this TicketListItem. + :type: str + """ + self._recipient_name = recipient_name + + @property + def carbon_copy(self): + """ + Gets the carbon_copy of this TicketListItem. + + + :return: The carbon_copy of this TicketListItem. + :rtype: str + """ + return self._carbon_copy + + @carbon_copy.setter + def carbon_copy(self, carbon_copy): + """ + Sets the carbon_copy of this TicketListItem. + + + :param carbon_copy: The carbon_copy of this TicketListItem. + :type: str + """ + self._carbon_copy = carbon_copy + + @property + def status(self): + """ + Gets the status of this TicketListItem. +
I - init
N - new
T - chatting
P - calling
R - resolved
X - deleted
B - spam
A - answered
C - open
W - postponed + + :return: The status of this TicketListItem. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this TicketListItem. +
I - init
N - new
T - chatting
P - calling
R - resolved
X - deleted
B - spam
A - answered
C - open
W - postponed + + :param status: The status of this TicketListItem. + :type: str + """ + allowed_values = ["I", "N", "T", "P", "R", "X", "B", "A", "C", "W"] + if status not in allowed_values: + raise ValueError( + "Invalid value for `status`, must be one of {0}" + .format(allowed_values) + ) + self._status = status + + @property + def mail_message_id(self): + """ + Gets the mail_message_id of this TicketListItem. + + + :return: The mail_message_id of this TicketListItem. + :rtype: str + """ + return self._mail_message_id + + @mail_message_id.setter + def mail_message_id(self, mail_message_id): + """ + Sets the mail_message_id of this TicketListItem. + + + :param mail_message_id: The mail_message_id of this TicketListItem. + :type: str + """ + self._mail_message_id = mail_message_id + + @property + def do_not_send_mail(self): + """ + Gets the do_not_send_mail of this TicketListItem. + Y - yes, N - no + + :return: The do_not_send_mail of this TicketListItem. + :rtype: str + """ + return self._do_not_send_mail + + @do_not_send_mail.setter + def do_not_send_mail(self, do_not_send_mail): + """ + Sets the do_not_send_mail of this TicketListItem. + Y - yes, N - no + + :param do_not_send_mail: The do_not_send_mail of this TicketListItem. + :type: str + """ + allowed_values = ["Y", "N"] + if do_not_send_mail not in allowed_values: + raise ValueError( + "Invalid value for `do_not_send_mail`, must be one of {0}" + .format(allowed_values) + ) + self._do_not_send_mail = do_not_send_mail + + @property + def use_template(self): + """ + Gets the use_template of this TicketListItem. + Y - yes, N - no + + :return: The use_template of this TicketListItem. + :rtype: str + """ + return self._use_template + + @use_template.setter + def use_template(self, use_template): + """ + Sets the use_template of this TicketListItem. + Y - yes, N - no + + :param use_template: The use_template of this TicketListItem. + :type: str + """ + allowed_values = ["Y", "N"] + if use_template not in allowed_values: + raise ValueError( + "Invalid value for `use_template`, must be one of {0}" + .format(allowed_values) + ) + self._use_template = use_template + + @property + def is_html_message(self): + """ + Gets the is_html_message of this TicketListItem. + Y - yes, N - no + + :return: The is_html_message of this TicketListItem. + :rtype: str + """ + return self._is_html_message + + @is_html_message.setter + def is_html_message(self, is_html_message): + """ + Sets the is_html_message of this TicketListItem. + Y - yes, N - no + + :param is_html_message: The is_html_message of this TicketListItem. + :type: str + """ + allowed_values = ["Y", "N"] + if is_html_message not in allowed_values: + raise ValueError( + "Invalid value for `is_html_message`, must be one of {0}" + .format(allowed_values) + ) + self._is_html_message = is_html_message + + @property + def custom_fields(self): + """ + Gets the custom_fields of this TicketListItem. + + + :return: The custom_fields of this TicketListItem. + :rtype: list[CustomFields] + """ + return self._custom_fields + + @custom_fields.setter + def custom_fields(self, custom_fields): + """ + Sets the custom_fields of this TicketListItem. + + + :param custom_fields: The custom_fields of this TicketListItem. + :type: list[CustomFields] + """ + self._custom_fields = custom_fields + + @property + def tags(self): + """ + Gets the tags of this TicketListItem. + array of tags id + + :return: The tags of this TicketListItem. + :rtype: list[str] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """ + Sets the tags of this TicketListItem. + array of tags id + + :param tags: The tags of this TicketListItem. + :type: list[str] + """ + self._tags = tags + + @property + def attachments(self): + """ + Gets the attachments of this TicketListItem. + + + :return: The attachments of this TicketListItem. + :rtype: str + """ + return self._attachments + + @attachments.setter + def attachments(self, attachments): + """ + Sets the attachments of this TicketListItem. + + + :param attachments: The attachments of this TicketListItem. + :type: str + """ + self._attachments = attachments + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other + From 95848e8a58a3f658b75a3227caf345f387a3c793 Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Wed, 6 Dec 2017 16:16:50 +0100 Subject: [PATCH 11/12] u --- README.md | 2 +- docs/CallsApi.md | 6 ++-- docs/IvrFetch.md | 4 ++- liveagent_api/apis/calls_api.py | 12 ++----- liveagent_api/models/ivr_fetch.py | 54 +++++++++++++++++++++++++++++-- 5 files changed, 61 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 86da12c..ddf9cd7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-06T15:37:14.622+01:00 +- Build date: 2017-12-06T16:16:50.380+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/docs/CallsApi.md b/docs/CallsApi.md index 58859c4..40ea3a4 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -308,7 +308,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **call_fetch_ivr** -> list[Ivr] call_fetch_ivr(call_id, prefix, fetch) +> list[Ivr] call_fetch_ivr(call_id, fetch) Fetches IVR for the call from external URL @@ -329,12 +329,11 @@ liveagent_api.configuration.api_key['apikey'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = liveagent_api.CallsApi() call_id = 'call_id_example' # str | -prefix = 'prefix_example' # str | In order to avoid name clash, use unique fetch for each prefix fetch = liveagent_api.IvrFetch() # IvrFetch | try: # Fetches IVR for the call from external URL - api_response = api_instance.call_fetch_ivr(call_id, prefix, fetch) + api_response = api_instance.call_fetch_ivr(call_id, fetch) pprint(api_response) except ApiException as e: print "Exception when calling CallsApi->call_fetch_ivr: %s\n" % e @@ -345,7 +344,6 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **call_id** | **str**| | - **prefix** | **str**| In order to avoid name clash, use unique fetch for each prefix | **fetch** | [**IvrFetch**](IvrFetch.md)| | ### Return type diff --git a/docs/IvrFetch.md b/docs/IvrFetch.md index cd8a30f..04d8ba2 100644 --- a/docs/IvrFetch.md +++ b/docs/IvrFetch.md @@ -3,8 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**url** | **str** | | [optional] +**url** | **str** | | +**prefix** | **str** | | [optional] **params** | [**list[IvrFetchParam]**](IvrFetchParam.md) | | [optional] +**ivrs** | **list[str]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/liveagent_api/apis/calls_api.py b/liveagent_api/apis/calls_api.py index 9242718..ac99c24 100644 --- a/liveagent_api/apis/calls_api.py +++ b/liveagent_api/apis/calls_api.py @@ -481,7 +481,7 @@ def call_create(self, call_id, to_number, from_number, **kwargs): callback=params.get('callback')) return response - def call_fetch_ivr(self, call_id, prefix, fetch, **kwargs): + def call_fetch_ivr(self, call_id, fetch, **kwargs): """ Fetches IVR for the call from external URL @@ -492,19 +492,18 @@ def call_fetch_ivr(self, call_id, prefix, fetch, **kwargs): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.call_fetch_ivr(call_id, prefix, fetch, callback=callback_function) + >>> thread = api.call_fetch_ivr(call_id, fetch, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str call_id: (required) - :param str prefix: In order to avoid name clash, use unique fetch for each prefix (required) :param IvrFetch fetch: (required) :return: list[Ivr] If the method is called asynchronously, returns the request thread. """ - all_params = ['call_id', 'prefix', 'fetch'] + all_params = ['call_id', 'fetch'] all_params.append('callback') params = locals() @@ -520,9 +519,6 @@ def call_fetch_ivr(self, call_id, prefix, fetch, **kwargs): # verify the required parameter 'call_id' is set if ('call_id' not in params) or (params['call_id'] is None): raise ValueError("Missing the required parameter `call_id` when calling `call_fetch_ivr`") - # verify the required parameter 'prefix' is set - if ('prefix' not in params) or (params['prefix'] is None): - raise ValueError("Missing the required parameter `prefix` when calling `call_fetch_ivr`") # verify the required parameter 'fetch' is set if ('fetch' not in params) or (params['fetch'] is None): raise ValueError("Missing the required parameter `fetch` when calling `call_fetch_ivr`") @@ -533,8 +529,6 @@ def call_fetch_ivr(self, call_id, prefix, fetch, **kwargs): path_params['callId'] = params['call_id'] query_params = {} - if 'prefix' in params: - query_params['prefix'] = params['prefix'] header_params = {} diff --git a/liveagent_api/models/ivr_fetch.py b/liveagent_api/models/ivr_fetch.py index 1b67902..e102fd1 100644 --- a/liveagent_api/models/ivr_fetch.py +++ b/liveagent_api/models/ivr_fetch.py @@ -38,16 +38,22 @@ def __init__(self): """ self.swagger_types = { 'url': 'str', - 'params': 'list[IvrFetchParam]' + 'prefix': 'str', + 'params': 'list[IvrFetchParam]', + 'ivrs': 'list[str]' } self.attribute_map = { 'url': 'url', - 'params': 'params' + 'prefix': 'prefix', + 'params': 'params', + 'ivrs': 'ivrs' } self._url = None + self._prefix = None self._params = None + self._ivrs = None @property def url(self): @@ -71,6 +77,28 @@ def url(self, url): """ self._url = url + @property + def prefix(self): + """ + Gets the prefix of this IvrFetch. + + + :return: The prefix of this IvrFetch. + :rtype: str + """ + return self._prefix + + @prefix.setter + def prefix(self, prefix): + """ + Sets the prefix of this IvrFetch. + + + :param prefix: The prefix of this IvrFetch. + :type: str + """ + self._prefix = prefix + @property def params(self): """ @@ -93,6 +121,28 @@ def params(self, params): """ self._params = params + @property + def ivrs(self): + """ + Gets the ivrs of this IvrFetch. + + + :return: The ivrs of this IvrFetch. + :rtype: list[str] + """ + return self._ivrs + + @ivrs.setter + def ivrs(self, ivrs): + """ + Sets the ivrs of this IvrFetch. + + + :param ivrs: The ivrs of this IvrFetch. + :type: list[str] + """ + self._ivrs = ivrs + def to_dict(self): """ Returns the model properties as a dict From 447626c2598cf4b38599d0a265e8d3d640bcaf0e Mon Sep 17 00:00:00 2001 From: Michal Bebjak Date: Thu, 7 Dec 2017 11:31:07 +0100 Subject: [PATCH 12/12] update --- README.md | 2 +- docs/IvrFetch.md | 1 + liveagent_api/models/ivr_fetch.py | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ddf9cd7..c50ffb6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 3.0.0 - Package version: 1.0.0 -- Build date: 2017-12-06T16:16:50.380+01:00 +- Build date: 2017-12-07T11:31:06.863+01:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/docs/IvrFetch.md b/docs/IvrFetch.md index 04d8ba2..6730a63 100644 --- a/docs/IvrFetch.md +++ b/docs/IvrFetch.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **str** | | **prefix** | **str** | | [optional] +**on_error** | **str** | | [optional] **params** | [**list[IvrFetchParam]**](IvrFetchParam.md) | | [optional] **ivrs** | **list[str]** | | [optional] diff --git a/liveagent_api/models/ivr_fetch.py b/liveagent_api/models/ivr_fetch.py index e102fd1..f05f30d 100644 --- a/liveagent_api/models/ivr_fetch.py +++ b/liveagent_api/models/ivr_fetch.py @@ -39,6 +39,7 @@ def __init__(self): self.swagger_types = { 'url': 'str', 'prefix': 'str', + 'on_error': 'str', 'params': 'list[IvrFetchParam]', 'ivrs': 'list[str]' } @@ -46,12 +47,14 @@ def __init__(self): self.attribute_map = { 'url': 'url', 'prefix': 'prefix', + 'on_error': 'onError', 'params': 'params', 'ivrs': 'ivrs' } self._url = None self._prefix = None + self._on_error = None self._params = None self._ivrs = None @@ -99,6 +102,28 @@ def prefix(self, prefix): """ self._prefix = prefix + @property + def on_error(self): + """ + Gets the on_error of this IvrFetch. + + + :return: The on_error of this IvrFetch. + :rtype: str + """ + return self._on_error + + @on_error.setter + def on_error(self, on_error): + """ + Sets the on_error of this IvrFetch. + + + :param on_error: The on_error of this IvrFetch. + :type: str + """ + self._on_error = on_error + @property def params(self): """