Skip to content

Commit

Permalink
feat(discovery-2): enum update for CreateProjectConstants
Browse files Browse the repository at this point in the history
  • Loading branch information
nan2iz committed Sep 8, 2021
1 parent c488dac commit b16b165
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 12 deletions.
10 changes: 8 additions & 2 deletions src/IBM.Watson.Discovery.v2/DiscoveryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ public DetailedResponse<AnalyzedDocument> AnalyzeDocument(string projectId, stri

if (file != null)
{
var fileContent = new StreamContent(file);
var fileContent = new ByteArrayContent(file.ToArray());
System.Net.Http.Headers.MediaTypeHeaderValue contentType;
System.Net.Http.Headers.MediaTypeHeaderValue.TryParse(fileContentType, out contentType);
fileContent.Headers.ContentType = contentType;
Expand Down Expand Up @@ -2303,7 +2303,13 @@ public DetailedResponse<ListProjectsResponse> ListProjects()
/// Create a new project for this instance.
/// </summary>
/// <param name="name">The human readable name of this project.</param>
/// <param name="type">The project type of this project.</param>
/// <param name="type">The type of project.
///
/// The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a
/// *Custom* project.
///
/// The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments
/// and installed deployments only.</param>
/// <param name="defaultQueryParameters">Default query parameters for this project. (optional)</param>
/// <returns><see cref="ProjectDetails" />ProjectDetails</returns>
public DetailedResponse<ProjectDetails> CreateProject(string name, string type, DefaultQueryParams defaultQueryParameters = null)
Expand Down
26 changes: 21 additions & 5 deletions src/IBM.Watson.Discovery.v2/Model/ProjectDetails.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,13 @@ namespace IBM.Watson.Discovery.v2.Model
public class ProjectDetails
{
/// <summary>
/// The project type of this project.
/// The type of project.
///
/// The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a
/// *Custom* project.
///
/// The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments
/// and installed deployments only.
/// </summary>
public class TypeEnumValue
{
Expand All @@ -34,22 +40,32 @@ public class TypeEnumValue
/// </summary>
public const string DOCUMENT_RETRIEVAL = "document_retrieval";
/// <summary>
/// Constant ANSWER_RETRIEVAL for answer_retrieval
/// Constant CONVERSATIONAL_SEARCH for conversational_search
/// </summary>
public const string ANSWER_RETRIEVAL = "answer_retrieval";
public const string CONVERSATIONAL_SEARCH = "conversational_search";
/// <summary>
/// Constant CONTENT_MINING for content_mining
/// </summary>
public const string CONTENT_MINING = "content_mining";
/// <summary>
/// Constant CONTENT_INTELLIGENCE for content_intelligence
/// </summary>
public const string CONTENT_INTELLIGENCE = "content_intelligence";
/// <summary>
/// Constant OTHER for other
/// </summary>
public const string OTHER = "other";

}

/// <summary>
/// The project type of this project.
/// The type of project.
///
/// The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a
/// *Custom* project.
///
/// The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments
/// and installed deployments only.
/// Constants for possible values can be found using ProjectDetails.TypeEnumValue
/// </summary>
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
Expand Down
26 changes: 21 additions & 5 deletions src/IBM.Watson.Discovery.v2/Model/ProjectListDetails.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,13 @@ namespace IBM.Watson.Discovery.v2.Model
public class ProjectListDetails
{
/// <summary>
/// The project type of this project.
/// The type of project.
///
/// The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a
/// *Custom* project.
///
/// The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments
/// and installed deployments only.
/// </summary>
public class TypeEnumValue
{
Expand All @@ -34,22 +40,32 @@ public class TypeEnumValue
/// </summary>
public const string DOCUMENT_RETRIEVAL = "document_retrieval";
/// <summary>
/// Constant ANSWER_RETRIEVAL for answer_retrieval
/// Constant CONVERSATIONAL_SEARCH for conversational_search
/// </summary>
public const string ANSWER_RETRIEVAL = "answer_retrieval";
public const string CONVERSATIONAL_SEARCH = "conversational_search";
/// <summary>
/// Constant CONTENT_MINING for content_mining
/// </summary>
public const string CONTENT_MINING = "content_mining";
/// <summary>
/// Constant CONTENT_INTELLIGENCE for content_intelligence
/// </summary>
public const string CONTENT_INTELLIGENCE = "content_intelligence";
/// <summary>
/// Constant OTHER for other
/// </summary>
public const string OTHER = "other";

}

/// <summary>
/// The project type of this project.
/// The type of project.
///
/// The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a
/// *Custom* project.
///
/// The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments
/// and installed deployments only.
/// Constants for possible values can be found using ProjectListDetails.TypeEnumValue
/// </summary>
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
Expand Down

0 comments on commit b16b165

Please sign in to comment.