@@ -138,11 +138,8 @@ public AssistantService(string versionDate, Credentials credentials) : base(vers
138
138
/// [documentation](https://console.bluemix.net/docs/services/assistant/assistant-add.html#assistant-add-task).
139
139
///
140
140
/// **Note:** Currently, the v2 API does not support creating assistants.</param>
141
- /// <param name="customData">A Dictionary<string, object> of data that will be passed to the callback. The raw
142
- /// json output from the REST call will be passed in this object as the value of the 'json'
143
- /// key.</string></param>
144
141
/// <returns><see cref="SessionResponse" />SessionResponse</returns>
145
- public bool CreateSession ( Callback < SessionResponse > callback , string assistantId , Dictionary < string , object > customData = null )
142
+ public bool CreateSession ( Callback < SessionResponse > callback , string assistantId )
146
143
{
147
144
if ( callback == null )
148
145
throw new ArgumentNullException ( "`callback` is required for `CreateSession`" ) ;
@@ -153,18 +150,16 @@ public bool CreateSession(Callback<SessionResponse> callback, string assistantId
153
150
{
154
151
Callback = callback ,
155
152
HttpMethod = UnityWebRequest . kHttpVerbPOST ,
156
- DisableSslVerification = DisableSslVerification ,
157
- CustomData = customData == null ? new Dictionary < string , object > ( ) : customData
153
+ DisableSslVerification = DisableSslVerification
158
154
} ;
159
155
160
- if ( req . CustomData . ContainsKey ( Constants . String . CUSTOM_REQUEST_HEADERS ) )
156
+ foreach ( KeyValuePair < string , string > kvp in customRequestHeaders )
161
157
{
162
- foreach ( KeyValuePair < string , string > kvp in req . CustomData [ Constants . String . CUSTOM_REQUEST_HEADERS ] as Dictionary < string , string > )
163
- {
164
- req . Headers . Add ( kvp . Key , kvp . Value ) ;
165
- }
158
+ req . Headers . Add ( kvp . Key , kvp . Value ) ;
166
159
}
167
160
161
+ ClearCustomRequestHeaders ( ) ;
162
+
168
163
foreach ( KeyValuePair < string , string > kvp in Common . GetSdkHeaders ( "conversation" , "V2" , "CreateSession" ) )
169
164
{
170
165
req . Headers . Add ( kvp . Key , kvp . Value ) ;
@@ -219,11 +214,8 @@ private void OnCreateSessionResponse(RESTConnector.Request req, RESTConnector.Re
219
214
///
220
215
/// **Note:** Currently, the v2 API does not support creating assistants.</param>
221
216
/// <param name="sessionId">Unique identifier of the session.</param>
222
- /// <param name="customData">A Dictionary<string, object> of data that will be passed to the callback. The raw
223
- /// json output from the REST call will be passed in this object as the value of the 'json'
224
- /// key.</string></param>
225
217
/// <returns><see cref="object" />object</returns>
226
- public bool DeleteSession ( Callback < object > callback , string assistantId , string sessionId , Dictionary < string , object > customData = null )
218
+ public bool DeleteSession ( Callback < object > callback , string assistantId , string sessionId )
227
219
{
228
220
if ( callback == null )
229
221
throw new ArgumentNullException ( "`callback` is required for `DeleteSession`" ) ;
@@ -236,18 +228,16 @@ public bool DeleteSession(Callback<object> callback, string assistantId, string
236
228
{
237
229
Callback = callback ,
238
230
HttpMethod = UnityWebRequest . kHttpVerbDELETE ,
239
- DisableSslVerification = DisableSslVerification ,
240
- CustomData = customData == null ? new Dictionary < string , object > ( ) : customData
231
+ DisableSslVerification = DisableSslVerification
241
232
} ;
242
233
243
- if ( req . CustomData . ContainsKey ( Constants . String . CUSTOM_REQUEST_HEADERS ) )
234
+ foreach ( KeyValuePair < string , string > kvp in customRequestHeaders )
244
235
{
245
- foreach ( KeyValuePair < string , string > kvp in req . CustomData [ Constants . String . CUSTOM_REQUEST_HEADERS ] as Dictionary < string , string > )
246
- {
247
- req . Headers . Add ( kvp . Key , kvp . Value ) ;
248
- }
236
+ req . Headers . Add ( kvp . Key , kvp . Value ) ;
249
237
}
250
238
239
+ ClearCustomRequestHeaders ( ) ;
240
+
251
241
foreach ( KeyValuePair < string , string > kvp in Common . GetSdkHeaders ( "conversation" , "V2" , "DeleteSession" ) )
252
242
{
253
243
req . Headers . Add ( kvp . Key , kvp . Value ) ;
@@ -308,11 +298,8 @@ private void OnDeleteSessionResponse(RESTConnector.Request req, RESTConnector.Re
308
298
/// <param name="context">State information for the conversation. The context is stored by the assistant on a
309
299
/// per-session basis. You can use this property to set or modify context variables, which can also be accessed
310
300
/// by dialog nodes. (optional)</param>
311
- /// <param name="customData">A Dictionary<string, object> of data that will be passed to the callback. The raw
312
- /// json output from the REST call will be passed in this object as the value of the 'json'
313
- /// key.</string></param>
314
301
/// <returns><see cref="MessageResponse" />MessageResponse</returns>
315
- public bool Message ( Callback < MessageResponse > callback , string assistantId , string sessionId , Dictionary < string , object > customData = null , MessageInput input = null , MessageContext context = null )
302
+ public bool Message ( Callback < MessageResponse > callback , string assistantId , string sessionId , MessageInput input = null , MessageContext context = null )
316
303
{
317
304
if ( callback == null )
318
305
throw new ArgumentNullException ( "`callback` is required for `Message`" ) ;
@@ -325,18 +312,16 @@ public bool Message(Callback<MessageResponse> callback, string assistantId, stri
325
312
{
326
313
Callback = callback ,
327
314
HttpMethod = UnityWebRequest . kHttpVerbPOST ,
328
- DisableSslVerification = DisableSslVerification ,
329
- CustomData = customData == null ? new Dictionary < string , object > ( ) : customData
315
+ DisableSslVerification = DisableSslVerification
330
316
} ;
331
317
332
- if ( req . CustomData . ContainsKey ( Constants . String . CUSTOM_REQUEST_HEADERS ) )
318
+ foreach ( KeyValuePair < string , string > kvp in customRequestHeaders )
333
319
{
334
- foreach ( KeyValuePair < string , string > kvp in req . CustomData [ Constants . String . CUSTOM_REQUEST_HEADERS ] as Dictionary < string , string > )
335
- {
336
- req . Headers . Add ( kvp . Key , kvp . Value ) ;
337
- }
320
+ req . Headers . Add ( kvp . Key , kvp . Value ) ;
338
321
}
339
322
323
+ ClearCustomRequestHeaders ( ) ;
324
+
340
325
foreach ( KeyValuePair < string , string > kvp in Common . GetSdkHeaders ( "conversation" , "V2" , "Message" ) )
341
326
{
342
327
req . Headers . Add ( kvp . Key , kvp . Value ) ;
0 commit comments