@@ -1543,4 +1543,183 @@ ConversationV1.prototype.getLogs = function(params, callback) {
1543
1543
return requestFactory ( parameters , callback ) ;
1544
1544
} ;
1545
1545
1546
+ /**
1547
+ * Method: createDialogNode
1548
+ *
1549
+ * Create a new dialog node
1550
+ *
1551
+ * @param {Object } params
1552
+ * @param {String } params.workspace_id
1553
+ * @param {String } [params.dialog_node]
1554
+ * @param {String } [params.description]
1555
+ * @param {Array<Object> } [params.examples]
1556
+ * @param {Function } [callback]
1557
+ *
1558
+ */
1559
+ ConversationV1 . prototype . createDialogNode = function ( params , callback ) {
1560
+ params = params || { } ;
1561
+
1562
+ const parameters = {
1563
+ options : {
1564
+ url : '/v1/workspaces/{workspace_id}/dialog_nodes' ,
1565
+ method : 'POST' ,
1566
+ json : true ,
1567
+ path : pick ( params , [ 'workspace_id' ] ) ,
1568
+ body : pick ( params , [
1569
+ 'dialog_node' ,
1570
+ 'description' ,
1571
+ 'conditions' ,
1572
+ 'parent' ,
1573
+ 'previous_sibling' ,
1574
+ 'output' ,
1575
+ 'context' ,
1576
+ 'metadata' ,
1577
+ 'next_step' ,
1578
+ 'actions' ,
1579
+ 'title' ,
1580
+ 'type' ,
1581
+ 'event_name' ,
1582
+ 'variable'
1583
+ ] )
1584
+ } ,
1585
+ requiredParams : [ 'workspace_id' , 'dialog_node' ] ,
1586
+ defaultOptions : this . _options
1587
+ } ;
1588
+ return requestFactory ( parameters , callback ) ;
1589
+ } ;
1590
+
1591
+ /**
1592
+ * Method: getDialogNodes
1593
+ *
1594
+ * List the dialog nodes for a workspace.
1595
+ *
1596
+ * @param {Object } params
1597
+ * @param {String } params.workspace_id
1598
+ * @param {Boolean } [params.export=false] - if true, the full contents of all of the sub-resources are returned
1599
+ * @param {Number } [params.page_limit]
1600
+ * @param {Boolean } [params.include_count]
1601
+ * @param {String } [params.sort]
1602
+ * @param {String } [params.cursor]
1603
+ * @param {Function } [callback]
1604
+ *
1605
+ */
1606
+ ConversationV1 . prototype . getDialogNodes = function ( params , callback ) {
1607
+ params = params || { } ;
1608
+
1609
+ const parameters = {
1610
+ options : {
1611
+ url : '/v1/workspaces/{workspace_id}/dialog_nodes' ,
1612
+ method : 'GET' ,
1613
+ json : true ,
1614
+ path : pick ( params , [ 'workspace_id' ] ) ,
1615
+ qs : pick ( params , [ 'page_limit' , 'include_count' , 'sort' , 'cursor' ] )
1616
+ } ,
1617
+ requiredParams : [ 'workspace_id' ] ,
1618
+ defaultOptions : this . _options
1619
+ } ;
1620
+ return requestFactory ( parameters , callback ) ;
1621
+ } ;
1622
+
1623
+ /**
1624
+ * Method: getDialogNode
1625
+ *
1626
+ * Get information about an dialog node, optionally including all dialog node content.
1627
+ *
1628
+ * @param {Object } params
1629
+ * @param {String } params.workspace_id
1630
+ * @param {String } params.dialog_node
1631
+ * @param {Boolean } [params.export=false] - if true, the full contents of all of the sub-resources are returned
1632
+ * @param {Function } [callback]
1633
+ *
1634
+ */
1635
+ ConversationV1 . prototype . getDialogNode = function ( params , callback ) {
1636
+ params = params || { } ;
1637
+
1638
+ const parameters = {
1639
+ options : {
1640
+ url : '/v1/workspaces/{workspace_id}/dialog_nodes/{dialog_node}' ,
1641
+ method : 'GET' ,
1642
+ json : true ,
1643
+ path : pick ( params , [ 'workspace_id' , 'dialog_node' ] ) ,
1644
+ qs : pick ( params , [ 'export' ] )
1645
+ } ,
1646
+ requiredParams : [ 'workspace_id' , 'dialog_node' ] ,
1647
+ defaultOptions : this . _options
1648
+ } ;
1649
+ return requestFactory ( parameters , callback ) ;
1650
+ } ;
1651
+
1652
+ /**
1653
+ * Method: updateDialogNode
1654
+ *
1655
+ * Update an existing dialog node with new or modified data. You must provide JSON data defining the content of the updated dialog node.
1656
+ *
1657
+ * @param {Object } params
1658
+ * @param {String } params.workspace_id
1659
+ * @param {String } params.old_dialog_node
1660
+ * @param {String } params.dialog_node
1661
+ * @param {String } params.description
1662
+ * @param {Array<Object> } params.examples
1663
+ * @param {Function } [callback]
1664
+ *
1665
+ */
1666
+ ConversationV1 . prototype . updateDialogNode = function ( params , callback ) {
1667
+ params = params || { } ;
1668
+
1669
+ const parameters = {
1670
+ options : {
1671
+ url : '/v1/workspaces/{workspace_id}/dialog_nodes/{old_dialog_node}' ,
1672
+ method : 'POST' ,
1673
+ json : true ,
1674
+ path : pick ( params , [ 'workspace_id' , 'old_dialog_node' ] ) ,
1675
+ body : pick ( params , [
1676
+ 'dialog_node' ,
1677
+ 'description' ,
1678
+ 'conditions' ,
1679
+ 'parent' ,
1680
+ 'previous_sibling' ,
1681
+ 'output' ,
1682
+ 'context' ,
1683
+ 'metadata' ,
1684
+ 'next_step' ,
1685
+ 'actions' ,
1686
+ 'title' ,
1687
+ 'type' ,
1688
+ 'event_name' ,
1689
+ 'variable'
1690
+ ] )
1691
+ } ,
1692
+ requiredParams : [ 'workspace_id' , 'old_dialog_node' , 'dialog_node' ] ,
1693
+ defaultOptions : this . _options
1694
+ } ;
1695
+ return requestFactory ( parameters , callback ) ;
1696
+ } ;
1697
+
1698
+ /**
1699
+ * Method: deleteDialogNode
1700
+ *
1701
+ * Delete an dialog node from a workspace
1702
+ *
1703
+ * @param {Object } params
1704
+ * @param {String } params.workspace_id
1705
+ * @param {String } params.dialog_node
1706
+ * @param {Function } [callback]
1707
+ *
1708
+ */
1709
+ ConversationV1 . prototype . deleteDialogNode = function ( params , callback ) {
1710
+ params = params || { } ;
1711
+
1712
+ const parameters = {
1713
+ options : {
1714
+ url : '/v1/workspaces/{workspace_id}/dialog_nodes/{dialog_node}' ,
1715
+ method : 'DELETE' ,
1716
+ json : true ,
1717
+ path : pick ( params , [ 'workspace_id' , 'dialog_node' ] )
1718
+ } ,
1719
+ requiredParams : [ 'workspace_id' , 'dialog_node' ] ,
1720
+ defaultOptions : this . _options
1721
+ } ;
1722
+ return requestFactory ( parameters , callback ) ;
1723
+ } ;
1724
+
1546
1725
module . exports = ConversationV1 ;
0 commit comments