Skip to content

Commit ed1acb9

Browse files
committed
feat: Regenerated the SDK based on the lateset definitions and unity generator
1 parent 865ab3d commit ed1acb9

File tree

761 files changed

+45986
-1539
lines changed

Some content is hidden

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

761 files changed

+45986
-1539
lines changed

Diff for: Assistant/v2/Assistant.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
using System.Text;
2626
using UnityEngine.Networking;
2727

28-
namespace IBM.Watson.Assistant.V2
28+
namespace IBM.Watson.Assistant.V2.Handwritten
2929
{
3030
public class AssistantService
3131
{

Diff for: Assistant/v2/Models/CaptureGroup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using System.Collections.Generic;
1919
using Newtonsoft.Json;
2020

21-
namespace IBM.Watson.Assistant.V2.Model
21+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2222
{
2323
/// <summary>
2424
/// CaptureGroup.

Diff for: Assistant/v2/Models/DialogLogMessage.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// Dialog log message details.

Diff for: Assistant/v2/Models/DialogNodeAction.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// DialogNodeAction.

Diff for: Assistant/v2/Models/DialogNodeOutputOptionsElement.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// DialogNodeOutputOptionsElement.

Diff for: Assistant/v2/Models/DialogNodeOutputOptionsElementValue.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// An object defining the message input to be sent to the assistant if the user selects the corresponding option.

Diff for: Assistant/v2/Models/DialogNodesVisited.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// DialogNodesVisited.

Diff for: Assistant/v2/Models/DialogRuntimeResponseGeneric.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using System.Collections.Generic;
1919
using Newtonsoft.Json;
2020

21-
namespace IBM.Watson.Assistant.V2.Model
21+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2222
{
2323
/// <summary>
2424
/// DialogRuntimeResponseGeneric.

Diff for: Assistant/v2/Models/DialogSuggestion.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// DialogSuggestion.

Diff for: Assistant/v2/Models/DialogSuggestionValue.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// An object defining the message input to be sent to the assistant if the user selects the corresponding

Diff for: Assistant/v2/Models/MessageContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// State information for the conversation.

Diff for: Assistant/v2/Models/MessageContextGlobal.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// Contains information that can be shared by all skills within the Assistant.

Diff for: Assistant/v2/Models/MessageContextGlobalSystem.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// Properties that are shared by all skills used by the assistant.

Diff for: Assistant/v2/Models/MessageContextSkill.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using Newtonsoft.Json.Linq;
1919
using System.Collections.Generic;
2020

21-
namespace IBM.Watson.Assistant.V2.Model
21+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2222
{
2323
/// <summary>
2424
/// Contains information specific to particular skills within the Assistant.

Diff for: Assistant/v2/Models/MessageContextSkills.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using System.Collections.Generic;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// Contains information specific to particular skills within the Assistant.

Diff for: Assistant/v2/Models/MessageInput.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using System.Collections.Generic;
1919
using Newtonsoft.Json;
2020

21-
namespace IBM.Watson.Assistant.V2.Model
21+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2222
{
2323
/// <summary>
2424
/// An input object that includes the input text.

Diff for: Assistant/v2/Models/MessageInputOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// Optional properties that control how the assistant responds.

Diff for: Assistant/v2/Models/MessageOutput.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using System.Collections.Generic;
1919
using Newtonsoft.Json;
2020

21-
namespace IBM.Watson.Assistant.V2.Model
21+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2222
{
2323
/// <summary>
2424
/// Assistant output to be rendered or processed by the client.

Diff for: Assistant/v2/Models/MessageOutputDebug.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using System.Collections.Generic;
1919
using Newtonsoft.Json;
2020

21-
namespace IBM.Watson.Assistant.V2.Model
21+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2222
{
2323
/// <summary>
2424
/// Additional detailed information about a message response and how it was generated.

Diff for: Assistant/v2/Models/MessageRequest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// A request formatted for the Watson Assistant service.

Diff for: Assistant/v2/Models/MessageResponse.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// A response from the Watson Assistant service.

Diff for: Assistant/v2/Models/RuntimeEntity.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
using Newtonsoft.Json;
2020
using Newtonsoft.Json.Linq;
2121

22-
namespace IBM.Watson.Assistant.V2.Model
22+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2323
{
2424
/// <summary>
2525
/// A term from the request that was identified as an entity.

Diff for: Assistant/v2/Models/RuntimeIntent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// An intent identified in the user input.

Diff for: Assistant/v2/Models/SessionResponse.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
using Newtonsoft.Json;
1919

20-
namespace IBM.Watson.Assistant.V2.Model
20+
namespace IBM.Watson.Assistant.V2.Model.Handwritten
2121
{
2222
/// <summary>
2323
/// SessionResponse.

Diff for: Core/BaseService.cs

+45-10
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,65 @@
1515
*
1616
*/
1717

18+
using IBM.Cloud.SDK.Utilities;
1819
using System;
19-
using System.Collections.Generic;
20-
using System.Linq;
21-
using System.Text;
22-
using System.Threading.Tasks;
2320

2421
namespace IBM.Cloud.SDK
2522
{
2623
public class BaseService
2724
{
25+
protected Credentials credentials;
26+
protected string url;
27+
2828
public BaseService(string serviceId)
2929
{
30+
var credentialsPaths = Utility.GetCredentialsPaths();
31+
if (credentialsPaths.Count > 0)
32+
{
33+
foreach (string path in credentialsPaths)
34+
{
35+
if (Utility.LoadEnvFile(path))
36+
{
37+
break;
38+
}
39+
}
3040

31-
}
41+
string ApiKey = Environment.GetEnvironmentVariable(serviceId.ToUpper() + "_APIKEY");
42+
string Username = Environment.GetEnvironmentVariable(serviceId.ToUpper() + "_USERNAME");
43+
string Password = Environment.GetEnvironmentVariable(serviceId.ToUpper() + "_PASSWORD");
44+
string ServiceUrl = Environment.GetEnvironmentVariable(serviceId.ToUpper() + "_URL");
3245

33-
public BaseService(string versionDate, string serviceId)
34-
{
46+
if (string.IsNullOrEmpty(ApiKey) && (string.IsNullOrEmpty(Username) || string.IsNullOrEmpty(Password)))
47+
{
48+
throw new NullReferenceException(string.Format("Either {0}_APIKEY or {0}_USERNAME and {0}_PASSWORD did not exist. Please add credentials with this key in ibm-credentials.env.", serviceId.ToUpper()));
49+
}
3550

36-
}
51+
if (!string.IsNullOrEmpty(ApiKey))
52+
{
53+
TokenOptions tokenOptions = new TokenOptions()
54+
{
55+
IamApiKey = ApiKey
56+
};
3757

38-
public BaseService(string versionDate, Credentials credentials, string serviceId)
39-
{
58+
credentials = new Credentials(tokenOptions, ServiceUrl);
59+
60+
if (string.IsNullOrEmpty(credentials.Url))
61+
{
62+
credentials.Url = url;
63+
}
64+
}
4065

66+
if (!string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password))
67+
{
68+
credentials = new Credentials(Username, Password, url);
69+
}
70+
}
4171
}
4272

73+
public BaseService(string versionDate, string serviceId) : this(serviceId) { }
74+
75+
public BaseService(string versionDate, Credentials credentials, string serviceId) { }
76+
77+
public BaseService(Credentials credentials, string serviceId) { }
4378
}
4479
}

Diff for: Core/Connection/RESTConnector.cs

+9-2
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,12 @@ public Form(int n)
122122
/// <param name="contents">The binary data.</param>
123123
/// <param name="fileName">The filename of the binary data.</param>
124124
/// <param name="mimeType">The mime type of the data.</param>
125-
public Form(byte[] contents, string fileName = null, string mimeType = null)
125+
public Form(System.IO.FileStream contents, string fileName = null, string mimeType = null)
126126
{
127127
IsBinary = true;
128-
Contents = contents;
128+
System.IO.MemoryStream ms = new System.IO.MemoryStream();
129+
contents.CopyTo(ms);
130+
Contents = ms.ToArray();
129131
FileName = fileName;
130132
MimeType = mimeType;
131133
}
@@ -491,6 +493,11 @@ private IEnumerator ProcessRequestQueue()
491493
url = url,
492494
method = req.HttpMethod
493495
};
496+
497+
if(req.HttpMethod == UnityWebRequest.kHttpVerbPOST)
498+
{
499+
unityWebRequest.SetRequestHeader("Content-Type", "application/json");
500+
}
494501
}
495502

496503
foreach (KeyValuePair<string, string> kvp in req.Headers)

0 commit comments

Comments
 (0)