Skip to content

Commit 25c15fa

Browse files
authored
Merge pull request #677 from watson-developer-cloud/generator-update
Patch for Visual Recognition-v4 & Discovery-v2
2 parents a6fff30 + 3ea83df commit 25c15fa

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

Scripts/Services/Discovery/V1/DiscoveryService.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4653,11 +4653,11 @@ public bool GetMetricsQuery(Callback<MetricResponse> callback, DateTime? startTi
46534653
}
46544654
if (startTime != null)
46554655
{
4656-
req.Parameters["start_time"] = startTime;
4656+
req.Parameters["start_time"] = startTime.Value.ToString("yyyy-MM-ddTHH:mm:ssZ");
46574657
}
46584658
if (endTime != null)
46594659
{
4660-
req.Parameters["end_time"] = endTime;
4660+
req.Parameters["end_time"] = endTime.Value.ToString("yyyy-MM-ddTHH:mm:ssZ");
46614661
}
46624662
if (!string.IsNullOrEmpty(resultType))
46634663
{
@@ -4743,11 +4743,11 @@ public bool GetMetricsQueryEvent(Callback<MetricResponse> callback, DateTime? st
47434743
}
47444744
if (startTime != null)
47454745
{
4746-
req.Parameters["start_time"] = startTime;
4746+
req.Parameters["start_time"] = startTime.Value.ToString("yyyy-MM-ddTHH:mm:ssZ");
47474747
}
47484748
if (endTime != null)
47494749
{
4750-
req.Parameters["end_time"] = endTime;
4750+
req.Parameters["end_time"] = endTime.Value.ToString("yyyy-MM-ddTHH:mm:ssZ");
47514751
}
47524752
if (!string.IsNullOrEmpty(resultType))
47534753
{
@@ -4832,11 +4832,11 @@ public bool GetMetricsQueryNoResults(Callback<MetricResponse> callback, DateTime
48324832
}
48334833
if (startTime != null)
48344834
{
4835-
req.Parameters["start_time"] = startTime;
4835+
req.Parameters["start_time"] = startTime.Value.ToString("yyyy-MM-ddTHH:mm:ssZ");
48364836
}
48374837
if (endTime != null)
48384838
{
4839-
req.Parameters["end_time"] = endTime;
4839+
req.Parameters["end_time"] = endTime.Value.ToString("yyyy-MM-ddTHH:mm:ssZ");
48404840
}
48414841
if (!string.IsNullOrEmpty(resultType))
48424842
{
@@ -4922,11 +4922,11 @@ public bool GetMetricsEventRate(Callback<MetricResponse> callback, DateTime? sta
49224922
}
49234923
if (startTime != null)
49244924
{
4925-
req.Parameters["start_time"] = startTime;
4925+
req.Parameters["start_time"] = startTime.Value.ToString("yyyy-MM-ddTHH:mm:ssZ");
49264926
}
49274927
if (endTime != null)
49284928
{
4929-
req.Parameters["end_time"] = endTime;
4929+
req.Parameters["end_time"] = endTime.Value.ToString("yyyy-MM-ddTHH:mm:ssZ");
49304930
}
49314931
if (!string.IsNullOrEmpty(resultType))
49324932
{

Scripts/Services/Discovery/V2/DiscoveryService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,6 +2202,11 @@ public bool CreateEnrichment(Callback<Enrichment> callback, string projectId, Cr
22022202
}
22032203

22042204
req.Forms = new Dictionary<string, RESTConnector.Form>();
2205+
if (enrichment != null)
2206+
{
2207+
byte[] byteArray = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(enrichment));
2208+
req.Forms["enrichment"] = new RESTConnector.Form(new System.IO.MemoryStream(byteArray), "" ,"application/json");
2209+
}
22052210
if (file != null)
22062211
{
22072212
req.Forms["file"] = new RESTConnector.Form(file, "filename", "application/octet-stream");

Scripts/Services/TextToSpeech/V1/TextToSpeechService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
using Newtonsoft.Json.Linq;
3131
using System;
3232
using UnityEngine.Networking;
33-
using System.IO;
3433

3534
namespace IBM.Watson.TextToSpeech.V1
3635
{
@@ -1640,7 +1639,7 @@ public bool AddCustomPrompt(Callback<Prompt> callback, string customizationId, s
16401639
if (metadata != null)
16411640
{
16421641
byte[] byteArray = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(metadata));
1643-
req.Forms["metadata"] = new RESTConnector.Form(new MemoryStream(byteArray), "" ,"application/json");
1642+
req.Forms["metadata"] = new RESTConnector.Form(new System.IO.MemoryStream(byteArray), "" ,"application/json");
16441643
}
16451644
if (file != null)
16461645
{

Scripts/Services/VisualRecognition/V4/VisualRecognitionService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,11 +1682,11 @@ public bool GetTrainingUsage(Callback<TrainingEvents> callback, DateTime? startT
16821682
}
16831683
if (startTime != null)
16841684
{
1685-
req.Parameters["start_time"] = startTime;
1685+
req.Parameters["start_time"] = startTime.Value.ToString("yyyy-MM-dd");
16861686
}
16871687
if (endTime != null)
16881688
{
1689-
req.Parameters["end_time"] = endTime;
1689+
req.Parameters["end_time"] = endTime.Value.ToString("yyyy-MM-dd");
16901690
}
16911691

16921692
req.OnResponse = OnGetTrainingUsageResponse;

0 commit comments

Comments
 (0)