Skip to content

Commit 735668f

Browse files
committed
refactor: keep vis rec handwritten changes
1 parent 5de83ec commit 735668f

37 files changed

+47
-50
lines changed

Examples/GenericSerialization.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void Start()
3434

3535
MessageResponse messageResponse = JsonConvert.DeserializeObject<MessageResponse>(responseJson);
3636

37-
var name = messageResponse.Context.Skills.Get("main skill").UserDefined["name"].ToString();
37+
var name = messageResponse.Context.Skills["main skill"].UserDefined["name"].ToString();
3838
Log.Debug("GenericSerialization", "name: {0}", name);
3939

4040
}

Scripts/Services/Assistant/V1/AssistantService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Assistant/V1/Model/Context.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Assistant/V1/Model/DialogNodeOutputGeneric.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Assistant/V1/Model/RuntimeResponseGeneric.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Assistant/V2/AssistantService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Assistant/V2/Model/MessageContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2018, 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.

Scripts/Services/Assistant/V2/Model/RuntimeResponseGeneric.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/CompareComply/V1/CompareComplyService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V1/DiscoveryService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V1/Model/NluEnrichmentFeatures.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/DiscoveryService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/Model/QueryAggregation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/Model/QueryFilterAggregation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/Model/QueryHistogramAggregation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/Model/QueryLargePassages.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/Model/QueryLargeSuggestedRefinements.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/Model/QueryLargeTableResults.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/Model/QueryNestedAggregation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/Model/QueryTermAggregation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/Model/QueryTimesliceAggregation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/Discovery/V2/Model/QueryTopHitsAggregation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/LanguageTranslator/V3/LanguageTranslatorService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/NaturalLanguageClassifier/V1/NaturalLanguageClassifierService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/NaturalLanguageUnderstanding/V1/Model/AnalysisResults.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/NaturalLanguageUnderstanding/V1/Model/Features.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/NaturalLanguageUnderstanding/V1/Model/FeaturesResultsMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/NaturalLanguageUnderstanding/V1/NaturalLanguageUnderstandingService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/PersonalityInsights/V3/PersonalityInsightsService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/SpeechToText/V1/SpeechToTextService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/TextToSpeech/V1/TextToSpeechService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/ToneAnalyzer/V3/ToneAnalyzerService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/VisualRecognition/V3/VisualRecognitionService.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.
@@ -193,19 +193,13 @@ public bool Classify(Callback<ClassifiedImages> callback, System.IO.MemoryStream
193193
{
194194
req.Forms["threshold"] = new RESTConnector.Form(threshold.ToString());
195195
}
196-
if (owners != null)
196+
if (owners != null && owners.Count > 0)
197197
{
198-
foreach (string item in owners)
199-
{
200-
req.Forms["owners"] = new RESTConnector.Form(item);
201-
}
198+
req.Forms["owners"] = new RESTConnector.Form(string.Join(", ", owners.ToArray()));
202199
}
203-
if (classifierIds != null)
200+
if (classifierIds != null && classifierIds.Count > 0)
204201
{
205-
foreach (string item in classifierIds)
206-
{
207-
req.Forms["classifier_ids"] = new RESTConnector.Form(item);
208-
}
202+
req.Forms["classifier_ids"] = new RESTConnector.Form(string.Join(", ", classifierIds.ToArray()));
209203
}
210204
if (!string.IsNullOrEmpty(Version))
211205
{

Scripts/Services/VisualRecognition/V4/Model/Collection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/VisualRecognition/V4/Model/ObjectDetail.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/VisualRecognition/V4/Model/ObjectDetailLocation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.

Scripts/Services/VisualRecognition/V4/VisualRecognitionService.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2020.
2+
* (C) Copyright IBM Corp. 2019, 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.
@@ -150,11 +150,14 @@ public bool Analyze(Callback<AnalyzeResponse> callback, List<string> collectionI
150150
throw new ArgumentNullException("`callback` is required for `Analyze`");
151151
if (string.IsNullOrEmpty(Version))
152152
throw new ArgumentNullException("`Version` is required");
153-
if (string.IsNullOrEmpty(collectionIds))
153+
if (collectionIds == null || collectionIds.Count == 0)
154+
{
154155
throw new ArgumentNullException("`collectionIds` is required for `Analyze`");
155-
if (string.IsNullOrEmpty(features))
156+
}
157+
if (features == null || features.Count == 0)
158+
{
156159
throw new ArgumentNullException("`features` is required for `Analyze`");
157-
160+
}
158161
RequestObject<AnalyzeResponse> req = new RequestObject<AnalyzeResponse>
159162
{
160163
Callback = callback,

0 commit comments

Comments
 (0)