Skip to content

Commit 1dcc5d2

Browse files
committed
feat(additionalProps): add support for dynamic additional properties for models
BREAKING CHANGE: add support for dynamic additional properties for models
1 parent c20297f commit 1dcc5d2

Some content is hidden

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

61 files changed

+105
-94
lines changed

Scripts/Services/Assistant/V1/Model/Context.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
*
1616
*/
1717

18+
using IBM.Cloud.SDK.Model;
1819
using Newtonsoft.Json;
19-
using Newtonsoft.Json.Linq;
2020

2121
namespace IBM.Watson.Assistant.V1.Model
2222
{
2323
/// <summary>
2424
/// State information for the conversation. To maintain state, include the context from the previous response.
2525
/// </summary>
26-
public class Context
26+
public class Context: DynamicModel<object>
2727
{
2828
/// <summary>
2929
/// The unique identifier of the conversation.
@@ -34,7 +34,7 @@ public class Context
3434
/// For internal use only.
3535
/// </summary>
3636
[JsonProperty("system", NullValueHandling = NullValueHandling.Ignore)]
37-
public JObject System { get; set; }
37+
public SystemResponse System { get; set; }
3838
/// <summary>
3939
/// Metadata related to the message.
4040
/// </summary>

Scripts/Services/Assistant/V1/Model/DialogNode.cs

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

1818
using System.Collections.Generic;
1919
using Newtonsoft.Json;
20-
using Newtonsoft.Json.Linq;
2120
using System;
2221

2322
namespace IBM.Watson.Assistant.V1.Model
@@ -226,7 +225,7 @@ public class DigressOutSlotsValue
226225
/// [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
227226
/// </summary>
228227
[JsonProperty("output", NullValueHandling = NullValueHandling.Ignore)]
229-
public JObject Output { get; set; }
228+
public DialogNodeOutput Output { get; set; }
230229
/// <summary>
231230
/// The context for the dialog node.
232231
/// </summary>

Scripts/Services/Assistant/V1/Model/DialogNodeOutput.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
using System.Collections.Generic;
19+
using IBM.Cloud.SDK.Model;
1920
using Newtonsoft.Json;
2021

2122
namespace IBM.Watson.Assistant.V1.Model
@@ -24,7 +25,7 @@ namespace IBM.Watson.Assistant.V1.Model
2425
/// The output of the dialog node. For more information about how to specify dialog node output, see the
2526
/// [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
2627
/// </summary>
27-
public class DialogNodeOutput
28+
public class DialogNodeOutput: DynamicModel<object>
2829
{
2930
/// <summary>
3031
/// An array of objects describing the output defined for the dialog node.

Scripts/Services/Assistant/V1/Model/DialogNodeOutputOptionsElementValue.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
using System.Collections.Generic;
1919
using Newtonsoft.Json;
20-
using Newtonsoft.Json.Linq;
2120

2221
namespace IBM.Watson.Assistant.V1.Model
2322
{
@@ -31,22 +30,22 @@ public class DialogNodeOutputOptionsElementValue
3130
/// An input object that includes the input text.
3231
/// </summary>
3332
[JsonProperty("input", NullValueHandling = NullValueHandling.Ignore)]
34-
public JObject Input { get; set; }
33+
public MessageInput Input { get; set; }
3534
/// <summary>
3635
/// An array of intents to be used while processing the input.
3736
///
3837
/// **Note:** This property is supported for backward compatibility with applications that use the v1 **Get
3938
/// response to user input** method.
4039
/// </summary>
4140
[JsonProperty("intents", NullValueHandling = NullValueHandling.Ignore)]
42-
public List<JObject> Intents { get; set; }
41+
public List<RuntimeIntent> Intents { get; set; }
4342
/// <summary>
4443
/// An array of entities to be used while processing the user input.
4544
///
4645
/// **Note:** This property is supported for backward compatibility with applications that use the v1 **Get
4746
/// response to user input** method.
4847
/// </summary>
4948
[JsonProperty("entities", NullValueHandling = NullValueHandling.Ignore)]
50-
public List<JObject> Entities { get; set; }
49+
public List<RuntimeEntity> Entities { get; set; }
5150
}
5251
}

Scripts/Services/Assistant/V1/Model/DialogSuggestion.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717

1818
using Newtonsoft.Json;
19-
using Newtonsoft.Json.Linq;
2019

2120
namespace IBM.Watson.Assistant.V1.Model
2221
{
@@ -42,7 +41,7 @@ public class DialogSuggestion
4241
/// corresponding option.
4342
/// </summary>
4443
[JsonProperty("output", NullValueHandling = NullValueHandling.Ignore)]
45-
public JObject Output { get; set; }
44+
public DialogSuggestionOutput Output { get; set; }
4645
/// <summary>
4746
/// The ID of the dialog node that the **label** property is taken from. The **label** property is populated
4847
/// using the value of the dialog node's **user_label** property.

Scripts/Services/Assistant/V1/Model/DialogSuggestionOutput.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
using System.Collections.Generic;
19+
using IBM.Cloud.SDK.Model;
1920
using Newtonsoft.Json;
2021

2122
namespace IBM.Watson.Assistant.V1.Model
@@ -24,7 +25,7 @@ namespace IBM.Watson.Assistant.V1.Model
2425
/// The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding
2526
/// option.
2627
/// </summary>
27-
public class DialogSuggestionOutput
28+
public class DialogSuggestionOutput: DynamicModel<object>
2829
{
2930
/// <summary>
3031
/// An array of the nodes that were triggered to create the response, in the order in which they were visited.

Scripts/Services/Assistant/V1/Model/DialogSuggestionValue.cs

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

1818
using System.Collections.Generic;
1919
using Newtonsoft.Json;
20-
using Newtonsoft.Json.Linq;
2120

2221
namespace IBM.Watson.Assistant.V1.Model
2322
{
@@ -31,7 +30,7 @@ public class DialogSuggestionValue
3130
/// An input object that includes the input text.
3231
/// </summary>
3332
[JsonProperty("input", NullValueHandling = NullValueHandling.Ignore)]
34-
public JObject Input { get; set; }
33+
public MessageInput Input { get; set; }
3534
/// <summary>
3635
/// An array of intents to be sent along with the user input.
3736
/// </summary>

Scripts/Services/Assistant/V1/Model/MessageInput.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515
*
1616
*/
1717

18+
using IBM.Cloud.SDK.Model;
1819
using Newtonsoft.Json;
1920

2021
namespace IBM.Watson.Assistant.V1.Model
2122
{
2223
/// <summary>
2324
/// An input object that includes the input text.
2425
/// </summary>
25-
public class MessageInput
26+
public class MessageInput: DynamicModel<object>
2627
{
2728
/// <summary>
2829
/// The text of the user input. This string cannot contain carriage return, newline, or tab characters.

Scripts/Services/Assistant/V1/Model/MessageRequest.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
using System.Collections.Generic;
1919
using Newtonsoft.Json;
20-
using Newtonsoft.Json.Linq;
2120

2221
namespace IBM.Watson.Assistant.V1.Model
2322
{
@@ -30,7 +29,7 @@ public class MessageRequest
3029
/// An input object that includes the input text.
3130
/// </summary>
3231
[JsonProperty("input", NullValueHandling = NullValueHandling.Ignore)]
33-
public JObject Input { get; set; }
32+
public MessageInput Input { get; set; }
3433
/// <summary>
3534
/// Intents to use when evaluating the user input. Include intents from the previous response to continue using
3635
/// those intents rather than trying to recognize intents in the new input.
@@ -52,13 +51,13 @@ public class MessageRequest
5251
/// State information for the conversation. To maintain state, include the context from the previous response.
5352
/// </summary>
5453
[JsonProperty("context", NullValueHandling = NullValueHandling.Ignore)]
55-
public JObject Context { get; set; }
54+
public Context Context { get; set; }
5655
/// <summary>
5756
/// An output object that includes the response to the user, the dialog nodes that were triggered, and messages
5857
/// from the log.
5958
/// </summary>
6059
[JsonProperty("output", NullValueHandling = NullValueHandling.Ignore)]
61-
public JObject Output { get; set; }
60+
public OutputData Output { get; set; }
6261
/// <summary>
6362
/// An array of objects describing any actions requested by the dialog node.
6463
/// </summary>

Scripts/Services/Assistant/V1/Model/MessageResponse.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
using System.Collections.Generic;
1919
using Newtonsoft.Json;
20-
using Newtonsoft.Json.Linq;
2120

2221
namespace IBM.Watson.Assistant.V1.Model
2322
{
@@ -30,7 +29,7 @@ public class MessageResponse
3029
/// An input object that includes the input text.
3130
/// </summary>
3231
[JsonProperty("input", NullValueHandling = NullValueHandling.Ignore)]
33-
public JObject Input { get; set; }
32+
public MessageInput Input { get; set; }
3433
/// <summary>
3534
/// An array of intents recognized in the user input, sorted in descending order of confidence.
3635
/// </summary>
@@ -50,13 +49,13 @@ public class MessageResponse
5049
/// State information for the conversation. To maintain state, include the context from the previous response.
5150
/// </summary>
5251
[JsonProperty("context", NullValueHandling = NullValueHandling.Ignore)]
53-
public JObject Context { get; set; }
52+
public Context Context { get; set; }
5453
/// <summary>
5554
/// An output object that includes the response to the user, the dialog nodes that were triggered, and messages
5655
/// from the log.
5756
/// </summary>
5857
[JsonProperty("output", NullValueHandling = NullValueHandling.Ignore)]
59-
public JObject Output { get; set; }
58+
public OutputData Output { get; set; }
6059
/// <summary>
6160
/// An array of objects describing any actions requested by the dialog node.
6261
/// </summary>

Scripts/Services/Assistant/V1/Model/OutputData.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
using System.Collections.Generic;
19+
using IBM.Cloud.SDK.Model;
1920
using Newtonsoft.Json;
2021

2122
namespace IBM.Watson.Assistant.V1.Model
@@ -24,7 +25,7 @@ namespace IBM.Watson.Assistant.V1.Model
2425
/// An output object that includes the response to the user, the dialog nodes that were triggered, and messages from
2526
/// the log.
2627
/// </summary>
27-
public class OutputData
28+
public class OutputData: DynamicModel<object>
2829
{
2930
/// <summary>
3031
/// An array of the nodes that were triggered to create the response, in the order in which they were visited.

Scripts/Services/Assistant/V1/Model/SystemResponse.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
*
1616
*/
1717

18+
using IBM.Cloud.SDK.Model;
19+
1820
namespace IBM.Watson.Assistant.V1.Model
1921
{
2022
/// <summary>
2123
/// For internal use only.
2224
/// </summary>
23-
public class SystemResponse
25+
public class SystemResponse: DynamicModel<object>
2426
{
2527
}
2628
}

Scripts/Services/Assistant/V2/Model/MessageContext.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717

1818
using Newtonsoft.Json;
19-
using Newtonsoft.Json.Linq;
2019

2120
namespace IBM.Watson.Assistant.V2.Model
2221
{
@@ -37,6 +36,6 @@ public class MessageContext
3736
/// that apply to the dialog skill used by the assistant.
3837
/// </summary>
3938
[JsonProperty("skills", NullValueHandling = NullValueHandling.Ignore)]
40-
public JObject Skills { get; set; }
39+
public MessageContextSkills Skills { get; set; }
4140
}
4241
}

Scripts/Services/Assistant/V2/Model/MessageContextSkills.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*
1616
*/
1717

18+
using IBM.Cloud.SDK.Model;
19+
using Newtonsoft.Json;
20+
1821
namespace IBM.Watson.Assistant.V2.Model
1922
{
2023
/// <summary>
@@ -23,7 +26,15 @@ namespace IBM.Watson.Assistant.V2.Model
2326
/// **Note:** Currently, only a single property named `main skill` is supported. This object contains variables that
2427
/// apply to the dialog skill used by the assistant.
2528
/// </summary>
26-
public class MessageContextSkills
29+
public class MessageContextSkills: DynamicModel<MessageContextSkill>
2730
{
31+
/// <summary>
32+
/// Information specific to particular skills used by the Assistant.
33+
///
34+
/// **Note:** Currently, only a single property named `main skill` is supported. This object contains variables
35+
/// that apply to the dialog skill used by the assistant.
36+
/// </summary>
37+
[JsonProperty("main skill", NullValueHandling = NullValueHandling.Ignore)]
38+
public MessageContextSkill Skill { get; set; }
2839
}
2940
}

Scripts/Services/Assistant/V2/Model/SearchResult.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717

1818
using Newtonsoft.Json;
19-
using Newtonsoft.Json.Linq;
2019

2120
namespace IBM.Watson.Assistant.V2.Model
2221
{
@@ -60,6 +59,6 @@ public class SearchResult
6059
/// <em> tags.
6160
/// </summary>
6261
[JsonProperty("highlight", NullValueHandling = NullValueHandling.Ignore)]
63-
public JObject Highlight { get; set; }
62+
public SearchResultHighlight Highlight { get; set; }
6463
}
6564
}

Scripts/Services/Assistant/V2/Model/SearchResultHighlight.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
using System.Collections.Generic;
19+
using IBM.Cloud.SDK.Model;
1920
using Newtonsoft.Json;
2021

2122
namespace IBM.Watson.Assistant.V2.Model
@@ -24,7 +25,7 @@ namespace IBM.Watson.Assistant.V2.Model
2425
/// An object containing segments of text from search results with query-matching text highlighted using HTML <em>
2526
/// tags.
2627
/// </summary>
27-
public class SearchResultHighlight
28+
public class SearchResultHighlight: DynamicModel<List<string>>
2829
{
2930
/// <summary>
3031
/// An array of strings containing segments taken from body text in the search results, with query-matching

Scripts/Services/Discovery/V1/Model/AggregationResult.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace IBM.Watson.Discovery.V1.Model
2222
{
2323
/// <summary>
24-
/// AggregationResult.
24+
/// Aggregation results for the specified query.
2525
/// </summary>
2626
public class AggregationResult
2727
{

Scripts/Services/Discovery/V1/Model/Collection.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public class StatusValue
8888
[JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
8989
public string Language { get; set; }
9090
/// <summary>
91-
/// Gets or Sets DocumentCounts
91+
/// Object containing collection document count information.
9292
/// </summary>
9393
[JsonProperty("document_counts", NullValueHandling = NullValueHandling.Ignore)]
9494
public DocumentCounts DocumentCounts { get; set; }
@@ -98,7 +98,7 @@ public class StatusValue
9898
[JsonProperty("disk_usage", NullValueHandling = NullValueHandling.Ignore)]
9999
public CollectionDiskUsage DiskUsage { get; set; }
100100
/// <summary>
101-
/// Gets or Sets TrainingStatus
101+
/// Training status details.
102102
/// </summary>
103103
[JsonProperty("training_status", NullValueHandling = NullValueHandling.Ignore)]
104104
public TrainingStatus TrainingStatus { get; set; }

Scripts/Services/Discovery/V1/Model/CredentialsList.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace IBM.Watson.Discovery.V1.Model
2222
{
2323
/// <summary>
24-
/// CredentialsList.
24+
/// Object containing array of credential definitions.
2525
/// </summary>
2626
public class CredentialsList
2727
{

Scripts/Services/Discovery/V1/Model/DeleteCollectionResponse.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace IBM.Watson.Discovery.V1.Model
2121
{
2222
/// <summary>
23-
/// DeleteCollectionResponse.
23+
/// Response object returned when deleting a colleciton.
2424
/// </summary>
2525
public class DeleteCollectionResponse
2626
{

Scripts/Services/Discovery/V1/Model/DeleteConfigurationResponse.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace IBM.Watson.Discovery.V1.Model
2222
{
2323
/// <summary>
24-
/// DeleteConfigurationResponse.
24+
/// Information returned when a configuration is deleted.
2525
/// </summary>
2626
public class DeleteConfigurationResponse
2727
{

0 commit comments

Comments
 (0)