Skip to content

Commit abc28ba

Browse files
committed
feat(DiscoveryV2): add new apis for projects, enrichments and collections
1 parent e484113 commit abc28ba

37 files changed

+2309
-14
lines changed

Scripts/Services/Discovery/V2/DiscoveryService.cs

Lines changed: 1170 additions & 8 deletions
Large diffs are not rendered by default.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2020.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
using System.Collections.Generic;
19+
using Newtonsoft.Json;
20+
using System;
21+
22+
namespace IBM.Watson.Discovery.V2.Model
23+
{
24+
/// <summary>
25+
/// A collection for storing documents.
26+
/// </summary>
27+
public class CollectionDetails
28+
{
29+
/// <summary>
30+
/// The unique identifier of the collection.
31+
/// </summary>
32+
[JsonProperty("collection_id", NullValueHandling = NullValueHandling.Ignore)]
33+
public virtual string CollectionId { get; private set; }
34+
/// <summary>
35+
/// The name of the collection.
36+
/// </summary>
37+
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
38+
public string Name { get; set; }
39+
/// <summary>
40+
/// A description of the collection.
41+
/// </summary>
42+
[JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)]
43+
public string Description { get; set; }
44+
/// <summary>
45+
/// The date that the collection was created.
46+
/// </summary>
47+
[JsonProperty("created", NullValueHandling = NullValueHandling.Ignore)]
48+
public virtual DateTime? Created { get; private set; }
49+
/// <summary>
50+
/// The language of the collection.
51+
/// </summary>
52+
[JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
53+
public string Language { get; set; }
54+
/// <summary>
55+
/// An array of enrichments that are applied to this collection.
56+
/// </summary>
57+
[JsonProperty("enrichments", NullValueHandling = NullValueHandling.Ignore)]
58+
public List<CollectionEnrichment> Enrichments { get; set; }
59+
}
60+
}

Scripts/Services/Discovery/V2/Model/CollectionDetails.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2020.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
using System.Collections.Generic;
19+
using Newtonsoft.Json;
20+
21+
namespace IBM.Watson.Discovery.V2.Model
22+
{
23+
/// <summary>
24+
/// An object describing an Enrichment for a collection.
25+
/// </summary>
26+
public class CollectionEnrichment
27+
{
28+
/// <summary>
29+
/// The unique identifier of this enrichment.
30+
/// </summary>
31+
[JsonProperty("enrichment_id", NullValueHandling = NullValueHandling.Ignore)]
32+
public string EnrichmentId { get; set; }
33+
/// <summary>
34+
/// An array of field names that the enrichment is applied to.
35+
/// </summary>
36+
[JsonProperty("fields", NullValueHandling = NullValueHandling.Ignore)]
37+
public List<string> Fields { get; set; }
38+
}
39+
}

Scripts/Services/Discovery/V2/Model/CollectionEnrichment.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
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.
@@ -21,7 +21,7 @@
2121
namespace IBM.Watson.Discovery.V2.Model
2222
{
2323
/// <summary>
24-
/// A response containing the default component settings.
24+
/// The default component settings for this project.
2525
/// </summary>
2626
public class ComponentSettingsResponse
2727
{
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2020.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
using Newtonsoft.Json;
19+
20+
namespace IBM.Watson.Discovery.V2.Model
21+
{
22+
/// <summary>
23+
/// Information about a specific enrichment.
24+
/// </summary>
25+
public class CreateEnrichment
26+
{
27+
/// <summary>
28+
/// The type of this enrichment.
29+
/// </summary>
30+
public class TypeValue
31+
{
32+
/// <summary>
33+
/// Constant DICTIONARY for dictionary
34+
/// </summary>
35+
public const string DICTIONARY = "dictionary";
36+
/// <summary>
37+
/// Constant REGULAR_EXPRESSION for regular_expression
38+
/// </summary>
39+
public const string REGULAR_EXPRESSION = "regular_expression";
40+
/// <summary>
41+
/// Constant UIMA_ANNOTATOR for uima_annotator
42+
/// </summary>
43+
public const string UIMA_ANNOTATOR = "uima_annotator";
44+
/// <summary>
45+
/// Constant RULE_BASED for rule_based
46+
/// </summary>
47+
public const string RULE_BASED = "rule_based";
48+
/// <summary>
49+
/// Constant WATSON_KNOWLEDGE_STUDIO_MODEL for watson_knowledge_studio_model
50+
/// </summary>
51+
public const string WATSON_KNOWLEDGE_STUDIO_MODEL = "watson_knowledge_studio_model";
52+
53+
}
54+
55+
/// <summary>
56+
/// The type of this enrichment.
57+
/// Constants for possible values can be found using CreateEnrichment.TypeValue
58+
/// </summary>
59+
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
60+
public string Type { get; set; }
61+
/// <summary>
62+
/// The human readable name for this enrichment.
63+
/// </summary>
64+
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
65+
public string Name { get; set; }
66+
/// <summary>
67+
/// The description of this enrichment.
68+
/// </summary>
69+
[JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)]
70+
public string Description { get; set; }
71+
/// <summary>
72+
/// A object containing options for the current enrichment.
73+
/// </summary>
74+
[JsonProperty("options", NullValueHandling = NullValueHandling.Ignore)]
75+
public EnrichmentOptions Options { get; set; }
76+
}
77+
}

Scripts/Services/Discovery/V2/Model/CreateEnrichment.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2020.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
using System.Collections.Generic;
19+
using Newtonsoft.Json;
20+
21+
namespace IBM.Watson.Discovery.V2.Model
22+
{
23+
/// <summary>
24+
/// Default query parameters for this project.
25+
/// </summary>
26+
public class DefaultQueryParams
27+
{
28+
/// <summary>
29+
/// An array of collection identifiers to query. If empty or omitted all collections in the project are queried.
30+
/// </summary>
31+
[JsonProperty("collection_ids", NullValueHandling = NullValueHandling.Ignore)]
32+
public List<string> CollectionIds { get; set; }
33+
/// <summary>
34+
/// Default settings configuration for passage search options.
35+
/// </summary>
36+
[JsonProperty("passages", NullValueHandling = NullValueHandling.Ignore)]
37+
public DefaultQueryParamsPassages Passages { get; set; }
38+
/// <summary>
39+
/// Default project query settings for table results.
40+
/// </summary>
41+
[JsonProperty("table_results", NullValueHandling = NullValueHandling.Ignore)]
42+
public DefaultQueryParamsTableResults TableResults { get; set; }
43+
/// <summary>
44+
/// A string representing the default aggregation query for the project.
45+
/// </summary>
46+
[JsonProperty("aggregation", NullValueHandling = NullValueHandling.Ignore)]
47+
public string Aggregation { get; set; }
48+
/// <summary>
49+
/// Object containing suggested refinement settings.
50+
/// </summary>
51+
[JsonProperty("suggested_refinements", NullValueHandling = NullValueHandling.Ignore)]
52+
public DefaultQueryParamsSuggestedRefinements SuggestedRefinements { get; set; }
53+
/// <summary>
54+
/// When `true`, a spelling suggestions for the query are retuned by default.
55+
/// </summary>
56+
[JsonProperty("spelling_suggestions", NullValueHandling = NullValueHandling.Ignore)]
57+
public bool? SpellingSuggestions { get; set; }
58+
/// <summary>
59+
/// When `true`, a highlights for the query are retuned by default.
60+
/// </summary>
61+
[JsonProperty("highlight", NullValueHandling = NullValueHandling.Ignore)]
62+
public bool? Highlight { get; set; }
63+
/// <summary>
64+
/// The number of document results returned by default.
65+
/// </summary>
66+
[JsonProperty("count", NullValueHandling = NullValueHandling.Ignore)]
67+
public long? Count { get; set; }
68+
/// <summary>
69+
/// A comma separated list of document fields to sort results by default.
70+
/// </summary>
71+
[JsonProperty("sort", NullValueHandling = NullValueHandling.Ignore)]
72+
public string Sort { get; set; }
73+
/// <summary>
74+
/// An array of field names to return in document results if present by default.
75+
/// </summary>
76+
[JsonProperty("return", NullValueHandling = NullValueHandling.Ignore)]
77+
public List<string> _Return { get; set; }
78+
}
79+
}

Scripts/Services/Discovery/V2/Model/DefaultQueryParams.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)