Better deprecation message
@@ -20,6 +20,7 @@ from .utils import deprecated
from .watson_service import WatsonService
import os
import json
+DEPRECATION_MESSAGE = "Since Document Conversion Service was retired in October 2017, we have continued to improve document conversion capabilities within Watson Discovery. If you are a Document Conversion user, get started with Discovery today. Refer to the migration guide: https://console.bluemix.net/docs/services/discovery/migrate-dcs-rr.html"
class DocumentConversionV1(WatsonService):
DEFAULT_URL = 'https://gateway.watsonplatform.net/document-conversion/api'
@@ -28,12 +29,12 @@ class DocumentConversionV1(WatsonService):
NORMALIZED_TEXT = 'normalized_text'
latest_version = '2016-02-10'
- @deprecated("To continue using document conversion capabilities, please use Watson Discovery.")
+ @deprecated(DEPRECATION_MESSAGE)
def __init__(self, version, url=DEFAULT_URL, **kwargs):
WatsonService.__init__(self, 'document_conversion', url, **kwargs)
self.version = version
- @deprecated("To continue using document conversion capabilities, please use Watson Discovery.")
+ @deprecated(DEPRECATION_MESSAGE)
def convert_document(self, document, config, media_type=None):
params = {'version': self.version}
filename = os.path.basename(document.name)
@@ -47,7 +48,7 @@ class DocumentConversionV1(WatsonService):
return self.request(method='POST', url='/v1/convert_document',
files=files, params=params,
accept_json=accept_json)
- @deprecated("To continue using document conversion capabilities, please use Watson Discovery.")
+ @deprecated(DEPRECATION_MESSAGE)
def index_document(self, config, document=None, metadata=None,
media_type=None):
if document is None and metadata is None:
