Skip to content

Commit c30bdf6

Browse files
authored
Merge pull request #530 from watson-developer-cloud/feature-v3-separate-core
Separate core from services
2 parents ac24c36 + e61e390 commit c30bdf6

File tree

242 files changed

+620
-15568
lines changed

Some content is hidden

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

242 files changed

+620
-15568
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "Core"]
2+
path = Core
3+
url = [email protected]:mediumTaj/IBM.Cloud.SDK.Unity.git

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ rvm:
99
cache:
1010
directories:
1111
- ./Unity
12+
git:
13+
submodules: false
1214
before_install:
15+
# Use sed to replace the SSH URL with the public URL, then initialize submodules
16+
- sed -i -e 's/[email protected]:/https:\/\/github.com\//' .gitmodules
17+
- git submodule update --init --recursive
1318
- chmod a+x ./Travis/installUnity.sh
1419
- npm install -g [email protected]
1520
install:

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);

Common/Common.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ namespace IBM.Watson
2323
{
2424
public class Common : MonoBehaviour
2525
{
26+
/// <summary>
27+
/// The SDK version.
28+
/// </summary>
2629
public const string Version = "watson-apis-unity-sdk-2.12.0";
2730
/// <summary>
31+
/// Tracking for onboarding.
32+
/// </summary>
33+
public const string TrackingQueryParam = "target=/developer/watson&cm_sp=WatsonPlatform-WatsonServices-_-OnPageNavLink-IBMWatson_SDKs-_-Unity";
34+
/// <summary>
2835
/// Returns a set of default headers to use with each request.
2936
/// </summary>
3037
/// <param name="serviceName">The service name to be used in X-IBMCloud-SDK-Analytics header.</param>

Core

Submodule Core added at 21800ad

Core/BaseService.cs

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

Core/CallbackDelegates.cs

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

Core/CallbackDelegates.cs.meta

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

Core/Connection.meta

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

0 commit comments

Comments
 (0)