Skip to content

Commit

Permalink
feat: regenrate all of the services with current api defs
Browse files Browse the repository at this point in the history
  • Loading branch information
mamoonraja committed Jan 16, 2020
1 parent 0433887 commit c090ef5
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 272 deletions.
57 changes: 7 additions & 50 deletions Scripts/Services/Assistant/V1/AssistantService.cs

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions Scripts/Services/Assistant/V2/AssistantService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
* (C) Copyright IBM Corp. 2018, 2020.
*
* 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,7 +72,6 @@ public AssistantService(string versionDate) : this(versionDate, ConfigBasedAuthe
public AssistantService(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 AssistantService");
Expand All @@ -82,6 +81,7 @@ public AssistantService(string versionDate, Authenticator authenticator) : base(
VersionDate = versionDate;
}


if (string.IsNullOrEmpty(GetServiceUrl()))
{
SetServiceUrl(defaultServiceUrl);
Expand Down Expand Up @@ -136,7 +136,6 @@ public bool CreateSession(Callback<SessionResponse> callback, string assistantId

Connector.URL = GetServiceUrl() + string.Format("/v2/assistants/{0}/sessions", assistantId);
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -214,7 +213,6 @@ public bool DeleteSession(Callback<object> callback, string assistantId, string

Connector.URL = GetServiceUrl() + string.Format("/v2/assistants/{0}/sessions/{1}", assistantId, sessionId);
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -305,7 +303,6 @@ public bool Message(Callback<MessageResponse> callback, string assistantId, stri

Connector.URL = GetServiceUrl() + string.Format("/v2/assistants/{0}/sessions/{1}/message", assistantId, sessionId);
Authenticator.Authenticate(Connector);

return Connector.Send(req);
}

Expand Down Expand Up @@ -334,4 +331,4 @@ private void OnMessageResponse(RESTConnector.Request req, RESTConnector.Response
((RequestObject<MessageResponse>)req).Callback(response, resp.Error);
}
}
}
}
7 changes: 6 additions & 1 deletion Scripts/Services/Assistant/V2/Model/MessageContextSkill.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
* (C) Copyright IBM Corp. 2018, 2020.
*
* 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 @@ -30,5 +30,10 @@ public class MessageContextSkill
/// </summary>
[JsonProperty("user_defined", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary<string, object> UserDefined { get; set; }
/// <summary>
/// For internal use only.
/// </summary>
[JsonProperty("system", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary<string, object> System { get; set; }
}
}
18 changes: 3 additions & 15 deletions Scripts/Services/CompareComply/V1/CompareComplyService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
* (C) Copyright IBM Corp. 2018, 2020.
*
* 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,7 +72,6 @@ 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 @@ -82,6 +81,7 @@ public CompareComplyService(string versionDate, Authenticator authenticator) : b
VersionDate = versionDate;
}


if (string.IsNullOrEmpty(GetServiceUrl()))
{
SetServiceUrl(defaultServiceUrl);
Expand Down Expand Up @@ -142,7 +142,6 @@ 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 @@ -224,7 +223,6 @@ 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 @@ -306,7 +304,6 @@ 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 @@ -406,7 +403,6 @@ 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 @@ -490,7 +486,6 @@ public bool AddFeedback(Callback<FeedbackReturn> callback, FeedbackDataInput fee

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

return Connector.Send(req);
}

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

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

return Connector.Send(req);
}

Expand Down Expand Up @@ -735,7 +729,6 @@ 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 @@ -811,7 +804,6 @@ 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 @@ -947,7 +939,6 @@ 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 @@ -1012,7 +1003,6 @@ public bool ListBatches(Callback<Batches> callback)

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

return Connector.Send(req);
}

Expand Down Expand Up @@ -1080,7 +1070,6 @@ 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 @@ -1164,7 +1153,6 @@ 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 Expand Up @@ -1193,4 +1181,4 @@ private void OnUpdateBatchResponse(RESTConnector.Request req, RESTConnector.Resp
((RequestObject<BatchStatus>)req).Callback(response, resp.Error);
}
}
}
}
Loading

0 comments on commit c090ef5

Please sign in to comment.