Skip to content

Commit 3b347c8

Browse files
committed
chore(Discovery V1): Regenerate to make prefix required
1 parent 9d49993 commit 3b347c8

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/IBM.Watson.Discovery.v1/DiscoveryService.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2815,13 +2815,13 @@ public DetailedResponse<QueryNoticesResponse> FederatedQueryNotices(string envir
28152815
/// </summary>
28162816
/// <param name="environmentId">The ID of the environment.</param>
28172817
/// <param name="collectionId">The ID of the collection.</param>
2818+
/// <param name="prefix">The prefix to use for autocompletion. For example, the prefix `Ho` could autocomplete
2819+
/// to `Hot`, `Housing`, or `How do I upgrade`. Possible completions are.</param>
28182820
/// <param name="field">The field in the result documents that autocompletion suggestions are identified from.
28192821
/// (optional)</param>
2820-
/// <param name="prefix">The prefix to use for autocompletion. For example, the prefix `Ho` could autocomplete
2821-
/// to `Hot`, `Housing`, or `How do I upgrade`. Possible completions are. (optional)</param>
28222822
/// <param name="count">The number of autocompletion suggestions to return. (optional)</param>
28232823
/// <returns><see cref="Completions" />Completions</returns>
2824-
public DetailedResponse<Completions> GetAutocompletion(string environmentId, string collectionId, string field = null, string prefix = null, long? count = null)
2824+
public DetailedResponse<Completions> GetAutocompletion(string environmentId, string collectionId, string prefix, string field = null, long? count = null)
28252825
{
28262826
if (string.IsNullOrEmpty(environmentId))
28272827
{
@@ -2839,6 +2839,10 @@ public DetailedResponse<Completions> GetAutocompletion(string environmentId, str
28392839
{
28402840
collectionId = Uri.EscapeDataString(collectionId);
28412841
}
2842+
if (string.IsNullOrEmpty(prefix))
2843+
{
2844+
throw new ArgumentNullException("`prefix` is required for `GetAutocompletion`");
2845+
}
28422846

28432847
if (string.IsNullOrEmpty(VersionDate))
28442848
{
@@ -2856,14 +2860,14 @@ public DetailedResponse<Completions> GetAutocompletion(string environmentId, str
28562860

28572861
restRequest.WithArgument("version", VersionDate);
28582862
restRequest.WithHeader("Accept", "application/json");
2859-
if (!string.IsNullOrEmpty(field))
2860-
{
2861-
restRequest.WithArgument("field", field);
2862-
}
28632863
if (!string.IsNullOrEmpty(prefix))
28642864
{
28652865
restRequest.WithArgument("prefix", prefix);
28662866
}
2867+
if (!string.IsNullOrEmpty(field))
2868+
{
2869+
restRequest.WithArgument("field", field);
2870+
}
28672871
if (count != null)
28682872
{
28692873
restRequest.WithArgument("count", count);

src/IBM.Watson.Discovery.v1/IDiscoveryService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public partial interface IDiscoveryService
5959
DetailedResponse<QueryNoticesResponse> QueryNotices(string environmentId, string collectionId, string filter = null, string query = null, string naturalLanguageQuery = null, bool? passages = null, string aggregation = null, long? count = null, List<string> _return = null, long? offset = null, List<string> sort = null, bool? highlight = null, List<string> passagesFields = null, long? passagesCount = null, long? passagesCharacters = null, string deduplicateField = null, bool? similar = null, List<string> similarDocumentIds = null, List<string> similarFields = null);
6060
DetailedResponse<QueryResponse> FederatedQuery(string environmentId, string collectionIds, string filter = null, string query = null, string naturalLanguageQuery = null, bool? passages = null, string aggregation = null, long? count = null, string _return = null, long? offset = null, string sort = null, bool? highlight = null, string passagesFields = null, long? passagesCount = null, long? passagesCharacters = null, bool? deduplicate = null, string deduplicateField = null, bool? similar = null, string similarDocumentIds = null, string similarFields = null, string bias = null, bool? xWatsonLoggingOptOut = null);
6161
DetailedResponse<QueryNoticesResponse> FederatedQueryNotices(string environmentId, List<string> collectionIds, string filter = null, string query = null, string naturalLanguageQuery = null, string aggregation = null, long? count = null, List<string> _return = null, long? offset = null, List<string> sort = null, bool? highlight = null, string deduplicateField = null, bool? similar = null, List<string> similarDocumentIds = null, List<string> similarFields = null);
62-
DetailedResponse<Completions> GetAutocompletion(string environmentId, string collectionId, string field = null, string prefix = null, long? count = null);
62+
DetailedResponse<Completions> GetAutocompletion(string environmentId, string collectionId, string prefix, string field = null, long? count = null);
6363
DetailedResponse<TrainingDataSet> ListTrainingData(string environmentId, string collectionId);
6464
DetailedResponse<TrainingQuery> AddTrainingData(string environmentId, string collectionId, string naturalLanguageQuery = null, string filter = null, List<TrainingExample> examples = null);
6565
DetailedResponse<object> DeleteAllTrainingData(string environmentId, string collectionId);

0 commit comments

Comments
 (0)