Skip to content

Commit

Permalink
feat: Regenerate service using current api defs
Browse files Browse the repository at this point in the history
  • Loading branch information
mamoonraja committed Feb 13, 2020
1 parent 7a4c8bb commit 0b0c0a4
Show file tree
Hide file tree
Showing 14 changed files with 347 additions and 199 deletions.
16 changes: 14 additions & 2 deletions Scripts/Services/CompareComply/V1/CompareComplyService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2018, 2020.
* Copyright 2018, 2019 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.
Expand Down Expand Up @@ -72,6 +72,7 @@ public CompareComplyService(string versionDate) : this(versionDate, ConfigBasedA
public CompareComplyService(string versionDate, Authenticator authenticator) : base(versionDate, authenticator, serviceId)
{
Authenticator = authenticator;

if (string.IsNullOrEmpty(versionDate))
{
throw new ArgumentNullException("A versionDate (format `yyyy-mm-dd`) is required to create an instance of CompareComplyService");
Expand All @@ -81,7 +82,6 @@ public CompareComplyService(string versionDate, Authenticator authenticator) : b
VersionDate = versionDate;
}


if (string.IsNullOrEmpty(GetServiceUrl()))
{
SetServiceUrl(defaultServiceUrl);
Expand Down Expand Up @@ -142,6 +142,7 @@ public bool ConvertToHtml(Callback<HTMLReturn> callback, System.IO.MemoryStream

Connector.URL = GetServiceUrl() + "/v1/html_conversion";
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -223,6 +224,7 @@ public bool ClassifyElements(Callback<ClassifyReturn> callback, System.IO.Memory

Connector.URL = GetServiceUrl() + "/v1/element_classification";
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -304,6 +306,7 @@ public bool ExtractTables(Callback<TableReturn> callback, System.IO.MemoryStream

Connector.URL = GetServiceUrl() + "/v1/tables";
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -403,6 +406,7 @@ public bool CompareDocuments(Callback<CompareReturn> callback, System.IO.MemoryS

Connector.URL = GetServiceUrl() + "/v1/comparison";
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -486,6 +490,7 @@ public bool AddFeedback(Callback<FeedbackReturn> callback, FeedbackDataInput fee

Connector.URL = GetServiceUrl() + "/v1/feedback";
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -654,6 +659,7 @@ public bool ListFeedback(Callback<FeedbackList> callback, string feedbackType =

Connector.URL = GetServiceUrl() + "/v1/feedback";
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -729,6 +735,7 @@ public bool GetFeedback(Callback<GetFeedback> callback, string feedbackId, strin

Connector.URL = GetServiceUrl() + string.Format("/v1/feedback/{0}", feedbackId);
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -804,6 +811,7 @@ public bool DeleteFeedback(Callback<FeedbackDeleted> callback, string feedbackId

Connector.URL = GetServiceUrl() + string.Format("/v1/feedback/{0}", feedbackId);
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -939,6 +947,7 @@ public bool CreateBatch(Callback<BatchStatus> callback, string function, System.

Connector.URL = GetServiceUrl() + "/v1/batches";
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -1003,6 +1012,7 @@ public bool ListBatches(Callback<Batches> callback)

Connector.URL = GetServiceUrl() + "/v1/batches";
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -1070,6 +1080,7 @@ public bool GetBatch(Callback<BatchStatus> callback, string batchId)

Connector.URL = GetServiceUrl() + string.Format("/v1/batches/{0}", batchId);
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -1153,6 +1164,7 @@ public bool UpdateBatch(Callback<BatchStatus> callback, string batchId, string a

Connector.URL = GetServiceUrl() + string.Format("/v1/batches/{0}", batchId);
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down
Loading

0 comments on commit 0b0c0a4

Please sign in to comment.