Skip to content

Commit 60bea7e

Browse files
committed
feat(Compare and Comply): Generated Compare and Comply service and write integration tests
1 parent b9d8f84 commit 60bea7e

Some content is hidden

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

61 files changed

+4275
-1
lines changed

IBM.WatsonDeveloperCloud.sln

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.As
129129
EndProject
130130
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}"
131131
EndProject
132-
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}"
132+
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}"
133+
EndProject
134+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CompareComplyV1", "CompareComplyV1", "{B368DCF7-FB57-4302-8467-4EB142394A29}"
135+
EndProject
136+
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}"
137+
EndProject
138+
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}"
133139
EndProject
134140
Global
135141
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -325,6 +331,14 @@ Global
325331
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Debug|Any CPU.Build.0 = Debug|Any CPU
326332
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Release|Any CPU.ActiveCfg = Release|Any CPU
327333
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Release|Any CPU.Build.0 = Release|Any CPU
334+
{0287B6FD-D28A-47C9-9686-C4658EBD2129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
335+
{0287B6FD-D28A-47C9-9686-C4658EBD2129}.Debug|Any CPU.Build.0 = Debug|Any CPU
336+
{0287B6FD-D28A-47C9-9686-C4658EBD2129}.Release|Any CPU.ActiveCfg = Release|Any CPU
337+
{0287B6FD-D28A-47C9-9686-C4658EBD2129}.Release|Any CPU.Build.0 = Release|Any CPU
338+
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
339+
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B}.Debug|Any CPU.Build.0 = Debug|Any CPU
340+
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B}.Release|Any CPU.ActiveCfg = Release|Any CPU
341+
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B}.Release|Any CPU.Build.0 = Release|Any CPU
328342
EndGlobalSection
329343
GlobalSection(SolutionProperties) = preSolution
330344
HideSolutionNode = FALSE
@@ -392,6 +406,9 @@ Global
392406
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
393407
{200FC8C7-ED91-4F66-8674-D678588FC450} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
394408
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
409+
{B368DCF7-FB57-4302-8467-4EB142394A29} = {28E61676-E9FF-4DA9-99CC-5E0D16F02380}
410+
{0287B6FD-D28A-47C9-9686-C4658EBD2129} = {B368DCF7-FB57-4302-8467-4EB142394A29}
411+
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B} = {B368DCF7-FB57-4302-8467-4EB142394A29}
395412
EndGlobalSection
396413
GlobalSection(ExtensibilityGlobals) = postSolution
397414
SolutionGuid = {B9D9D17B-1C17-402F-B701-DC671528690A}

src/IBM.WatsonDeveloperCloud.CompareComply.v1/CompareComplyService.cs

Lines changed: 925 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<Description>IBM.WatsonDeveloperCloud.CompareComply.v1 wraps the Watson Developer Cloud Compare Comply service (http://www.ibm.com/watson/developercloud/compare-comply.html)</Description>
5+
<AssemblyTitle>IBM.WatsonDeveloperCloud.CompareComply.v1</AssemblyTitle>
6+
<VersionPrefix>2.11.0</VersionPrefix>
7+
<Authors>Watson Developer Cloud</Authors>
8+
<TargetFramework>netstandard1.3</TargetFramework>
9+
<AssemblyName>IBM.WatsonDeveloperCloud.CompareComply.v1</AssemblyName>
10+
<PackageId>IBM.WatsonDeveloperCloud.CompareComply.v1</PackageId>
11+
<PackageTags>watson;cognitive;speech;vision;machine-learning;ml;ai;artificial-intelligence;.NET;.NET-Standard</PackageTags>
12+
<PackageIconUrl>https://watson-developer-cloud.github.io/dotnet-standard-sdk/img/Watson_Avatar_Pos_RGB.png</PackageIconUrl>
13+
<PackageProjectUrl>https://github.com/watson-developer-cloud/dotnet-standard-sdk</PackageProjectUrl>
14+
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
15+
<Version>2.11.0</Version>
16+
</PropertyGroup>
17+
18+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
19+
<DebugType>full</DebugType>
20+
<DebugSymbols>true</DebugSymbols>
21+
</PropertyGroup>
22+
23+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
24+
<DebugType>full</DebugType>
25+
<DebugSymbols>true</DebugSymbols>
26+
</PropertyGroup>
27+
28+
<ItemGroup>
29+
<ProjectReference Include="..\IBM.WatsonDeveloperCloud\IBM.WatsonDeveloperCloud.csproj" />
30+
</ItemGroup>
31+
32+
<ItemGroup>
33+
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
34+
</ItemGroup>
35+
36+
</Project>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Copyright 2018 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;
19+
using System.Collections.Generic;
20+
using IBM.WatsonDeveloperCloud.CompareComply.v1.Model;
21+
22+
namespace IBM.WatsonDeveloperCloud.CompareComply.v1
23+
{
24+
public partial interface ICompareComplyService
25+
{
26+
HTMLReturn ConvertToHtml(System.IO.FileStream file, string modelId = null, string fileContentType = null, Dictionary<string, object> customData = null);
27+
ClassifyReturn ClassifyElements(System.IO.FileStream file, string modelId = null, Dictionary<string, object> customData = null);
28+
TableReturn ExtractTables(System.IO.FileStream file, string modelId = null, Dictionary<string, object> customData = null);
29+
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);
30+
FeedbackReturn AddFeedback(FeedbackInput feedbackData, Dictionary<string, object> customData = null);
31+
FeedbackDeleted DeleteFeedback(string feedbackId, string modelId = null, Dictionary<string, object> customData = null);
32+
GetFeedback GetFeedback(string feedbackId, string modelId = null, Dictionary<string, object> customData = null);
33+
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);
34+
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);
35+
BatchStatus GetBatch(string batchId, Dictionary<string, object> customData = null);
36+
BatchStatus GetBatches(Dictionary<string, object> customData = null);
37+
BatchStatus UpdateBatch(string batchId, string action, string modelId = null, Dictionary<string, object> customData = null);
38+
}
39+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Copyright 2018 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.WatsonDeveloperCloud.CompareComply.v1.Model
21+
{
22+
/// <summary>
23+
/// A party's address.
24+
/// </summary>
25+
public class Address : BaseModel
26+
{
27+
/// <summary>
28+
/// A string listing the address.
29+
/// </summary>
30+
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)]
31+
public string Text { get; set; }
32+
/// <summary>
33+
/// The numeric location of the identified element in the document, represented with two integers labeled
34+
/// `begin` and `end`.
35+
/// </summary>
36+
[JsonProperty("location", NullValueHandling = NullValueHandling.Ignore)]
37+
public Location Location { get; set; }
38+
}
39+
40+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* Copyright 2018 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.WatsonDeveloperCloud.CompareComply.v1.Model
22+
{
23+
/// <summary>
24+
/// AlignedElement.
25+
/// </summary>
26+
public class AlignedElement : BaseModel
27+
{
28+
/// <summary>
29+
/// Identifies two elements that semantically align between the compared documents.
30+
/// </summary>
31+
[JsonProperty("element_pair", NullValueHandling = NullValueHandling.Ignore)]
32+
public List<ElementPair> ElementPair { get; set; }
33+
/// <summary>
34+
/// Specifies whether the text is identical.
35+
/// </summary>
36+
[JsonProperty("identical_text", NullValueHandling = NullValueHandling.Ignore)]
37+
public bool? IdenticalText { get; set; }
38+
/// <summary>
39+
/// One or more hashed values that you can send to IBM to provide feedback or receive support.
40+
/// </summary>
41+
[JsonProperty("provenance_ids", NullValueHandling = NullValueHandling.Ignore)]
42+
public List<string> ProvenanceIds { get; set; }
43+
}
44+
45+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/**
2+
* Copyright 2018 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.Runtime.Serialization;
19+
using Newtonsoft.Json;
20+
using Newtonsoft.Json.Converters;
21+
22+
namespace IBM.WatsonDeveloperCloud.CompareComply.v1.Model
23+
{
24+
/// <summary>
25+
/// List of document attributes.
26+
/// </summary>
27+
public class Attribute : BaseModel
28+
{
29+
/// <summary>
30+
/// The type of attribute. Possible values are `Currency`, `DateTime`, and `Location`.
31+
/// </summary>
32+
/// <value>
33+
/// The type of attribute. Possible values are `Currency`, `DateTime`, and `Location`.
34+
/// </value>
35+
[JsonConverter(typeof(StringEnumConverter))]
36+
public enum TypeEnum
37+
{
38+
39+
/// <summary>
40+
/// Enum CURRENCY for Currency
41+
/// </summary>
42+
[EnumMember(Value = "Currency")]
43+
CURRENCY,
44+
45+
/// <summary>
46+
/// Enum DATETIME for DateTime
47+
/// </summary>
48+
[EnumMember(Value = "DateTime")]
49+
DATETIME,
50+
51+
/// <summary>
52+
/// Enum LOCATION for Location
53+
/// </summary>
54+
[EnumMember(Value = "Location")]
55+
LOCATION
56+
}
57+
58+
/// <summary>
59+
/// The type of attribute. Possible values are `Currency`, `DateTime`, and `Location`.
60+
/// </summary>
61+
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
62+
public TypeEnum? Type { get; set; }
63+
/// <summary>
64+
/// The text associated with the attribute.
65+
/// </summary>
66+
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)]
67+
public string Text { get; set; }
68+
/// <summary>
69+
/// The numeric location of the identified element in the document, represented with two integers labeled
70+
/// `begin` and `end`.
71+
/// </summary>
72+
[JsonProperty("location", NullValueHandling = NullValueHandling.Ignore)]
73+
public Location Location { get; set; }
74+
}
75+
76+
}
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/**
2+
* Copyright 2018 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;
19+
using System.Runtime.Serialization;
20+
using Newtonsoft.Json;
21+
using Newtonsoft.Json.Converters;
22+
23+
namespace IBM.WatsonDeveloperCloud.CompareComply.v1.Model
24+
{
25+
/// <summary>
26+
/// The batch-request status.
27+
/// </summary>
28+
public class BatchStatus : BaseModel
29+
{
30+
/// <summary>
31+
/// The method to be run against the documents. Possible values are `html_conversion`, `element_classification`,
32+
/// and `tables`.
33+
/// </summary>
34+
/// <value>
35+
/// The method to be run against the documents. Possible values are `html_conversion`, `element_classification`,
36+
/// and `tables`.
37+
/// </value>
38+
[JsonConverter(typeof(StringEnumConverter))]
39+
public enum FunctionEnum
40+
{
41+
42+
/// <summary>
43+
/// Enum ELEMENT_CLASSIFICATION for element_classification
44+
/// </summary>
45+
[EnumMember(Value = "element_classification")]
46+
ELEMENT_CLASSIFICATION,
47+
48+
/// <summary>
49+
/// Enum HTML_CONVERSION for html_conversion
50+
/// </summary>
51+
[EnumMember(Value = "html_conversion")]
52+
HTML_CONVERSION,
53+
54+
/// <summary>
55+
/// Enum TABLES for tables
56+
/// </summary>
57+
[EnumMember(Value = "tables")]
58+
TABLES
59+
}
60+
61+
/// <summary>
62+
/// The method to be run against the documents. Possible values are `html_conversion`, `element_classification`,
63+
/// and `tables`.
64+
/// </summary>
65+
[JsonProperty("function", NullValueHandling = NullValueHandling.Ignore)]
66+
public FunctionEnum? Function { get; set; }
67+
/// <summary>
68+
/// The geographical location of the Cloud Object Storage input bucket as listed on the **Endpoint** tab of your
69+
/// COS instance; for example, `us-geo`, `eu-geo`, or `ap-geo`.
70+
/// </summary>
71+
[JsonProperty("input_bucket_location", NullValueHandling = NullValueHandling.Ignore)]
72+
public string InputBucketLocation { get; set; }
73+
/// <summary>
74+
/// The name of the Cloud Object Storage input bucket.
75+
/// </summary>
76+
[JsonProperty("input_bucket_name", NullValueHandling = NullValueHandling.Ignore)]
77+
public string InputBucketName { get; set; }
78+
/// <summary>
79+
/// The geographical location of the Cloud Object Storage output bucket as listed on the **Endpoint** tab of
80+
/// your COS instance; for example, `us-geo`, `eu-geo`, or `ap-geo`.
81+
/// </summary>
82+
[JsonProperty("output_bucket_location", NullValueHandling = NullValueHandling.Ignore)]
83+
public string OutputBucketLocation { get; set; }
84+
/// <summary>
85+
/// The name of the Cloud Object Storage output bucket.
86+
/// </summary>
87+
[JsonProperty("output_bucket_name", NullValueHandling = NullValueHandling.Ignore)]
88+
public string OutputBucketName { get; set; }
89+
/// <summary>
90+
/// The unique identifier for the batch request.
91+
/// </summary>
92+
[JsonProperty("batch_id", NullValueHandling = NullValueHandling.Ignore)]
93+
public string BatchId { get; set; }
94+
/// <summary>
95+
/// Document counts.
96+
/// </summary>
97+
[JsonProperty("document_counts", NullValueHandling = NullValueHandling.Ignore)]
98+
public DocCounts DocumentCounts { get; set; }
99+
/// <summary>
100+
/// The status of the batch request.
101+
/// </summary>
102+
[JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)]
103+
public string Status { get; set; }
104+
/// <summary>
105+
/// The creation time of the batch request.
106+
/// </summary>
107+
[JsonProperty("created", NullValueHandling = NullValueHandling.Ignore)]
108+
public DateTime? Created { get; set; }
109+
/// <summary>
110+
/// The time of the most recent update to the batch request.
111+
/// </summary>
112+
[JsonProperty("updated", NullValueHandling = NullValueHandling.Ignore)]
113+
public DateTime? Updated { get; set; }
114+
}
115+
116+
}

0 commit comments

Comments
 (0)