Skip to content

Commit f5f4791

Browse files
committed
feat(Core): Separated core from the services
1 parent 1174348 commit f5f4791

File tree

227 files changed

+313
-15330
lines changed

Some content is hidden

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

227 files changed

+313
-15330
lines changed

Assistant/v2/Assistant.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public AssistantService(Credentials credentials)
9494
}
9595
else
9696
{
97-
throw new WatsonException("Please provide a username and password or authorization token to use the Assistant service. For more information, see https://github.com/watson-developer-cloud/unity-sdk/#configuring-your-service-credentials");
97+
throw new IBMException("Please provide a username and password or authorization token to use the Assistant service. For more information, see https://github.com/watson-developer-cloud/unity-sdk/#configuring-your-service-credentials");
9898
}
9999
}
100100

@@ -155,7 +155,7 @@ public bool CreateSession(Callback<SessionResponse> callback, String assistantId
155155

156156
private void OnCreateSessionResponse(RESTConnector.Request req, RESTConnector.Response resp)
157157
{
158-
WatsonResponse<SessionResponse> response = new WatsonResponse<SessionResponse>
158+
DetailedResponse<SessionResponse> response = new DetailedResponse<SessionResponse>
159159
{
160160
Result = new SessionResponse()
161161
};
@@ -168,14 +168,14 @@ private void OnCreateSessionResponse(RESTConnector.Request req, RESTConnector.Re
168168
fsResult r = fsJsonParser.Parse(Encoding.UTF8.GetString(resp.Data), out data);
169169
if (!r.Succeeded)
170170
{
171-
throw new WatsonException(r.FormattedMessages);
171+
throw new IBMException(r.FormattedMessages);
172172
}
173173

174174
object obj = response.Result;
175175
r = serializer.TryDeserialize(data, obj.GetType(), ref obj);
176176
if (!r.Succeeded)
177177
{
178-
throw new WatsonException(r.FormattedMessages);
178+
throw new IBMException(r.FormattedMessages);
179179
}
180180

181181
customData.Add("json", data);
@@ -252,7 +252,7 @@ public bool DeleteSession(Callback<object> callback, String assistantId, String
252252

253253
private void OnDeleteSessionResponse(RESTConnector.Request req, RESTConnector.Response resp)
254254
{
255-
WatsonResponse<object> response = new WatsonResponse<object>
255+
DetailedResponse<object> response = new DetailedResponse<object>
256256
{
257257
Result = new object()
258258
};
@@ -265,14 +265,14 @@ private void OnDeleteSessionResponse(RESTConnector.Request req, RESTConnector.Re
265265
fsResult r = fsJsonParser.Parse(Encoding.UTF8.GetString(resp.Data), out data);
266266
if (!r.Succeeded)
267267
{
268-
throw new WatsonException(r.FormattedMessages);
268+
throw new IBMException(r.FormattedMessages);
269269
}
270270

271271
object obj = response.Result;
272272
r = serializer.TryDeserialize(data, obj.GetType(), ref obj);
273273
if (!r.Succeeded)
274274
{
275-
throw new WatsonException(r.FormattedMessages);
275+
throw new IBMException(r.FormattedMessages);
276276
}
277277

278278
customData.Add("json", data);
@@ -363,7 +363,7 @@ public bool Message(Callback<MessageResponse> callback, String assistantId, Stri
363363

364364
private void OnMessageResponse(RESTConnector.Request req, RESTConnector.Response resp)
365365
{
366-
WatsonResponse<MessageResponse> response = new WatsonResponse<MessageResponse>();
366+
DetailedResponse<MessageResponse> response = new DetailedResponse<MessageResponse>();
367367
response.Result = new MessageResponse();
368368
fsData data = null;
369369
Dictionary<string, object> customData = ((RequestObject<MessageResponse>)req).CustomData;
@@ -378,14 +378,14 @@ private void OnMessageResponse(RESTConnector.Request req, RESTConnector.Response
378378
fsResult r = fsJsonParser.Parse(Encoding.UTF8.GetString(resp.Data), out data);
379379
if (!r.Succeeded)
380380
{
381-
throw new WatsonException(r.FormattedMessages);
381+
throw new IBMException(r.FormattedMessages);
382382
}
383383

384384
object obj = response.Result;
385385
r = serializer.TryDeserialize(data, obj.GetType(), ref obj);
386386
if (!r.Succeeded)
387387
{
388-
throw new WatsonException(r.FormattedMessages);
388+
throw new IBMException(r.FormattedMessages);
389389
}
390390

391391
customData.Add("json", data);

Core/BaseService.cs

Lines changed: 0 additions & 79 deletions
This file was deleted.

Core/BaseService.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

Core/CallbackDelegates.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

Core/Connection.meta

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)