Skip to content

Commit

Permalink
feat: Regenerate SDK including new Discovery features
Browse files Browse the repository at this point in the history
  • Loading branch information
mediumTaj committed Oct 8, 2018
1 parent 945ed4e commit f6d55f5
Show file tree
Hide file tree
Showing 54 changed files with 1,872 additions and 1,520 deletions.
362 changes: 182 additions & 180 deletions src/IBM.WatsonDeveloperCloud.Assistant.v1/AssistantService.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@
<Version>2.9.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\IBM.WatsonDeveloperCloud\IBM.WatsonDeveloperCloud.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public enum DigressOutSlotsEnum
/// [documentation](https://console.bluemix.net/docs/services/conversation/dialog-overview.html#complex).
/// </summary>
[JsonProperty("output", NullValueHandling = NullValueHandling.Ignore)]
public dynamic Output { get; set; }
public DialogNodeOutput Output { get; set; }
/// <summary>
/// The context for the dialog node.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public enum DigressOutSlotsEnum
/// [documentation](https://console.bluemix.net/docs/services/conversation/dialog-overview.html#complex).
/// </summary>
[JsonProperty("output", NullValueHandling = NullValueHandling.Ignore)]
public dynamic Output { get; set; }
public DialogNodeOutput Output { get; set; }
/// <summary>
/// The context (if defined) for the dialog node.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class DialogNodeOutputOptionsElementValue : BaseModel
/// The user input.
/// </summary>
[JsonProperty("input", NullValueHandling = NullValueHandling.Ignore)]
public dynamic Input { get; set; }
public InputData Input { get; set; }
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class DialogSuggestionValue : BaseModel
/// The user input.
/// </summary>
[JsonProperty("input", NullValueHandling = NullValueHandling.Ignore)]
public dynamic Input { get; set; }
public InputData Input { get; set; }
/// <summary>
/// An array of intents to be sent along with the user input.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class MessageRequest : BaseModel
/// An input object that includes the input text.
/// </summary>
[JsonProperty("input", NullValueHandling = NullValueHandling.Ignore)]
public dynamic Input { get; set; }
public InputData Input { get; set; }
/// <summary>
/// Whether to return more than one intent. Set to `true` to return all matching intents.
/// </summary>
Expand All @@ -40,7 +40,7 @@ public class MessageRequest : BaseModel
/// previous response.
/// </summary>
[JsonProperty("context", NullValueHandling = NullValueHandling.Ignore)]
public dynamic Context { get; set; }
public Context Context { get; set; }
/// <summary>
/// Entities to use when evaluating the message. Include entities from the previous response to continue using
/// those entities rather than detecting entities in the new input.
Expand All @@ -58,7 +58,7 @@ public class MessageRequest : BaseModel
/// multiple requests.
/// </summary>
[JsonProperty("output", NullValueHandling = NullValueHandling.Ignore)]
public dynamic Output { get; set; }
public OutputData Output { get; set; }
}

}
30 changes: 16 additions & 14 deletions src/IBM.WatsonDeveloperCloud.Assistant.v2/AssistantService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public AssistantService() : base(SERVICE_NAME, URL)
this.Endpoint = URL;
}


public AssistantService(string userName, string password, string versionDate) : this()
{
if (string.IsNullOrEmpty(userName))
Expand All @@ -57,6 +58,7 @@ public AssistantService(string userName, string password, string versionDate) :

VersionDate = versionDate;
}


public AssistantService(TokenOptions options, string versionDate) : this()
{
Expand Down Expand Up @@ -112,14 +114,14 @@ public SessionResponse CreateSession(string assistantId, Dictionary<string, obje

try
{
IClient client;
if(_tokenManager == null)
IClient client = null;
if(_tokenManager != null)
{
client = this.Client.WithAuthentication(this.UserName, this.Password);
client = this.Client.WithAuthentication(_tokenManager.GetToken());
}
else
{
client = this.Client.WithAuthentication(_tokenManager.GetToken());
client = this.Client.WithAuthentication(this.UserName, this.Password);
}
var restRequest = client.PostAsync($"{this.Endpoint}/v2/assistants/{assistantId}/sessions");

Expand Down Expand Up @@ -166,14 +168,14 @@ public BaseModel DeleteSession(string assistantId, string sessionId, Dictionary<

try
{
IClient client;
if(_tokenManager == null)
IClient client = null;
if(_tokenManager != null)
{
client = this.Client.WithAuthentication(this.UserName, this.Password);
client = this.Client.WithAuthentication(_tokenManager.GetToken());
}
else
{
client = this.Client.WithAuthentication(_tokenManager.GetToken());
client = this.Client.WithAuthentication(this.UserName, this.Password);
}
var restRequest = client.DeleteAsync($"{this.Endpoint}/v2/assistants/{assistantId}/sessions/{sessionId}");

Expand Down Expand Up @@ -205,8 +207,8 @@ public BaseModel DeleteSession(string assistantId, string sessionId, Dictionary<
///
/// **Note:** Currently, the v2 API does not support creating assistants.</param>
/// <param name="sessionId">Unique identifier of the session.</param>
/// <param name="request">The message to be sent. This includes the user's input, along with optional intents,
/// entities, and context from the last response. (optional)</param>
/// <param name="request">The message to be sent. This includes the user's input, along with optional content
/// such as intents and entities. (optional)</param>
/// <param name="customData">Custom data object to pass data including custom request headers.</param>
/// <returns><see cref="MessageResponse" />MessageResponse</returns>
public MessageResponse Message(string assistantId, string sessionId, MessageRequest request = null, Dictionary<string, object> customData = null)
Expand All @@ -223,14 +225,14 @@ public MessageResponse Message(string assistantId, string sessionId, MessageRequ

try
{
IClient client;
if(_tokenManager == null)
IClient client = null;
if(_tokenManager != null)
{
client = this.Client.WithAuthentication(this.UserName, this.Password);
client = this.Client.WithAuthentication(_tokenManager.GetToken());
}
else
{
client = this.Client.WithAuthentication(_tokenManager.GetToken());
client = this.Client.WithAuthentication(this.UserName, this.Password);
}
var restRequest = client.PostAsync($"{this.Endpoint}/v2/assistants/{assistantId}/sessions/{sessionId}/message");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>IBM.WatsonDeveloperCloud.Assistant.v2 wraps the Watson Developer Cloud Assistant service (http://www.ibm.com/watson/developercloud/assistant.html)</Description>
<AssemblyTitle>IBM.WatsonDeveloperCloud.Assistant.v2</AssemblyTitle>
<VersionPrefix>2.8.0</VersionPrefix>
<VersionPrefix>2.9.0</VersionPrefix>
<Authors>Watson Developer Cloud</Authors>
<TargetFramework>netstandard1.3</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.Assistant.v2</AssemblyName>
Expand All @@ -12,7 +12,7 @@
<PackageIconUrl>https://watson-developer-cloud.github.io/dotnet-standard-sdk/img/Watson_Avatar_Pos_RGB.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/watson-developer-cloud/dotnet-standard-sdk</PackageProjectUrl>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<Version>2.8.0</Version>
<Version>2.9.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class MessageContext : BaseModel
/// Contains information specific to particular skills within the Assistant.
/// </summary>
[JsonProperty("skills", NullValueHandling = NullValueHandling.Ignore)]
public dynamic Skills { get; set; }
public MessageContextSkills Skills { get; set; }
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ public class MessageContextGlobalSystem : BaseModel
[JsonProperty("timezone", NullValueHandling = NullValueHandling.Ignore)]
public string Timezone { get; set; }
/// <summary>
/// String value provided by the API client that should be unique per each distinct end user of the service
/// powered by Assistant.
/// A string value that identifies the user who is interacting with the assistant. The client must provide a
/// unique identifier for each individual end user who accesses the application. This user ID may be used for
/// billing and other purposes.
/// </summary>
[JsonProperty("user_id", NullValueHandling = NullValueHandling.Ignore)]
public string UserId { get; set; }
/// <summary>
/// This property is normally set by the Assistant which sets this to 1 during the first conversation turn and
/// then increments it by 1 with every subsequent turn. A turn count equal to 0 (or > 0) informs the Assistant
/// that this is (or is not) the first turn in a conversation which influences the behavior of some skills. The
/// Conversation skill uses this to evaluate its `welcome` and `conversation_start` conditions.
/// A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that
/// this is the the first turn of a new conversation, which can affect the behavior of some skills.
/// </summary>
[JsonProperty("turn_count", NullValueHandling = NullValueHandling.Ignore)]
public long? TurnCount { get; set; }
Expand Down
Loading

0 comments on commit f6d55f5

Please sign in to comment.