Skip to content

Commit b742398

Browse files
committed
feat(All services): Updated services based on the latest API definitions
1 parent 830bc85 commit b742398

File tree

8 files changed

+227
-13
lines changed

8 files changed

+227
-13
lines changed

Scripts/Services/CompareComply/v1/Models/Attribute.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ public enum Type
4545
/// Enum location for Location
4646
/// </summary>
4747
[EnumMember(Value = "Location")]
48-
Location
48+
Location,
49+
/// <summary>
50+
/// Enum ADDRESS for Address
51+
/// </summary>
52+
[EnumMember(Value = "Address")]
53+
ADDRESS,
4954
}
5055

5156
/// <summary>

Scripts/Services/CompareComply/v1/Models/BodyCells.cs

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,35 +64,42 @@ public class BodyCells
6464
[fsProperty("column_index_end")]
6565
public long? ColumnIndexEnd { get; set; }
6666
/// <summary>
67-
/// Gets or Sets rowHeaderIds
67+
/// An array of values, each being the `id` value of a row header that is applicable to this body cell.
6868
/// </summary>
6969
[fsProperty("row_header_ids")]
70-
public List<RowHeaderIds> RowHeaderIds { get; set; }
70+
public List<string> RowHeaderIds { get; set; }
7171
/// <summary>
72-
/// Gets or Sets rowHeaderTexts
72+
/// An array of values, each being the `text` value of a row header that is applicable to this body cell.
7373
/// </summary>
7474
[fsProperty("row_header_texts")]
75-
public List<RowHeaderTexts> RowHeaderTexts { get; set; }
75+
public List<string> RowHeaderTexts { get; set; }
7676
/// <summary>
77-
/// Gets or Sets rowHeaderTextsNormalized
77+
/// If you provide customization input, the normalized version of the row header texts according to the
78+
/// customization; otherwise, the same value as `row_header_texts`.
7879
/// </summary>
7980
[fsProperty("row_header_texts_normalized")]
80-
public List<RowHeaderTextsNormalized> RowHeaderTextsNormalized { get; set; }
81+
public List<string> RowHeaderTextsNormalized { get; set; }
8182
/// <summary>
82-
/// Gets or Sets columnHeaderIds
83+
/// An array of values, each being the `id` value of a column header that is applicable to the current cell.
8384
/// </summary>
8485
[fsProperty("column_header_ids")]
85-
public List<ColumnHeaderIds> ColumnHeaderIds { get; set; }
86+
public List<string> ColumnHeaderIds { get; set; }
8687
/// <summary>
87-
/// Gets or Sets columnHeaderTexts
88+
/// An array of values, each being the `id` value of a column header that is applicable to the current cell.
8889
/// </summary>
8990
[fsProperty("column_header_texts")]
90-
public List<ColumnHeaderTexts> ColumnHeaderTexts { get; set; }
91+
public List<string> ColumnHeaderTexts { get; set; }
9192
/// <summary>
92-
/// Gets or Sets columnHeaderTextsNormalized
93+
/// If you provide customization input, the normalized version of the column header texts according to the
94+
/// customization; otherwise, the same value as `column_header_texts`.
9395
/// </summary>
9496
[fsProperty("column_header_texts_normalized")]
95-
public List<ColumnHeaderTextsNormalized> ColumnHeaderTextsNormalized { get; set; }
97+
public List<string> ColumnHeaderTextsNormalized { get; set; }
98+
/// <summary>
99+
/// Gets or Sets Attributes
100+
/// </summary>
101+
[fsProperty("attributes")]
102+
public List<Attribute> Attributes { get; set; }
96103
}
97104

98105
}

Scripts/Services/CompareComply/v1/Models/ContractAmts.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,33 @@ namespace IBM.Watson.DeveloperCloud.Services.CompareComply.v1
2525
[fsObject]
2626
public class ContractAmts
2727
{
28+
/// <summary>
29+
/// The confidence level in the identification of the contract amount.
30+
/// </summary>
31+
public enum ConfidenceLevelEnum
32+
{
33+
34+
/// <summary>
35+
/// Enum HIGH for High
36+
/// </summary>
37+
High,
38+
39+
/// <summary>
40+
/// Enum MEDIUM for Medium
41+
/// </summary>
42+
Medium,
43+
44+
/// <summary>
45+
/// Enum LOW for Low
46+
/// </summary>
47+
Low
48+
}
49+
50+
/// <summary>
51+
/// The confidence level in the identification of the contract amount.
52+
/// </summary>
53+
[fsProperty("confidence_level")]
54+
public ConfidenceLevelEnum? ConfidenceLevel { get; set; }
2855
/// <summary>
2956
/// The monetary amount.
3057
/// </summary>

Scripts/Services/CompareComply/v1/Models/EffectiveDates.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ namespace IBM.Watson.DeveloperCloud.Services.CompareComply.v1
2525
[fsObject]
2626
public class EffectiveDates
2727
{
28+
/// <summary>
29+
/// The confidence level in the identification of the effective date.
30+
/// </summary>
31+
public enum ConfidenceLevelEnum
32+
{
33+
34+
/// <summary>
35+
/// Enum HIGH for High
36+
/// </summary>
37+
High,
38+
39+
/// <summary>
40+
/// Enum MEDIUM for Medium
41+
/// </summary>
42+
Medium,
43+
44+
/// <summary>
45+
/// Enum LOW for Low
46+
/// </summary>
47+
Low
48+
}
49+
50+
/// <summary>
51+
/// The confidence level in the identification of the effective date.
52+
/// </summary>
53+
[fsProperty("confidence_level")]
54+
public ConfidenceLevelEnum? ConfidenceLevel { get; set; }
55+
2856
/// <summary>
2957
/// The effective date, listed as a string.
3058
/// </summary>

Scripts/Services/CompareComply/v1/Models/Parties.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,28 @@ namespace IBM.Watson.DeveloperCloud.Services.CompareComply.v1
2626
[fsObject]
2727
public class Parties
2828
{
29+
/// <summary>
30+
/// A string that identifies the importance of the party.
31+
/// </summary>
32+
public enum ImportanceEnum
33+
{
34+
35+
/// <summary>
36+
/// Enum PRIMARY for Primary
37+
/// </summary>
38+
Primary,
39+
40+
/// <summary>
41+
/// Enum UNKNOWN for Unknown
42+
/// </summary>
43+
Unknown
44+
}
45+
46+
/// <summary>
47+
/// A string that identifies the importance of the party.
48+
/// </summary>
49+
[fsProperty("importance")]
50+
public ImportanceEnum? Importance { get; set; }
2951
/// <summary>
3052
/// A string identifying the party.
3153
/// </summary>

Scripts/Services/CompareComply/v1/Models/TerminationDates.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ namespace IBM.Watson.DeveloperCloud.Services.CompareComply.v1
2525
[fsObject]
2626
public class TerminationDates
2727
{
28+
/// <summary>
29+
/// The confidence level in the identification of the termination date.
30+
/// </summary>
31+
public enum ConfidenceLevelEnum
32+
{
33+
34+
/// <summary>
35+
/// Enum HIGH for High
36+
/// </summary>
37+
High,
38+
39+
/// <summary>
40+
/// Enum MEDIUM for Medium
41+
/// </summary>
42+
Medium,
43+
44+
/// <summary>
45+
/// Enum LOW for Low
46+
/// </summary>
47+
Low
48+
}
49+
50+
/// <summary>
51+
/// The confidence level in the identification of the termination date.
52+
/// </summary>
53+
[fsProperty("confidence_level")]
54+
public ConfidenceLevelEnum? ConfidenceLevel { get; set; }
55+
2856
/// <summary>
2957
/// The termination date.
3058
/// </summary>

Scripts/Services/Discovery/v1/DataModels.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,10 @@ public class DocumentCounts
10051005
/// The number of documents in the collection that failed to be ingested.
10061006
/// </summary>
10071007
public int failed { get; set; }
1008+
/// <summary>
1009+
/// The number of documents that have been uploaded to the collection, but have not yet started processing.
1010+
/// </summary>
1011+
public virtual long? pending { get; private set; }
10081012
}
10091013

10101014
/// <summary>

Scripts/Services/Discovery/v1/Discovery.cs

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5649,6 +5649,99 @@ private void OnCreateStopwordListResponse(RESTConnector.Request req, RESTConnect
56495649
}
56505650
}
56515651

5652+
public bool GetStopwordListStatus(SuccessCallback<TokenDictStatusResponse> successCallback, FailCallback failCallback, string environmentID, string collectionId, Dictionary<string, object> customData = null)
5653+
{
5654+
if (successCallback == null)
5655+
throw new ArgumentNullException("successCallback");
5656+
if (failCallback == null)
5657+
throw new ArgumentNullException("failCallback");
5658+
if (string.IsNullOrEmpty(environmentID))
5659+
throw new ArgumentNullException("environmentID");
5660+
if (string.IsNullOrEmpty(collectionId))
5661+
throw new ArgumentNullException("collectionId");
5662+
5663+
GetStopwordListStatusRequest req = new GetStopwordListStatusRequest();
5664+
req.SuccessCallback = successCallback;
5665+
req.FailCallback = failCallback;
5666+
req.HttpMethod = UnityWebRequest.kHttpVerbGET;
5667+
req.DisableSslVerification = DisableSslVerification;
5668+
req.CustomData = customData == null ? new Dictionary<string, object>() : customData;
5669+
req.Headers["Content-Type"] = "application/json";
5670+
if (req.CustomData.ContainsKey(Constants.String.CUSTOM_REQUEST_HEADERS))
5671+
{
5672+
foreach (KeyValuePair<string, string> kvp in req.CustomData[Constants.String.CUSTOM_REQUEST_HEADERS] as Dictionary<string, string>)
5673+
{
5674+
req.Headers.Add(kvp.Key, kvp.Value);
5675+
}
5676+
}
5677+
req.Parameters["version"] = VersionDate;
5678+
req.OnResponse = OnGetStopwordListStatusResponse;
5679+
req.Headers["X-IBMCloud-SDK-Analytics"] = "service_name=discovery;service_version=v1;operation_id=GetStopwordListStatus";
5680+
5681+
RESTConnector connector = RESTConnector.GetConnector(Credentials, string.Format("/v1/environments/{0}/collections/{1}/word_lists/stopwords", environmentID, collectionId));
5682+
if (connector == null)
5683+
return false;
5684+
5685+
return connector.Send(req);
5686+
}
5687+
5688+
private class GetStopwordListStatusRequest : RESTConnector.Request
5689+
{
5690+
/// <summary>
5691+
/// The success callback.
5692+
/// </summary>
5693+
public SuccessCallback<TokenDictStatusResponse> SuccessCallback { get; set; }
5694+
/// <summary>
5695+
/// The fail callback.
5696+
/// </summary>
5697+
public FailCallback FailCallback { get; set; }
5698+
/// <summary>
5699+
/// Custom data.
5700+
/// </summary>
5701+
public Dictionary<string, object> CustomData { get; set; }
5702+
}
5703+
5704+
private void OnGetStopwordListStatusResponse(RESTConnector.Request req, RESTConnector.Response resp)
5705+
{
5706+
TokenDictStatusResponse result = new TokenDictStatusResponse();
5707+
fsData data = null;
5708+
Dictionary<string, object> customData = ((GetStopwordListStatusRequest)req).CustomData;
5709+
customData.Add(Constants.String.RESPONSE_HEADERS, resp.Headers);
5710+
5711+
if (resp.Success)
5712+
{
5713+
try
5714+
{
5715+
fsResult r = fsJsonParser.Parse(Encoding.UTF8.GetString(resp.Data), out data);
5716+
if (!r.Succeeded)
5717+
throw new WatsonException(r.FormattedMessages);
5718+
5719+
object obj = result;
5720+
r = _serializer.TryDeserialize(data, obj.GetType(), ref obj);
5721+
if (!r.Succeeded)
5722+
throw new WatsonException(r.FormattedMessages);
5723+
5724+
customData.Add("json", data);
5725+
}
5726+
catch (Exception e)
5727+
{
5728+
Log.Error("Discovery.OnGetStopwordListStatusResponse()", "OnGetStopwordListStatusResponse Exception: {0}", e.ToString());
5729+
resp.Success = false;
5730+
}
5731+
}
5732+
5733+
if (resp.Success)
5734+
{
5735+
if (((GetStopwordListStatusRequest)req).SuccessCallback != null)
5736+
((GetStopwordListStatusRequest)req).SuccessCallback(result, customData);
5737+
}
5738+
else
5739+
{
5740+
if (((GetStopwordListStatusRequest)req).FailCallback != null)
5741+
((GetStopwordListStatusRequest)req).FailCallback(resp.Error, customData);
5742+
}
5743+
}
5744+
56525745
/// <summary>
56535746
/// Delete a custom stopword list.
56545747
///

0 commit comments

Comments
 (0)