Skip to content

Commit

Permalink
feat(DiscoveryV2): add new apis for projects, enrichments and collect…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
mamoonraja committed Aug 21, 2020
1 parent e484113 commit abc28ba
Show file tree
Hide file tree
Showing 37 changed files with 2,309 additions and 14 deletions.
1,178 changes: 1,170 additions & 8 deletions Scripts/Services/Discovery/V2/DiscoveryService.cs

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions Scripts/Services/Discovery/V2/Model/CollectionDetails.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* (C) Copyright IBM Corp. 2020.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using System.Collections.Generic;
using Newtonsoft.Json;
using System;

namespace IBM.Watson.Discovery.V2.Model
{
/// <summary>
/// A collection for storing documents.
/// </summary>
public class CollectionDetails
{
/// <summary>
/// The unique identifier of the collection.
/// </summary>
[JsonProperty("collection_id", NullValueHandling = NullValueHandling.Ignore)]
public virtual string CollectionId { get; private set; }
/// <summary>
/// The name of the collection.
/// </summary>
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; }
/// <summary>
/// A description of the collection.
/// </summary>
[JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)]
public string Description { get; set; }
/// <summary>
/// The date that the collection was created.
/// </summary>
[JsonProperty("created", NullValueHandling = NullValueHandling.Ignore)]
public virtual DateTime? Created { get; private set; }
/// <summary>
/// The language of the collection.
/// </summary>
[JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
public string Language { get; set; }
/// <summary>
/// An array of enrichments that are applied to this collection.
/// </summary>
[JsonProperty("enrichments", NullValueHandling = NullValueHandling.Ignore)]
public List<CollectionEnrichment> Enrichments { get; set; }
}
}
11 changes: 11 additions & 0 deletions Scripts/Services/Discovery/V2/Model/CollectionDetails.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions Scripts/Services/Discovery/V2/Model/CollectionEnrichment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* (C) Copyright IBM Corp. 2020.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using System.Collections.Generic;
using Newtonsoft.Json;

namespace IBM.Watson.Discovery.V2.Model
{
/// <summary>
/// An object describing an Enrichment for a collection.
/// </summary>
public class CollectionEnrichment
{
/// <summary>
/// The unique identifier of this enrichment.
/// </summary>
[JsonProperty("enrichment_id", NullValueHandling = NullValueHandling.Ignore)]
public string EnrichmentId { get; set; }
/// <summary>
/// An array of field names that the enrichment is applied to.
/// </summary>
[JsonProperty("fields", NullValueHandling = NullValueHandling.Ignore)]
public List<string> Fields { get; set; }
}
}
11 changes: 11 additions & 0 deletions Scripts/Services/Discovery/V2/Model/CollectionEnrichment.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
* (C) Copyright IBM Corp. 2019, 2020.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@
namespace IBM.Watson.Discovery.V2.Model
{
/// <summary>
/// A response containing the default component settings.
/// The default component settings for this project.
/// </summary>
public class ComponentSettingsResponse
{
Expand Down
77 changes: 77 additions & 0 deletions Scripts/Services/Discovery/V2/Model/CreateEnrichment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* (C) Copyright IBM Corp. 2020.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using Newtonsoft.Json;

namespace IBM.Watson.Discovery.V2.Model
{
/// <summary>
/// Information about a specific enrichment.
/// </summary>
public class CreateEnrichment
{
/// <summary>
/// The type of this enrichment.
/// </summary>
public class TypeValue
{
/// <summary>
/// Constant DICTIONARY for dictionary
/// </summary>
public const string DICTIONARY = "dictionary";
/// <summary>
/// Constant REGULAR_EXPRESSION for regular_expression
/// </summary>
public const string REGULAR_EXPRESSION = "regular_expression";
/// <summary>
/// Constant UIMA_ANNOTATOR for uima_annotator
/// </summary>
public const string UIMA_ANNOTATOR = "uima_annotator";
/// <summary>
/// Constant RULE_BASED for rule_based
/// </summary>
public const string RULE_BASED = "rule_based";
/// <summary>
/// Constant WATSON_KNOWLEDGE_STUDIO_MODEL for watson_knowledge_studio_model
/// </summary>
public const string WATSON_KNOWLEDGE_STUDIO_MODEL = "watson_knowledge_studio_model";

}

/// <summary>
/// The type of this enrichment.
/// Constants for possible values can be found using CreateEnrichment.TypeValue
/// </summary>
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
public string Type { get; set; }
/// <summary>
/// The human readable name for this enrichment.
/// </summary>
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; }
/// <summary>
/// The description of this enrichment.
/// </summary>
[JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)]
public string Description { get; set; }
/// <summary>
/// A object containing options for the current enrichment.
/// </summary>
[JsonProperty("options", NullValueHandling = NullValueHandling.Ignore)]
public EnrichmentOptions Options { get; set; }
}
}
11 changes: 11 additions & 0 deletions Scripts/Services/Discovery/V2/Model/CreateEnrichment.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions Scripts/Services/Discovery/V2/Model/DefaultQueryParams.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* (C) Copyright IBM Corp. 2020.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using System.Collections.Generic;
using Newtonsoft.Json;

namespace IBM.Watson.Discovery.V2.Model
{
/// <summary>
/// Default query parameters for this project.
/// </summary>
public class DefaultQueryParams
{
/// <summary>
/// An array of collection identifiers to query. If empty or omitted all collections in the project are queried.
/// </summary>
[JsonProperty("collection_ids", NullValueHandling = NullValueHandling.Ignore)]
public List<string> CollectionIds { get; set; }
/// <summary>
/// Default settings configuration for passage search options.
/// </summary>
[JsonProperty("passages", NullValueHandling = NullValueHandling.Ignore)]
public DefaultQueryParamsPassages Passages { get; set; }
/// <summary>
/// Default project query settings for table results.
/// </summary>
[JsonProperty("table_results", NullValueHandling = NullValueHandling.Ignore)]
public DefaultQueryParamsTableResults TableResults { get; set; }
/// <summary>
/// A string representing the default aggregation query for the project.
/// </summary>
[JsonProperty("aggregation", NullValueHandling = NullValueHandling.Ignore)]
public string Aggregation { get; set; }
/// <summary>
/// Object containing suggested refinement settings.
/// </summary>
[JsonProperty("suggested_refinements", NullValueHandling = NullValueHandling.Ignore)]
public DefaultQueryParamsSuggestedRefinements SuggestedRefinements { get; set; }
/// <summary>
/// When `true`, a spelling suggestions for the query are retuned by default.
/// </summary>
[JsonProperty("spelling_suggestions", NullValueHandling = NullValueHandling.Ignore)]
public bool? SpellingSuggestions { get; set; }
/// <summary>
/// When `true`, a highlights for the query are retuned by default.
/// </summary>
[JsonProperty("highlight", NullValueHandling = NullValueHandling.Ignore)]
public bool? Highlight { get; set; }
/// <summary>
/// The number of document results returned by default.
/// </summary>
[JsonProperty("count", NullValueHandling = NullValueHandling.Ignore)]
public long? Count { get; set; }
/// <summary>
/// A comma separated list of document fields to sort results by default.
/// </summary>
[JsonProperty("sort", NullValueHandling = NullValueHandling.Ignore)]
public string Sort { get; set; }
/// <summary>
/// An array of field names to return in document results if present by default.
/// </summary>
[JsonProperty("return", NullValueHandling = NullValueHandling.Ignore)]
public List<string> _Return { get; set; }
}
}
11 changes: 11 additions & 0 deletions Scripts/Services/Discovery/V2/Model/DefaultQueryParams.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions Scripts/Services/Discovery/V2/Model/DefaultQueryParamsPassages.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* (C) Copyright IBM Corp. 2020.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using System.Collections.Generic;
using Newtonsoft.Json;

namespace IBM.Watson.Discovery.V2.Model
{
/// <summary>
/// Default settings configuration for passage search options.
/// </summary>
public class DefaultQueryParamsPassages
{
/// <summary>
/// When `true`, a passage search is performed by default.
/// </summary>
[JsonProperty("enabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? Enabled { get; set; }
/// <summary>
/// The number of passages to return.
/// </summary>
[JsonProperty("count", NullValueHandling = NullValueHandling.Ignore)]
public long? Count { get; set; }
/// <summary>
/// An array of field names to perfom the passage search on.
/// </summary>
[JsonProperty("fields", NullValueHandling = NullValueHandling.Ignore)]
public List<string> Fields { get; set; }
/// <summary>
/// The approximate number of characters that each returned passage will contain.
/// </summary>
[JsonProperty("characters", NullValueHandling = NullValueHandling.Ignore)]
public long? Characters { get; set; }
/// <summary>
/// When `true` the number of passages that can be returned from a single document is restricted to the
/// *max_per_document* value.
/// </summary>
[JsonProperty("per_document", NullValueHandling = NullValueHandling.Ignore)]
public bool? PerDocument { get; set; }
/// <summary>
/// The default maximum number of passages that can be taken from a single document as the result of a passage
/// query.
/// </summary>
[JsonProperty("max_per_document", NullValueHandling = NullValueHandling.Ignore)]
public long? MaxPerDocument { get; set; }
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit abc28ba

Please sign in to comment.