@@ -70,6 +70,7 @@ async def delete(
70
70
self ,
71
71
* ,
72
72
connector_id : str ,
73
+ delete_sync_jobs : bool ,
73
74
error_trace : t .Optional [bool ] = None ,
74
75
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
75
76
human : t .Optional [bool ] = None ,
@@ -81,12 +82,17 @@ async def delete(
81
82
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-api.html>`_
82
83
83
84
:param connector_id: The unique identifier of the connector to be deleted
85
+ :param delete_sync_jobs: Determines whether associated sync jobs are also deleted.
84
86
"""
85
87
if connector_id in SKIP_IN_PATH :
86
88
raise ValueError ("Empty value passed for parameter 'connector_id'" )
89
+ if delete_sync_jobs is None :
90
+ raise ValueError ("Empty value passed for parameter 'delete_sync_jobs'" )
87
91
__path_parts : t .Dict [str , str ] = {"connector_id" : _quote (connector_id )}
88
92
__path = f'/_connector/{ __path_parts ["connector_id" ]} '
89
93
__query : t .Dict [str , t .Any ] = {}
94
+ if delete_sync_jobs is not None :
95
+ __query ["delete_sync_jobs" ] = delete_sync_jobs
90
96
if error_trace is not None :
91
97
__query ["error_trace" ] = error_trace
92
98
if filter_path is not None :
@@ -742,6 +748,46 @@ async def sync_job_post(
742
748
path_parts = __path_parts ,
743
749
)
744
750
751
+ @_rewrite_parameters ()
752
+ async def update_active_filtering (
753
+ self ,
754
+ * ,
755
+ connector_id : str ,
756
+ error_trace : t .Optional [bool ] = None ,
757
+ filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
758
+ human : t .Optional [bool ] = None ,
759
+ pretty : t .Optional [bool ] = None ,
760
+ ) -> ObjectApiResponse [t .Any ]:
761
+ """
762
+ Activates the draft filtering rules if they are in a validated state.
763
+
764
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html>`_
765
+
766
+ :param connector_id: The unique identifier of the connector to be updated
767
+ """
768
+ if connector_id in SKIP_IN_PATH :
769
+ raise ValueError ("Empty value passed for parameter 'connector_id'" )
770
+ __path_parts : t .Dict [str , str ] = {"connector_id" : _quote (connector_id )}
771
+ __path = f'/_connector/{ __path_parts ["connector_id" ]} /_filtering/_activate'
772
+ __query : t .Dict [str , t .Any ] = {}
773
+ if error_trace is not None :
774
+ __query ["error_trace" ] = error_trace
775
+ if filter_path is not None :
776
+ __query ["filter_path" ] = filter_path
777
+ if human is not None :
778
+ __query ["human" ] = human
779
+ if pretty is not None :
780
+ __query ["pretty" ] = pretty
781
+ __headers = {"accept" : "application/json" }
782
+ return await self .perform_request ( # type: ignore[return-value]
783
+ "PUT" ,
784
+ __path ,
785
+ params = __query ,
786
+ headers = __headers ,
787
+ endpoint_id = "connector.update_active_filtering" ,
788
+ path_parts = __path_parts ,
789
+ )
790
+
745
791
@_rewrite_parameters (
746
792
body_fields = ("api_key_id" , "api_key_secret_id" ),
747
793
)
@@ -903,17 +949,19 @@ async def update_error(
903
949
)
904
950
905
951
@_rewrite_parameters (
906
- body_fields = ("filtering" ,),
952
+ body_fields = ("advanced_snippet" , " filtering" , "rules" ),
907
953
)
908
954
async def update_filtering (
909
955
self ,
910
956
* ,
911
957
connector_id : str ,
912
- filtering : t .Optional [t .Sequence [ t . Mapping [str , t .Any ] ]] = None ,
958
+ advanced_snippet : t .Optional [t .Mapping [str , t .Any ]] = None ,
913
959
error_trace : t .Optional [bool ] = None ,
914
960
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
961
+ filtering : t .Optional [t .Sequence [t .Mapping [str , t .Any ]]] = None ,
915
962
human : t .Optional [bool ] = None ,
916
963
pretty : t .Optional [bool ] = None ,
964
+ rules : t .Optional [t .Sequence [t .Mapping [str , t .Any ]]] = None ,
917
965
body : t .Optional [t .Dict [str , t .Any ]] = None ,
918
966
) -> ObjectApiResponse [t .Any ]:
919
967
"""
@@ -922,12 +970,12 @@ async def update_filtering(
922
970
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html>`_
923
971
924
972
:param connector_id: The unique identifier of the connector to be updated
973
+ :param advanced_snippet:
925
974
:param filtering:
975
+ :param rules:
926
976
"""
927
977
if connector_id in SKIP_IN_PATH :
928
978
raise ValueError ("Empty value passed for parameter 'connector_id'" )
929
- if filtering is None and body is None :
930
- raise ValueError ("Empty value passed for parameter 'filtering'" )
931
979
__path_parts : t .Dict [str , str ] = {"connector_id" : _quote (connector_id )}
932
980
__path = f'/_connector/{ __path_parts ["connector_id" ]} /_filtering'
933
981
__query : t .Dict [str , t .Any ] = {}
@@ -941,8 +989,12 @@ async def update_filtering(
941
989
if pretty is not None :
942
990
__query ["pretty" ] = pretty
943
991
if not __body :
992
+ if advanced_snippet is not None :
993
+ __body ["advanced_snippet" ] = advanced_snippet
944
994
if filtering is not None :
945
995
__body ["filtering" ] = filtering
996
+ if rules is not None :
997
+ __body ["rules" ] = rules
946
998
__headers = {"accept" : "application/json" , "content-type" : "application/json" }
947
999
return await self .perform_request ( # type: ignore[return-value]
948
1000
"PUT" ,
@@ -954,6 +1006,58 @@ async def update_filtering(
954
1006
path_parts = __path_parts ,
955
1007
)
956
1008
1009
+ @_rewrite_parameters (
1010
+ body_fields = ("validation" ,),
1011
+ )
1012
+ async def update_filtering_validation (
1013
+ self ,
1014
+ * ,
1015
+ connector_id : str ,
1016
+ validation : t .Optional [t .Mapping [str , t .Any ]] = None ,
1017
+ error_trace : t .Optional [bool ] = None ,
1018
+ filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
1019
+ human : t .Optional [bool ] = None ,
1020
+ pretty : t .Optional [bool ] = None ,
1021
+ body : t .Optional [t .Dict [str , t .Any ]] = None ,
1022
+ ) -> ObjectApiResponse [t .Any ]:
1023
+ """
1024
+ Updates the validation info of the draft filtering rules.
1025
+
1026
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-validation-api.html>`_
1027
+
1028
+ :param connector_id: The unique identifier of the connector to be updated
1029
+ :param validation:
1030
+ """
1031
+ if connector_id in SKIP_IN_PATH :
1032
+ raise ValueError ("Empty value passed for parameter 'connector_id'" )
1033
+ if validation is None and body is None :
1034
+ raise ValueError ("Empty value passed for parameter 'validation'" )
1035
+ __path_parts : t .Dict [str , str ] = {"connector_id" : _quote (connector_id )}
1036
+ __path = f'/_connector/{ __path_parts ["connector_id" ]} /_filtering/_validation'
1037
+ __query : t .Dict [str , t .Any ] = {}
1038
+ __body : t .Dict [str , t .Any ] = body if body is not None else {}
1039
+ if error_trace is not None :
1040
+ __query ["error_trace" ] = error_trace
1041
+ if filter_path is not None :
1042
+ __query ["filter_path" ] = filter_path
1043
+ if human is not None :
1044
+ __query ["human" ] = human
1045
+ if pretty is not None :
1046
+ __query ["pretty" ] = pretty
1047
+ if not __body :
1048
+ if validation is not None :
1049
+ __body ["validation" ] = validation
1050
+ __headers = {"accept" : "application/json" , "content-type" : "application/json" }
1051
+ return await self .perform_request ( # type: ignore[return-value]
1052
+ "PUT" ,
1053
+ __path ,
1054
+ params = __query ,
1055
+ headers = __headers ,
1056
+ body = __body ,
1057
+ endpoint_id = "connector.update_filtering_validation" ,
1058
+ path_parts = __path_parts ,
1059
+ )
1060
+
957
1061
@_rewrite_parameters (
958
1062
body_fields = ("index_name" ,),
959
1063
)
0 commit comments