16
16
*/
17
17
18
18
/**
19
- * IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-a45d89ef-20201209-153452
19
+ * IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-a45d89ef-20201221-120002
20
20
*/
21
21
22
22
using System . Collections . Generic ;
@@ -228,6 +228,92 @@ private void OnMessageResponse(RESTConnector.Request req, RESTConnector.Response
228
228
( ( RequestObject < MessageResponse > ) req ) . Callback ( response , resp . Error ) ;
229
229
}
230
230
231
+ /// <summary>
232
+ /// Identify intents and entities in multiple user utterances.
233
+ ///
234
+ /// Send multiple user inputs to a workspace in a single request and receive information about the intents and
235
+ /// entities recognized in each input. This method is useful for testing and comparing the performance of
236
+ /// different workspaces.
237
+ ///
238
+ /// This method is available only with Premium plans.
239
+ /// </summary>
240
+ /// <param name="callback">The callback function that is invoked when the operation completes.</param>
241
+ /// <param name="workspaceId">Unique identifier of the workspace.</param>
242
+ /// <param name="input">An array of input utterances to classify. (optional)</param>
243
+ /// <returns><see cref="BulkClassifyResponse" />BulkClassifyResponse</returns>
244
+ public bool BulkClassify ( Callback < BulkClassifyResponse > callback , string workspaceId , List < BulkClassifyUtterance > input = null )
245
+ {
246
+ if ( callback == null )
247
+ throw new ArgumentNullException ( "`callback` is required for `BulkClassify`" ) ;
248
+ if ( string . IsNullOrEmpty ( workspaceId ) )
249
+ throw new ArgumentNullException ( "`workspaceId` is required for `BulkClassify`" ) ;
250
+ if ( string . IsNullOrEmpty ( Version ) )
251
+ throw new ArgumentNullException ( "`Version` is required" ) ;
252
+
253
+ RequestObject < BulkClassifyResponse > req = new RequestObject < BulkClassifyResponse >
254
+ {
255
+ Callback = callback ,
256
+ HttpMethod = UnityWebRequest . kHttpVerbPOST ,
257
+ DisableSslVerification = DisableSslVerification
258
+ } ;
259
+
260
+ foreach ( KeyValuePair < string , string > kvp in customRequestHeaders )
261
+ {
262
+ req . Headers . Add ( kvp . Key , kvp . Value ) ;
263
+ }
264
+
265
+ ClearCustomRequestHeaders ( ) ;
266
+
267
+ foreach ( KeyValuePair < string , string > kvp in Common . GetSdkHeaders ( "conversation" , "V1" , "BulkClassify" ) )
268
+ {
269
+ req . Headers . Add ( kvp . Key , kvp . Value ) ;
270
+ }
271
+
272
+ if ( ! string . IsNullOrEmpty ( Version ) )
273
+ {
274
+ req . Parameters [ "version" ] = Version ;
275
+ }
276
+ req . Headers [ "Content-Type" ] = "application/json" ;
277
+ req . Headers [ "Accept" ] = "application/json" ;
278
+
279
+ JObject bodyObject = new JObject ( ) ;
280
+ if ( input != null && input . Count > 0 )
281
+ bodyObject [ "input" ] = JToken . FromObject ( input ) ;
282
+ req . Send = Encoding . UTF8 . GetBytes ( JsonConvert . SerializeObject ( bodyObject ) ) ;
283
+
284
+ req . OnResponse = OnBulkClassifyResponse ;
285
+
286
+ Connector . URL = GetServiceUrl ( ) + string . Format ( "/v1/workspaces/{0}/bulk_classify" , workspaceId ) ;
287
+ Authenticator . Authenticate ( Connector ) ;
288
+
289
+ return Connector . Send ( req ) ;
290
+ }
291
+
292
+ private void OnBulkClassifyResponse ( RESTConnector . Request req , RESTConnector . Response resp )
293
+ {
294
+ DetailedResponse < BulkClassifyResponse > response = new DetailedResponse < BulkClassifyResponse > ( ) ;
295
+ foreach ( KeyValuePair < string , string > kvp in resp . Headers )
296
+ {
297
+ response . Headers . Add ( kvp . Key , kvp . Value ) ;
298
+ }
299
+ response . StatusCode = resp . HttpResponseCode ;
300
+
301
+ try
302
+ {
303
+ string json = Encoding . UTF8 . GetString ( resp . Data ) ;
304
+ response . Result = JsonConvert . DeserializeObject < BulkClassifyResponse > ( json ) ;
305
+ response . Response = json ;
306
+ }
307
+ catch ( Exception e )
308
+ {
309
+ Log . Error ( "AssistantService.OnBulkClassifyResponse()" , "Exception: {0}" , e . ToString ( ) ) ;
310
+ resp . Success = false ;
311
+ }
312
+
313
+ if ( ( ( RequestObject < BulkClassifyResponse > ) req ) . Callback != null )
314
+ ( ( RequestObject < BulkClassifyResponse > ) req ) . Callback ( response , resp . Error ) ;
315
+ }
316
+
231
317
/// <summary>
232
318
/// List workspaces.
233
319
///
@@ -4665,91 +4751,5 @@ private void OnDeleteUserDataResponse(RESTConnector.Request req, RESTConnector.R
4665
4751
if ( ( ( RequestObject < object > ) req ) . Callback != null )
4666
4752
( ( RequestObject < object > ) req ) . Callback ( response , resp . Error ) ;
4667
4753
}
4668
-
4669
- /// <summary>
4670
- /// Identify intents and entities in multiple user utterances.
4671
- ///
4672
- /// Send multiple user inputs to a workspace in a single request and receive information about the intents and
4673
- /// entities recognized in each input. This method is useful for testing and comparing the performance of
4674
- /// different workspaces.
4675
- ///
4676
- /// This method is available only with Premium plans.
4677
- /// </summary>
4678
- /// <param name="callback">The callback function that is invoked when the operation completes.</param>
4679
- /// <param name="workspaceId">Unique identifier of the workspace.</param>
4680
- /// <param name="input">An array of input utterances to classify. (optional)</param>
4681
- /// <returns><see cref="BulkClassifyResponse" />BulkClassifyResponse</returns>
4682
- public bool BulkClassify ( Callback < BulkClassifyResponse > callback , string workspaceId , List < BulkClassifyUtterance > input = null )
4683
- {
4684
- if ( callback == null )
4685
- throw new ArgumentNullException ( "`callback` is required for `BulkClassify`" ) ;
4686
- if ( string . IsNullOrEmpty ( workspaceId ) )
4687
- throw new ArgumentNullException ( "`workspaceId` is required for `BulkClassify`" ) ;
4688
- if ( string . IsNullOrEmpty ( Version ) )
4689
- throw new ArgumentNullException ( "`Version` is required" ) ;
4690
-
4691
- RequestObject < BulkClassifyResponse > req = new RequestObject < BulkClassifyResponse >
4692
- {
4693
- Callback = callback ,
4694
- HttpMethod = UnityWebRequest . kHttpVerbPOST ,
4695
- DisableSslVerification = DisableSslVerification
4696
- } ;
4697
-
4698
- foreach ( KeyValuePair < string , string > kvp in customRequestHeaders )
4699
- {
4700
- req . Headers . Add ( kvp . Key , kvp . Value ) ;
4701
- }
4702
-
4703
- ClearCustomRequestHeaders ( ) ;
4704
-
4705
- foreach ( KeyValuePair < string , string > kvp in Common . GetSdkHeaders ( "conversation" , "V1" , "BulkClassify" ) )
4706
- {
4707
- req . Headers . Add ( kvp . Key , kvp . Value ) ;
4708
- }
4709
-
4710
- if ( ! string . IsNullOrEmpty ( Version ) )
4711
- {
4712
- req . Parameters [ "version" ] = Version ;
4713
- }
4714
- req . Headers [ "Content-Type" ] = "application/json" ;
4715
- req . Headers [ "Accept" ] = "application/json" ;
4716
-
4717
- JObject bodyObject = new JObject ( ) ;
4718
- if ( input != null && input . Count > 0 )
4719
- bodyObject [ "input" ] = JToken . FromObject ( input ) ;
4720
- req . Send = Encoding . UTF8 . GetBytes ( JsonConvert . SerializeObject ( bodyObject ) ) ;
4721
-
4722
- req . OnResponse = OnBulkClassifyResponse ;
4723
-
4724
- Connector . URL = GetServiceUrl ( ) + string . Format ( "/v1/workspaces/{0}/bulk_classify" , workspaceId ) ;
4725
- Authenticator . Authenticate ( Connector ) ;
4726
-
4727
- return Connector . Send ( req ) ;
4728
- }
4729
-
4730
- private void OnBulkClassifyResponse ( RESTConnector . Request req , RESTConnector . Response resp )
4731
- {
4732
- DetailedResponse < BulkClassifyResponse > response = new DetailedResponse < BulkClassifyResponse > ( ) ;
4733
- foreach ( KeyValuePair < string , string > kvp in resp . Headers )
4734
- {
4735
- response . Headers . Add ( kvp . Key , kvp . Value ) ;
4736
- }
4737
- response . StatusCode = resp . HttpResponseCode ;
4738
-
4739
- try
4740
- {
4741
- string json = Encoding . UTF8 . GetString ( resp . Data ) ;
4742
- response . Result = JsonConvert . DeserializeObject < BulkClassifyResponse > ( json ) ;
4743
- response . Response = json ;
4744
- }
4745
- catch ( Exception e )
4746
- {
4747
- Log . Error ( "AssistantService.OnBulkClassifyResponse()" , "Exception: {0}" , e . ToString ( ) ) ;
4748
- resp . Success = false ;
4749
- }
4750
-
4751
- if ( ( ( RequestObject < BulkClassifyResponse > ) req ) . Callback != null )
4752
- ( ( RequestObject < BulkClassifyResponse > ) req ) . Callback ( response , resp . Error ) ;
4753
- }
4754
4754
}
4755
4755
}
0 commit comments