@@ -178,7 +178,7 @@ ConversationV1.VERSION_DATE_2017_02_03 = '2017-02-03';
178
178
*
179
179
*
180
180
*
181
- * @param {Object } params { workspace_id: '', }
181
+ * @param {Object } params
182
182
* @param params.workspace_id
183
183
* @param [params.input]
184
184
* @param [params.context]
@@ -382,9 +382,9 @@ ConversationV1.prototype.createWorkspace = function(params, callback) {
382
382
}
383
383
```
384
384
*
385
- * @param {Object } params { workspace_id: '', }
386
- * @param params.workspace_id
387
- * @param [params.export=false] - if true, the full contents of all of the sub-resources are returned
385
+ * @param {Object } params
386
+ * @param { String } params.workspace_id
387
+ * @param { Boolean } [params.export=false] - if true, the full contents of all of the sub-resources are returned
388
388
* @param {Function } [callback]
389
389
*/
390
390
@@ -525,7 +525,7 @@ ConversationV1.prototype.deleteWorkspace = function(params, callback) {
525
525
}
526
526
```
527
527
*
528
- * @param {Object } params { workspace_id: '', }
528
+ * @param {Object } params
529
529
* @param {String } params.workspace_id
530
530
* @param {String } [params.name]
531
531
* @param {String } [params.description]
@@ -569,7 +569,7 @@ ConversationV1.prototype.updateWorkspace = function(params, callback) {
569
569
}
570
570
```
571
571
*
572
- * @param {Object } params { workspace_id: '', }
572
+ * @param {Object } params
573
573
* @param params.workspace_id
574
574
* @param {Function } [callback]
575
575
*
@@ -591,4 +591,291 @@ ConversationV1.prototype.workspaceStatus = function(params, callback) {
591
591
return requestFactory ( parameters , callback ) ;
592
592
} ;
593
593
594
+ /**
595
+ * Method: createIntent
596
+ *
597
+ * Create a new intent
598
+ *
599
+ * @param {Object } params
600
+ * @param {String } params.workspace_id
601
+ * @param {String } [params.intent]
602
+ * @param {String } [params.description]
603
+ * @param {Array<Object> } [params.examples]
604
+ * @param {Function } [callback]
605
+ *
606
+ */
607
+ ConversationV1 . prototype . createIntent = function ( params , callback ) {
608
+ params = params || { } ;
609
+
610
+ const parameters = {
611
+ options : {
612
+ url : '/v1/workspaces/{workspace_id}/intents' ,
613
+ method : 'POST' ,
614
+ json : true ,
615
+ path : pick ( params , [ 'workspace_id' ] ) ,
616
+ body : pick ( params , [ 'intent' , 'description' , 'examples' ] )
617
+ } ,
618
+ requiredParams : [ 'workspace_id' , 'intent' ] ,
619
+ defaultOptions : this . _options
620
+ } ;
621
+ return requestFactory ( parameters , callback ) ;
622
+ } ;
623
+
624
+ /**
625
+ * Method: getIntents
626
+ *
627
+ * List the intents for a workspace.
628
+ *
629
+ * @param {Object } params
630
+ * @param {String } params.workspace_id
631
+ * @param {Boolean } [params.export=false] - if true, the full contents of all of the sub-resources are returned
632
+ * @param {Function } [callback]
633
+ *
634
+ */
635
+ ConversationV1 . prototype . getIntents = function ( params , callback ) {
636
+ params = params || { } ;
637
+
638
+ const parameters = {
639
+ options : {
640
+ url : '/v1/workspaces/{workspace_id}/intents' ,
641
+ method : 'GET' ,
642
+ json : true ,
643
+ path : pick ( params , [ 'workspace_id' ] ) ,
644
+ qs : pick ( params , [ 'export' ] )
645
+ } ,
646
+ requiredParams : [ 'workspace_id' ] ,
647
+ defaultOptions : this . _options
648
+ } ;
649
+ return requestFactory ( parameters , callback ) ;
650
+ } ;
651
+
652
+ /**
653
+ * Method: getIntent
654
+ *
655
+ * Get information about an intent, optionally including all intent content.
656
+ *
657
+ * @param {Object } params
658
+ * @param {String } params.workspace_id
659
+ * @param {String } params.intent
660
+ * @param {Boolean } [params.export=false] - if true, the full contents of all of the sub-resources are returned
661
+ * @param {Function } [callback]
662
+ *
663
+ */
664
+ ConversationV1 . prototype . getIntent = function ( params , callback ) {
665
+ params = params || { } ;
666
+
667
+ const parameters = {
668
+ options : {
669
+ url : '/v1/workspaces/{workspace_id}/intents/{intent}' ,
670
+ method : 'GET' ,
671
+ json : true ,
672
+ path : pick ( params , [ 'workspace_id' , 'intent' ] ) ,
673
+ qs : pick ( params , [ 'export' ] )
674
+ } ,
675
+ requiredParams : [ 'workspace_id' , 'intent' ] ,
676
+ defaultOptions : this . _options
677
+ } ;
678
+ return requestFactory ( parameters , callback ) ;
679
+ } ;
680
+
681
+ /**
682
+ * Method: updateIntent
683
+ *
684
+ * Update an existing intent with new or modified data. You must provide JSON data defining the content of the updated intent.
685
+ *
686
+ * @param {Object } params
687
+ * @param {String } params.workspace_id
688
+ * @param {String } params.old_intent
689
+ * @param {String } params.intent
690
+ * @param {String } params.description
691
+ * @param {Object } params.examples
692
+ * @param {Function } [callback]
693
+ *
694
+ */
695
+ ConversationV1 . prototype . updateIntent = function ( params , callback ) {
696
+ params = params || { } ;
697
+
698
+ const parameters = {
699
+ options : {
700
+ url : '/v1/workspaces/{workspace_id}/intents/{old_intent}' ,
701
+ method : 'POST' ,
702
+ json : true ,
703
+ path : pick ( params , [ 'workspace_id' , 'old_intent' ] ) ,
704
+ body : pick ( params , [ 'intent' , 'description' , 'examples' ] )
705
+ } ,
706
+ requiredParams : [ 'workspace_id' , 'old_intent' , 'intent' ] ,
707
+ defaultOptions : this . _options
708
+ } ;
709
+ return requestFactory ( parameters , callback ) ;
710
+ } ;
711
+
712
+ /**
713
+ * Method: deleteIntent
714
+ *
715
+ * Delete an intent from a workspace
716
+ *
717
+ * @param {Object } params
718
+ * @param {String } params.workspace_id
719
+ * @param {String } params.intent
720
+ * @param {Function } [callback]
721
+ *
722
+ */
723
+ ConversationV1 . prototype . deleteIntent = function ( params , callback ) {
724
+ params = params || { } ;
725
+
726
+ const parameters = {
727
+ options : {
728
+ url : '/v1/workspaces/{workspace_id}/intents/{intent}' ,
729
+ method : 'DELETE' ,
730
+ json : true ,
731
+ path : pick ( params , [ 'workspace_id' , 'intent' ] )
732
+ } ,
733
+ requiredParams : [ 'workspace_id' , 'intent' ] ,
734
+ defaultOptions : this . _options
735
+ } ;
736
+ return requestFactory ( parameters , callback ) ;
737
+ } ;
738
+
739
+ /**
740
+ * Method: getExamples
741
+ *
742
+ * List the user input examples for an intent.
743
+ *
744
+ * @param {Object } params
745
+ * @param {String } params.workspace_id
746
+ * @param {String } params.intent
747
+ * @param {Function } [callback]
748
+ *
749
+ */
750
+ ConversationV1 . prototype . getExamples = function ( params , callback ) {
751
+ params = params || { } ;
752
+
753
+ const parameters = {
754
+ options : {
755
+ url : '/v1/workspaces/{workspace_id}/intents/{intent}/examples' ,
756
+ method : 'GET' ,
757
+ json : true ,
758
+ path : pick ( params , [ 'workspace_id' , 'intent' ] )
759
+ } ,
760
+ requiredParams : [ 'workspace_id' , 'intent' ] ,
761
+ defaultOptions : this . _options
762
+ } ;
763
+ return requestFactory ( parameters , callback ) ;
764
+ } ;
765
+
766
+ /**
767
+ * Method: createExample
768
+ *
769
+ * Add a new user input example to an intent.
770
+ *
771
+ * @param {Object } params
772
+ * @param {String } params.workspace_id
773
+ * @param {String } params.intent
774
+ * @param {String } params.text
775
+ * @param {Function } [callback]
776
+ *
777
+ */
778
+ ConversationV1 . prototype . createExample = function ( params , callback ) {
779
+ params = params || { } ;
780
+
781
+ const parameters = {
782
+ options : {
783
+ url : '/v1/workspaces/{workspace_id}/intents/{intent}/examples' ,
784
+ method : 'POST' ,
785
+ json : true ,
786
+ path : pick ( params , [ 'workspace_id' , 'intent' ] ) ,
787
+ body : pick ( params , [ 'text' ] )
788
+ } ,
789
+ requiredParams : [ 'workspace_id' , 'intent' ] ,
790
+ defaultOptions : this . _options
791
+ } ;
792
+ return requestFactory ( parameters , callback ) ;
793
+ } ;
794
+
795
+ /**
796
+ * Method: deleteExample
797
+ *
798
+ * Delete a user input example from an intent.
799
+ *
800
+ * @param {Object } params
801
+ * @param {String } params.workspace_id
802
+ * @param {String } params.intent
803
+ * @param {String } params.text
804
+ * @param {Function } [callback]
805
+ *
806
+ */
807
+ ConversationV1 . prototype . deleteExample = function ( params , callback ) {
808
+ params = params || { } ;
809
+
810
+ const parameters = {
811
+ options : {
812
+ url : '/v1/workspaces/{workspace_id}/intents/{intent}/examples/{text}' ,
813
+ method : 'DELETE' ,
814
+ json : true ,
815
+ path : pick ( params , [ 'workspace_id' , 'intent' , 'text' ] )
816
+ } ,
817
+ requiredParams : [ 'workspace_id' , 'intent' , 'text' ] ,
818
+ defaultOptions : this . _options
819
+ } ;
820
+ return requestFactory ( parameters , callback ) ;
821
+ } ;
822
+
823
+ /**
824
+ * Method: getExample
825
+ *
826
+ * Get information about a user input example.
827
+ *
828
+ * @param {Object } params
829
+ * @param {String } params.workspace_id
830
+ * @param {String } params.intent
831
+ * @param {String } params.text
832
+ * @param {Function } [callback]
833
+ *
834
+ */
835
+ ConversationV1 . prototype . getExample = function ( params , callback ) {
836
+ params = params || { } ;
837
+
838
+ const parameters = {
839
+ options : {
840
+ url : '/v1/workspaces/{workspace_id}/intents/{intent}/examples/{text}' ,
841
+ method : 'GET' ,
842
+ json : true ,
843
+ path : pick ( params , [ 'workspace_id' , 'intent' , 'text' ] )
844
+ } ,
845
+ requiredParams : [ 'workspace_id' , 'intent' , 'text' ] ,
846
+ defaultOptions : this . _options
847
+ } ;
848
+ return requestFactory ( parameters , callback ) ;
849
+ } ;
850
+
851
+ /**
852
+ * Method: updateExample
853
+ *
854
+ * Update the text of a user input example.
855
+ *
856
+ * @param {Object } params
857
+ * @param {String } params.workspace_id
858
+ * @param {String } params.intent
859
+ * @param {String } params.text
860
+ * @param {Object } params.example
861
+ * @param {Function } [callback]
862
+ *
863
+ */
864
+ ConversationV1 . prototype . updateExample = function ( params , callback ) {
865
+ params = params || { } ;
866
+
867
+ const parameters = {
868
+ options : {
869
+ url : '/v1/workspaces/{workspace_id}/intents/{intent}/examples/{old_text}' ,
870
+ method : 'POST' ,
871
+ json : true ,
872
+ path : pick ( params , [ 'workspace_id' , 'intent' , 'old_text' ] ) ,
873
+ body : pick ( params , [ 'text' ] )
874
+ } ,
875
+ requiredParams : [ 'workspace_id' , 'intent' , 'old_text' , 'text' ] ,
876
+ defaultOptions : this . _options
877
+ } ;
878
+ return requestFactory ( parameters , callback ) ;
879
+ } ;
880
+
594
881
module . exports = ConversationV1 ;
0 commit comments