Skip to content

Commit d99b69a

Browse files
committed
feat(VisualRecognition): Add deprecation warning and change starte and endtimes to DateTime
BREAKING CHANGE: change startTime and encTime to DateTime for GetTrainingUsave for VisualRecognitionV4
1 parent 235aef2 commit d99b69a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Scripts/Services/VisualRecognition/V3/VisualRecognitionService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public VisualRecognitionService(string versionDate) : this(versionDate, ConfigBa
7070
/// <param name="authenticator">The service authenticator.</param>
7171
public VisualRecognitionService(string versionDate, Authenticator authenticator) : base(versionDate, authenticator, serviceId)
7272
{
73+
Log.Warning("Visual Recognition Deprecation Warning:", "On 1 December 2021, Visual Recognition will no longer be available. For more information, see https://github.com/watson-developer-cloud/unity-sdk/tree/master#visual-recognition-deprecation.");
7374
Authenticator = authenticator;
7475

7576
if (string.IsNullOrEmpty(versionDate))

Scripts/Services/VisualRecognition/V4/VisualRecognitionService.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2020.
2+
* (C) Copyright IBM Corp. 2020.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,6 +72,7 @@ public VisualRecognitionService(string versionDate) : this(versionDate, ConfigBa
7272
/// <param name="authenticator">The service authenticator.</param>
7373
public VisualRecognitionService(string versionDate, Authenticator authenticator) : base(versionDate, authenticator, serviceId)
7474
{
75+
Log.Warning("VisualRecognition Deprecation Warning:", "On 1 December 2021, Visual Recognition will no longer be available. For more information, see https://github.com/watson-developer-cloud/unity-sdk/tree/master#visual-recognition-deprecation.");
7576
Authenticator = authenticator;
7677

7778
if (string.IsNullOrEmpty(versionDate))
@@ -1501,7 +1502,7 @@ private void OnAddImageTrainingDataResponse(RESTConnector.Request req, RESTConne
15011502
/// All events for the day are included. If empty or not specified, the current day is used. Specify the same
15021503
/// value as `start_time` to request events for a single day. (optional)</param>
15031504
/// <returns><see cref="TrainingEvents" />TrainingEvents</returns>
1504-
public bool GetTrainingUsage(Callback<TrainingEvents> callback, string startTime = null, string endTime = null)
1505+
public bool GetTrainingUsage(Callback<TrainingEvents> callback, DateTime? startTime = null, DateTime? endTime = null)
15051506
{
15061507
if (callback == null)
15071508
throw new ArgumentNullException("`callback` is required for `GetTrainingUsage`");
@@ -1526,11 +1527,11 @@ public bool GetTrainingUsage(Callback<TrainingEvents> callback, string startTime
15261527
}
15271528

15281529
req.Parameters["version"] = VersionDate;
1529-
if (!string.IsNullOrEmpty(startTime))
1530+
if (startTime != null)
15301531
{
15311532
req.Parameters["start_time"] = startTime;
15321533
}
1533-
if (!string.IsNullOrEmpty(endTime))
1534+
if (endTime != null)
15341535
{
15351536
req.Parameters["end_time"] = endTime;
15361537
}

0 commit comments

Comments
 (0)