Skip to content

Commit f8e626d

Browse files
committed
feat(DiscoveryV2): add support for discovery v2
1 parent 3f1ebbe commit f8e626d

File tree

115 files changed

+4685
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+4685
-0
lines changed

Scripts/Services/Discovery/V2/DiscoveryService.cs

Lines changed: 1322 additions & 0 deletions
Large diffs are not rendered by default.

Scripts/Services/Discovery/V2/DiscoveryService.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.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
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+
/// A collection for storing documents.
24+
/// </summary>
25+
public class Collection
26+
{
27+
/// <summary>
28+
/// The unique identifier of the collection.
29+
/// </summary>
30+
[JsonProperty("collection_id", NullValueHandling = NullValueHandling.Ignore)]
31+
public virtual string CollectionId { get; private set; }
32+
/// <summary>
33+
/// The name of the collection.
34+
/// </summary>
35+
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
36+
public string Name { get; set; }
37+
}
38+
}

Scripts/Services/Discovery/V2/Model/Collection.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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
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 containing an array of autocompletion suggestions.
25+
/// </summary>
26+
public class Completions
27+
{
28+
/// <summary>
29+
/// Array of autcomplete suggestion based on the provided prefix.
30+
/// </summary>
31+
[JsonProperty("completions", NullValueHandling = NullValueHandling.Ignore)]
32+
public List<string> _Completions { get; set; }
33+
}
34+
}

Scripts/Services/Discovery/V2/Model/Completions.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: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/**
2+
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
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+
/// Display settings for aggregations.
24+
/// </summary>
25+
public class ComponentSettingsAggregation
26+
{
27+
/// <summary>
28+
/// Type of visualization to use when rendering the aggregation.
29+
/// </summary>
30+
public class VisualizationTypeValue
31+
{
32+
/// <summary>
33+
/// Constant AUTO for auto
34+
/// </summary>
35+
public const string AUTO = "auto";
36+
/// <summary>
37+
/// Constant FACET_TABLE for facet_table
38+
/// </summary>
39+
public const string FACET_TABLE = "facet_table";
40+
/// <summary>
41+
/// Constant WORD_CLOUD for word_cloud
42+
/// </summary>
43+
public const string WORD_CLOUD = "word_cloud";
44+
/// <summary>
45+
/// Constant MAP for map
46+
/// </summary>
47+
public const string MAP = "map";
48+
49+
}
50+
51+
/// <summary>
52+
/// Type of visualization to use when rendering the aggregation.
53+
/// Constants for possible values can be found using ComponentSettingsAggregation.VisualizationTypeValue
54+
/// </summary>
55+
[JsonProperty("visualization_type", NullValueHandling = NullValueHandling.Ignore)]
56+
public string VisualizationType { get; set; }
57+
/// <summary>
58+
/// Identifier used to map aggregation settings to aggregation configuration.
59+
/// </summary>
60+
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
61+
public string Name { get; set; }
62+
/// <summary>
63+
/// User-friendly alias for the aggregation.
64+
/// </summary>
65+
[JsonProperty("label", NullValueHandling = NullValueHandling.Ignore)]
66+
public string Label { get; set; }
67+
/// <summary>
68+
/// Whether users is allowed to select more than one of the aggregation terms.
69+
/// </summary>
70+
[JsonProperty("multiple_selections_allowed", NullValueHandling = NullValueHandling.Ignore)]
71+
public bool? MultipleSelectionsAllowed { get; set; }
72+
}
73+
}

Scripts/Services/Discovery/V2/Model/ComponentSettingsAggregation.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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
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+
/// Fields shown in the results section of the UI.
24+
/// </summary>
25+
public class ComponentSettingsFieldsShown
26+
{
27+
/// <summary>
28+
/// Body label.
29+
/// </summary>
30+
[JsonProperty("body", NullValueHandling = NullValueHandling.Ignore)]
31+
public ComponentSettingsFieldsShownBody Body { get; set; }
32+
/// <summary>
33+
/// Title label.
34+
/// </summary>
35+
[JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)]
36+
public ComponentSettingsFieldsShownTitle Title { get; set; }
37+
}
38+
}

Scripts/Services/Discovery/V2/Model/ComponentSettingsFieldsShown.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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
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+
/// Body label.
24+
/// </summary>
25+
public class ComponentSettingsFieldsShownBody
26+
{
27+
/// <summary>
28+
/// Use the whole passage as the body.
29+
/// </summary>
30+
[JsonProperty("use_passage", NullValueHandling = NullValueHandling.Ignore)]
31+
public bool? UsePassage { get; set; }
32+
/// <summary>
33+
/// Use a specific field as the title.
34+
/// </summary>
35+
[JsonProperty("field", NullValueHandling = NullValueHandling.Ignore)]
36+
public string Field { get; set; }
37+
}
38+
}

Scripts/Services/Discovery/V2/Model/ComponentSettingsFieldsShownBody.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: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
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+
/// Title label.
24+
/// </summary>
25+
public class ComponentSettingsFieldsShownTitle
26+
{
27+
/// <summary>
28+
/// Use a specific field as the title.
29+
/// </summary>
30+
[JsonProperty("field", NullValueHandling = NullValueHandling.Ignore)]
31+
public string Field { get; set; }
32+
}
33+
}

Scripts/Services/Discovery/V2/Model/ComponentSettingsFieldsShownTitle.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)