Skip to content

Commit b2df19c

Browse files
committed
Add deprecation message to LTv2 constructors
1 parent e98d4fc commit b2df19c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/IBM.WatsonDeveloperCloud.LanguageTranslator.v2/LanguageTranslatorService.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ public partial class LanguageTranslatorService : WatsonService, ILanguageTransla
3434
const string URL = "https://gateway.watsonplatform.net/language-translator/api";
3535
public LanguageTranslatorService() : base(SERVICE_NAME, URL)
3636
{
37+
Console.WriteLine("Language Translator v3 is now available. The v2 Language Translator API will no longer be available after July 31, 2018. To take advantage of the latest service enhancements, migrate to the v3 API. View the [Migrating to Language Translator v3](https://console.bluemix.net/docs/services/language-translator/migrating.html) page for more information.");
3738
if(!string.IsNullOrEmpty(this.Endpoint))
3839
this.Endpoint = URL;
3940
}
4041

4142
public LanguageTranslatorService(string userName, string password) : this()
4243
{
44+
Console.WriteLine("Language Translator v3 is now available. The v2 Language Translator API will no longer be available after July 31, 2018. To take advantage of the latest service enhancements, migrate to the v3 API. View the [Migrating to Language Translator v3](https://console.bluemix.net/docs/services/language-translator/migrating.html) page for more information.");
4345
if (string.IsNullOrEmpty(userName))
4446
throw new ArgumentNullException(nameof(userName));
4547

@@ -51,6 +53,7 @@ public LanguageTranslatorService(string userName, string password) : this()
5153

5254
public LanguageTranslatorService(TokenOptions options) : this()
5355
{
56+
Console.WriteLine("Language Translator v3 is now available. The v2 Language Translator API will no longer be available after July 31, 2018. To take advantage of the latest service enhancements, migrate to the v3 API. View the [Migrating to Language Translator v3](https://console.bluemix.net/docs/services/language-translator/migrating.html) page for more information.");
5457
if (string.IsNullOrEmpty(options.IamApiKey) && string.IsNullOrEmpty(options.IamAccessToken))
5558
throw new ArgumentNullException(nameof(options.IamAccessToken) + ", " + nameof(options.IamApiKey));
5659
if (!string.IsNullOrEmpty(options.ServiceUrl))
@@ -67,6 +70,7 @@ public LanguageTranslatorService(TokenOptions options) : this()
6770

6871
public LanguageTranslatorService(IClient httpClient) : this()
6972
{
73+
Console.WriteLine("Language Translator v3 is now available. The v2 Language Translator API will no longer be available after July 31, 2018. To take advantage of the latest service enhancements, migrate to the v3 API. View the [Migrating to Language Translator v3](https://console.bluemix.net/docs/services/language-translator/migrating.html) page for more information.");
7074
if (httpClient == null)
7175
throw new ArgumentNullException(nameof(httpClient));
7276

0 commit comments

Comments
 (0)