Skip to content

Commit

Permalink
feat(Compare and Comply): Generated Compare and Comply service and wr…
Browse files Browse the repository at this point in the history
…ite integration tests
  • Loading branch information
mediumTaj committed Nov 13, 2018
1 parent b9d8f84 commit 60bea7e
Show file tree
Hide file tree
Showing 61 changed files with 4,275 additions and 1 deletion.
19 changes: 18 additions & 1 deletion IBM.WatsonDeveloperCloud.sln
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.As
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.Assistant.v2.IntTests", "test\IBM.WatsonDeveloperCloud.Assistant.v2.IntTests\IBM.WatsonDeveloperCloud.Assistant.v2.IntTests.csproj", "{200FC8C7-ED91-4F66-8674-D678588FC450}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.WatsonDeveloperCloud.Assistant.v2.Example", "examples\IBM.WatsonDeveloperCloud.Assistant.v2.Example\IBM.WatsonDeveloperCloud.Assistant.v2.Example.csproj", "{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.Assistant.v2.Example", "examples\IBM.WatsonDeveloperCloud.Assistant.v2.Example\IBM.WatsonDeveloperCloud.Assistant.v2.Example.csproj", "{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CompareComplyV1", "CompareComplyV1", "{B368DCF7-FB57-4302-8467-4EB142394A29}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.CompareComply.v1", "src\IBM.WatsonDeveloperCloud.CompareComply.v1\IBM.WatsonDeveloperCloud.CompareComply.v1.csproj", "{0287B6FD-D28A-47C9-9686-C4658EBD2129}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.WatsonDeveloperCloud.CompareComply.v1.IT", "test\IBM.WatsonDeveloperCloud.CompareComply.v1.IT\IBM.WatsonDeveloperCloud.CompareComply.v1.IT.csproj", "{42258A9B-CE18-4C39-BAA5-19F8C5DE041B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -325,6 +331,14 @@ Global
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Release|Any CPU.Build.0 = Release|Any CPU
{0287B6FD-D28A-47C9-9686-C4658EBD2129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0287B6FD-D28A-47C9-9686-C4658EBD2129}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0287B6FD-D28A-47C9-9686-C4658EBD2129}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0287B6FD-D28A-47C9-9686-C4658EBD2129}.Release|Any CPU.Build.0 = Release|Any CPU
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -392,6 +406,9 @@ Global
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
{200FC8C7-ED91-4F66-8674-D678588FC450} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
{B368DCF7-FB57-4302-8467-4EB142394A29} = {28E61676-E9FF-4DA9-99CC-5E0D16F02380}
{0287B6FD-D28A-47C9-9686-C4658EBD2129} = {B368DCF7-FB57-4302-8467-4EB142394A29}
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B} = {B368DCF7-FB57-4302-8467-4EB142394A29}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B9D9D17B-1C17-402F-B701-DC671528690A}
Expand Down
925 changes: 925 additions & 0 deletions src/IBM.WatsonDeveloperCloud.CompareComply.v1/CompareComplyService.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>IBM.WatsonDeveloperCloud.CompareComply.v1 wraps the Watson Developer Cloud Compare Comply service (http://www.ibm.com/watson/developercloud/compare-comply.html)</Description>
<AssemblyTitle>IBM.WatsonDeveloperCloud.CompareComply.v1</AssemblyTitle>
<VersionPrefix>2.11.0</VersionPrefix>
<Authors>Watson Developer Cloud</Authors>
<TargetFramework>netstandard1.3</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.CompareComply.v1</AssemblyName>
<PackageId>IBM.WatsonDeveloperCloud.CompareComply.v1</PackageId>
<PackageTags>watson;cognitive;speech;vision;machine-learning;ml;ai;artificial-intelligence;.NET;.NET-Standard</PackageTags>
<PackageIconUrl>https://watson-developer-cloud.github.io/dotnet-standard-sdk/img/Watson_Avatar_Pos_RGB.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/watson-developer-cloud/dotnet-standard-sdk</PackageProjectUrl>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<Version>2.11.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\IBM.WatsonDeveloperCloud\IBM.WatsonDeveloperCloud.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Copyright 2018 IBM Corp. All Rights Reserved.
*
* 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;
using System.Collections.Generic;
using IBM.WatsonDeveloperCloud.CompareComply.v1.Model;

namespace IBM.WatsonDeveloperCloud.CompareComply.v1
{
public partial interface ICompareComplyService
{
HTMLReturn ConvertToHtml(System.IO.FileStream file, string modelId = null, string fileContentType = null, Dictionary<string, object> customData = null);
ClassifyReturn ClassifyElements(System.IO.FileStream file, string modelId = null, Dictionary<string, object> customData = null);
TableReturn ExtractTables(System.IO.FileStream file, string modelId = null, Dictionary<string, object> customData = null);
CompareReturn CompareDocuments(System.IO.FileStream file1, System.IO.FileStream file2, string file1Label = null, string file2Label = null, string modelId = null, string file1ContentType = null, string file2ContentType = null, Dictionary<string, object> customData = null);
FeedbackReturn AddFeedback(FeedbackInput feedbackData, Dictionary<string, object> customData = null);
FeedbackDeleted DeleteFeedback(string feedbackId, string modelId = null, Dictionary<string, object> customData = null);
GetFeedback GetFeedback(string feedbackId, string modelId = null, Dictionary<string, object> customData = null);
FeedbackList ListFeedback(string feedbackType = null, DateTime? before = null, DateTime? after = null, string documentTitle = null, string modelId = null, string modelVersion = null, string categoryRemoved = null, string categoryAdded = null, string categoryUnchanged = null, string typeRemoved = null, string typeAdded = null, string typeUnchanged = null, long? count = null, long? offset = null, string sort = null, Dictionary<string, object> customData = null);
BatchStatus CreateBatch(string function, System.IO.FileStream inputCredentialsFile, string inputBucketLocation, string inputBucketName, System.IO.FileStream outputCredentialsFile, string outputBucketLocation, string outputBucketName, string modelId = null, Dictionary<string, object> customData = null);
BatchStatus GetBatch(string batchId, Dictionary<string, object> customData = null);
BatchStatus GetBatches(Dictionary<string, object> customData = null);
BatchStatus UpdateBatch(string batchId, string action, string modelId = null, Dictionary<string, object> customData = null);
}
}
40 changes: 40 additions & 0 deletions src/IBM.WatsonDeveloperCloud.CompareComply.v1/Model/Address.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Copyright 2018 IBM Corp. All Rights Reserved.
*
* 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.WatsonDeveloperCloud.CompareComply.v1.Model
{
/// <summary>
/// A party's address.
/// </summary>
public class Address : BaseModel
{
/// <summary>
/// A string listing the address.
/// </summary>
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)]
public string Text { get; set; }
/// <summary>
/// The numeric location of the identified element in the document, represented with two integers labeled
/// `begin` and `end`.
/// </summary>
[JsonProperty("location", NullValueHandling = NullValueHandling.Ignore)]
public Location Location { get; set; }
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Copyright 2018 IBM Corp. All Rights Reserved.
*
* 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.WatsonDeveloperCloud.CompareComply.v1.Model
{
/// <summary>
/// AlignedElement.
/// </summary>
public class AlignedElement : BaseModel
{
/// <summary>
/// Identifies two elements that semantically align between the compared documents.
/// </summary>
[JsonProperty("element_pair", NullValueHandling = NullValueHandling.Ignore)]
public List<ElementPair> ElementPair { get; set; }
/// <summary>
/// Specifies whether the text is identical.
/// </summary>
[JsonProperty("identical_text", NullValueHandling = NullValueHandling.Ignore)]
public bool? IdenticalText { get; set; }
/// <summary>
/// One or more hashed values that you can send to IBM to provide feedback or receive support.
/// </summary>
[JsonProperty("provenance_ids", NullValueHandling = NullValueHandling.Ignore)]
public List<string> ProvenanceIds { get; set; }
}

}
76 changes: 76 additions & 0 deletions src/IBM.WatsonDeveloperCloud.CompareComply.v1/Model/Attribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**
* Copyright 2018 IBM Corp. All Rights Reserved.
*
* 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.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace IBM.WatsonDeveloperCloud.CompareComply.v1.Model
{
/// <summary>
/// List of document attributes.
/// </summary>
public class Attribute : BaseModel
{
/// <summary>
/// The type of attribute. Possible values are `Currency`, `DateTime`, and `Location`.
/// </summary>
/// <value>
/// The type of attribute. Possible values are `Currency`, `DateTime`, and `Location`.
/// </value>
[JsonConverter(typeof(StringEnumConverter))]
public enum TypeEnum
{

/// <summary>
/// Enum CURRENCY for Currency
/// </summary>
[EnumMember(Value = "Currency")]
CURRENCY,

/// <summary>
/// Enum DATETIME for DateTime
/// </summary>
[EnumMember(Value = "DateTime")]
DATETIME,

/// <summary>
/// Enum LOCATION for Location
/// </summary>
[EnumMember(Value = "Location")]
LOCATION
}

/// <summary>
/// The type of attribute. Possible values are `Currency`, `DateTime`, and `Location`.
/// </summary>
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
public TypeEnum? Type { get; set; }
/// <summary>
/// The text associated with the attribute.
/// </summary>
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)]
public string Text { get; set; }
/// <summary>
/// The numeric location of the identified element in the document, represented with two integers labeled
/// `begin` and `end`.
/// </summary>
[JsonProperty("location", NullValueHandling = NullValueHandling.Ignore)]
public Location Location { get; set; }
}

}
116 changes: 116 additions & 0 deletions src/IBM.WatsonDeveloperCloud.CompareComply.v1/Model/BatchStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/**
* Copyright 2018 IBM Corp. All Rights Reserved.
*
* 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;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace IBM.WatsonDeveloperCloud.CompareComply.v1.Model
{
/// <summary>
/// The batch-request status.
/// </summary>
public class BatchStatus : BaseModel
{
/// <summary>
/// The method to be run against the documents. Possible values are `html_conversion`, `element_classification`,
/// and `tables`.
/// </summary>
/// <value>
/// The method to be run against the documents. Possible values are `html_conversion`, `element_classification`,
/// and `tables`.
/// </value>
[JsonConverter(typeof(StringEnumConverter))]
public enum FunctionEnum
{

/// <summary>
/// Enum ELEMENT_CLASSIFICATION for element_classification
/// </summary>
[EnumMember(Value = "element_classification")]
ELEMENT_CLASSIFICATION,

/// <summary>
/// Enum HTML_CONVERSION for html_conversion
/// </summary>
[EnumMember(Value = "html_conversion")]
HTML_CONVERSION,

/// <summary>
/// Enum TABLES for tables
/// </summary>
[EnumMember(Value = "tables")]
TABLES
}

/// <summary>
/// The method to be run against the documents. Possible values are `html_conversion`, `element_classification`,
/// and `tables`.
/// </summary>
[JsonProperty("function", NullValueHandling = NullValueHandling.Ignore)]
public FunctionEnum? Function { get; set; }
/// <summary>
/// The geographical location of the Cloud Object Storage input bucket as listed on the **Endpoint** tab of your
/// COS instance; for example, `us-geo`, `eu-geo`, or `ap-geo`.
/// </summary>
[JsonProperty("input_bucket_location", NullValueHandling = NullValueHandling.Ignore)]
public string InputBucketLocation { get; set; }
/// <summary>
/// The name of the Cloud Object Storage input bucket.
/// </summary>
[JsonProperty("input_bucket_name", NullValueHandling = NullValueHandling.Ignore)]
public string InputBucketName { get; set; }
/// <summary>
/// The geographical location of the Cloud Object Storage output bucket as listed on the **Endpoint** tab of
/// your COS instance; for example, `us-geo`, `eu-geo`, or `ap-geo`.
/// </summary>
[JsonProperty("output_bucket_location", NullValueHandling = NullValueHandling.Ignore)]
public string OutputBucketLocation { get; set; }
/// <summary>
/// The name of the Cloud Object Storage output bucket.
/// </summary>
[JsonProperty("output_bucket_name", NullValueHandling = NullValueHandling.Ignore)]
public string OutputBucketName { get; set; }
/// <summary>
/// The unique identifier for the batch request.
/// </summary>
[JsonProperty("batch_id", NullValueHandling = NullValueHandling.Ignore)]
public string BatchId { get; set; }
/// <summary>
/// Document counts.
/// </summary>
[JsonProperty("document_counts", NullValueHandling = NullValueHandling.Ignore)]
public DocCounts DocumentCounts { get; set; }
/// <summary>
/// The status of the batch request.
/// </summary>
[JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)]
public string Status { get; set; }
/// <summary>
/// The creation time of the batch request.
/// </summary>
[JsonProperty("created", NullValueHandling = NullValueHandling.Ignore)]
public DateTime? Created { get; set; }
/// <summary>
/// The time of the most recent update to the batch request.
/// </summary>
[JsonProperty("updated", NullValueHandling = NullValueHandling.Ignore)]
public DateTime? Updated { get; set; }
}

}
Loading

0 comments on commit 60bea7e

Please sign in to comment.