@@ -1324,6 +1324,186 @@ def patch_knowledge_knowledgebase(self, knowledge_base_id, body, **kwargs):
13241324 callback = params .get ('callback' ))
13251325 return response
13261326
1327+ def patch_knowledge_knowledgebase_context (self , knowledge_base_id , context_id , ** kwargs ):
1328+ """
1329+ Update specific context data of the knowledge base.
1330+
1331+
1332+ This method makes a synchronous HTTP request by default. To make an
1333+ asynchronous HTTP request, please define a `callback` function
1334+ to be invoked when receiving the response.
1335+ >>> def callback_function(response):
1336+ >>> pprint(response)
1337+ >>>
1338+ >>> thread = api.patch_knowledge_knowledgebase_context(knowledge_base_id, context_id, callback=callback_function)
1339+
1340+ :param callback function: The callback function
1341+ for asynchronous request. (optional)
1342+ :param str knowledge_base_id: Knowledge base ID. (required)
1343+ :param str context_id: Context ID. (required)
1344+ :param KnowledgeContextRequest body:
1345+ :return: KnowledgeContextResponse
1346+ If the method is called asynchronously,
1347+ returns the request thread.
1348+ """
1349+
1350+ all_params = ['knowledge_base_id' , 'context_id' , 'body' ]
1351+ all_params .append ('callback' )
1352+
1353+ params = locals ()
1354+ for key , val in iteritems (params ['kwargs' ]):
1355+ if key not in all_params :
1356+ raise TypeError (
1357+ "Got an unexpected keyword argument '%s'"
1358+ " to method patch_knowledge_knowledgebase_context" % key
1359+ )
1360+ params [key ] = val
1361+ del params ['kwargs' ]
1362+
1363+ # verify the required parameter 'knowledge_base_id' is set
1364+ if ('knowledge_base_id' not in params ) or (params ['knowledge_base_id' ] is None ):
1365+ raise ValueError ("Missing the required parameter `knowledge_base_id` when calling `patch_knowledge_knowledgebase_context`" )
1366+ # verify the required parameter 'context_id' is set
1367+ if ('context_id' not in params ) or (params ['context_id' ] is None ):
1368+ raise ValueError ("Missing the required parameter `context_id` when calling `patch_knowledge_knowledgebase_context`" )
1369+
1370+
1371+ resource_path = '/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/contexts/{contextId}' .replace ('{format}' , 'json' )
1372+ path_params = {}
1373+ if 'knowledge_base_id' in params :
1374+ path_params ['knowledgeBaseId' ] = params ['knowledge_base_id' ]
1375+ if 'context_id' in params :
1376+ path_params ['contextId' ] = params ['context_id' ]
1377+
1378+ query_params = {}
1379+
1380+ header_params = {}
1381+
1382+ form_params = []
1383+ local_var_files = {}
1384+
1385+ body_params = None
1386+ if 'body' in params :
1387+ body_params = params ['body' ]
1388+
1389+ # HTTP header `Accept`
1390+ header_params ['Accept' ] = self .api_client .\
1391+ select_header_accept (['application/json' ])
1392+ if not header_params ['Accept' ]:
1393+ del header_params ['Accept' ]
1394+
1395+ # HTTP header `Content-Type`
1396+ header_params ['Content-Type' ] = self .api_client .\
1397+ select_header_content_type (['application/json' ])
1398+
1399+ # Authentication setting
1400+ auth_settings = ['PureCloud OAuth' ]
1401+
1402+ response = self .api_client .call_api (resource_path , 'PATCH' ,
1403+ path_params ,
1404+ query_params ,
1405+ header_params ,
1406+ body = body_params ,
1407+ post_params = form_params ,
1408+ files = local_var_files ,
1409+ response_type = 'KnowledgeContextResponse' ,
1410+ auth_settings = auth_settings ,
1411+ callback = params .get ('callback' ))
1412+ return response
1413+
1414+ def patch_knowledge_knowledgebase_context_value (self , knowledge_base_id , context_id , context_value_id , ** kwargs ):
1415+ """
1416+ Update context value.
1417+
1418+
1419+ This method makes a synchronous HTTP request by default. To make an
1420+ asynchronous HTTP request, please define a `callback` function
1421+ to be invoked when receiving the response.
1422+ >>> def callback_function(response):
1423+ >>> pprint(response)
1424+ >>>
1425+ >>> thread = api.patch_knowledge_knowledgebase_context_value(knowledge_base_id, context_id, context_value_id, callback=callback_function)
1426+
1427+ :param callback function: The callback function
1428+ for asynchronous request. (optional)
1429+ :param str knowledge_base_id: Knowledge base ID. (required)
1430+ :param str context_id: Context ID. (required)
1431+ :param str context_value_id: Context Value ID. (required)
1432+ :param KnowledgeContextValueRequest body:
1433+ :return: KnowledgeContextValueResponse
1434+ If the method is called asynchronously,
1435+ returns the request thread.
1436+ """
1437+
1438+ all_params = ['knowledge_base_id' , 'context_id' , 'context_value_id' , 'body' ]
1439+ all_params .append ('callback' )
1440+
1441+ params = locals ()
1442+ for key , val in iteritems (params ['kwargs' ]):
1443+ if key not in all_params :
1444+ raise TypeError (
1445+ "Got an unexpected keyword argument '%s'"
1446+ " to method patch_knowledge_knowledgebase_context_value" % key
1447+ )
1448+ params [key ] = val
1449+ del params ['kwargs' ]
1450+
1451+ # verify the required parameter 'knowledge_base_id' is set
1452+ if ('knowledge_base_id' not in params ) or (params ['knowledge_base_id' ] is None ):
1453+ raise ValueError ("Missing the required parameter `knowledge_base_id` when calling `patch_knowledge_knowledgebase_context_value`" )
1454+ # verify the required parameter 'context_id' is set
1455+ if ('context_id' not in params ) or (params ['context_id' ] is None ):
1456+ raise ValueError ("Missing the required parameter `context_id` when calling `patch_knowledge_knowledgebase_context_value`" )
1457+ # verify the required parameter 'context_value_id' is set
1458+ if ('context_value_id' not in params ) or (params ['context_value_id' ] is None ):
1459+ raise ValueError ("Missing the required parameter `context_value_id` when calling `patch_knowledge_knowledgebase_context_value`" )
1460+
1461+
1462+ resource_path = '/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/contexts/{contextId}/values/{contextValueId}' .replace ('{format}' , 'json' )
1463+ path_params = {}
1464+ if 'knowledge_base_id' in params :
1465+ path_params ['knowledgeBaseId' ] = params ['knowledge_base_id' ]
1466+ if 'context_id' in params :
1467+ path_params ['contextId' ] = params ['context_id' ]
1468+ if 'context_value_id' in params :
1469+ path_params ['contextValueId' ] = params ['context_value_id' ]
1470+
1471+ query_params = {}
1472+
1473+ header_params = {}
1474+
1475+ form_params = []
1476+ local_var_files = {}
1477+
1478+ body_params = None
1479+ if 'body' in params :
1480+ body_params = params ['body' ]
1481+
1482+ # HTTP header `Accept`
1483+ header_params ['Accept' ] = self .api_client .\
1484+ select_header_accept (['application/json' ])
1485+ if not header_params ['Accept' ]:
1486+ del header_params ['Accept' ]
1487+
1488+ # HTTP header `Content-Type`
1489+ header_params ['Content-Type' ] = self .api_client .\
1490+ select_header_content_type (['application/json' ])
1491+
1492+ # Authentication setting
1493+ auth_settings = ['PureCloud OAuth' ]
1494+
1495+ response = self .api_client .call_api (resource_path , 'PATCH' ,
1496+ path_params ,
1497+ query_params ,
1498+ header_params ,
1499+ body = body_params ,
1500+ post_params = form_params ,
1501+ files = local_var_files ,
1502+ response_type = 'KnowledgeContextValueResponse' ,
1503+ auth_settings = auth_settings ,
1504+ callback = params .get ('callback' ))
1505+ return response
1506+
13271507 def patch_knowledge_knowledgebase_language_category (self , category_id , knowledge_base_id , language_code , body , ** kwargs ):
13281508 """
13291509 Update category
0 commit comments