@@ -419,6 +419,29 @@ def add_link(self, link_id, table_name, other_table_name, row_id, other_row_id):
419419
420420 response = requests .post (url , json = json_data , headers = self .headers , timeout = self .timeout )
421421 return parse_response (response )
422+
423+
424+ def batch_add_links (self , link_id , table_name , other_table_name , other_rows_ids_map ):
425+ """
426+ :param link_id: str
427+ :param table_name: str
428+ :param other_table_name: str
429+ :param other_rows_ids_map: dict
430+ """
431+ url = self ._row_link_server_url ()
432+ json_data = {
433+ 'link_id' : link_id ,
434+ 'table_name' : table_name ,
435+ 'other_table_name' : other_table_name ,
436+ 'other_rows_ids_map' : other_rows_ids_map ,
437+ }
438+ if like_table_id (table_name ):
439+ json_data ['table_id' ] = table_name
440+ if like_table_id (other_table_name ):
441+ json_data ['other_table_id' ] = other_table_name
442+
443+ response = requests .post (url , json = json_data , headers = self .headers , timeout = self .timeout )
444+ return parse_response (response )
422445
423446
424447 def remove_link (self , link_id , table_name , other_table_name , row_id , other_row_id ):
@@ -442,6 +465,29 @@ def remove_link(self, link_id, table_name, other_table_name, row_id, other_row_i
442465 json_data ['other_table_id' ] = other_table_name
443466 response = requests .delete (url , json = json_data , headers = self .headers , timeout = self .timeout )
444467 return parse_response (response )
468+
469+
470+ def batch_remove_links (self , link_id , table_name , other_table_name , other_rows_ids_map ):
471+ """
472+ :param link_id: str
473+ :param table_name: str
474+ :param other_table_name: str
475+ :param other_rows_ids_map: dict
476+ """
477+ url = self ._row_link_server_url ()
478+ json_data = {
479+ 'link_id' : link_id ,
480+ 'table_name' : table_name ,
481+ 'other_table_name' : other_table_name ,
482+ 'other_rows_ids_map' : other_rows_ids_map ,
483+ }
484+ if like_table_id (table_name ):
485+ json_data ['table_id' ] = table_name
486+ if like_table_id (other_table_name ):
487+ json_data ['other_table_id' ] = other_table_name
488+
489+ response = requests .delete (url , json = json_data , headers = self .headers , timeout = self .timeout )
490+ return parse_response (response )
445491
446492
447493 def update_link (self , link_id , table_name , other_table_name , row_id , other_rows_ids ):
0 commit comments