h2ogpte 1.6.41rc5__py3-none-any.whl → 1.6.43rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. h2ogpte/__init__.py +1 -1
  2. h2ogpte/cli/__init__.py +0 -0
  3. h2ogpte/cli/commands/__init__.py +0 -0
  4. h2ogpte/cli/commands/command_handlers/__init__.py +0 -0
  5. h2ogpte/cli/commands/command_handlers/agent.py +41 -0
  6. h2ogpte/cli/commands/command_handlers/chat.py +37 -0
  7. h2ogpte/cli/commands/command_handlers/clear.py +8 -0
  8. h2ogpte/cli/commands/command_handlers/collection.py +67 -0
  9. h2ogpte/cli/commands/command_handlers/config.py +113 -0
  10. h2ogpte/cli/commands/command_handlers/disconnect.py +36 -0
  11. h2ogpte/cli/commands/command_handlers/exit.py +37 -0
  12. h2ogpte/cli/commands/command_handlers/help.py +8 -0
  13. h2ogpte/cli/commands/command_handlers/history.py +29 -0
  14. h2ogpte/cli/commands/command_handlers/rag.py +146 -0
  15. h2ogpte/cli/commands/command_handlers/research_agent.py +45 -0
  16. h2ogpte/cli/commands/command_handlers/session.py +77 -0
  17. h2ogpte/cli/commands/command_handlers/status.py +33 -0
  18. h2ogpte/cli/commands/dispatcher.py +79 -0
  19. h2ogpte/cli/core/__init__.py +0 -0
  20. h2ogpte/cli/core/app.py +105 -0
  21. h2ogpte/cli/core/config.py +199 -0
  22. h2ogpte/cli/core/encryption.py +104 -0
  23. h2ogpte/cli/core/session.py +171 -0
  24. h2ogpte/cli/integrations/__init__.py +0 -0
  25. h2ogpte/cli/integrations/agent.py +338 -0
  26. h2ogpte/cli/integrations/rag.py +442 -0
  27. h2ogpte/cli/main.py +90 -0
  28. h2ogpte/cli/ui/__init__.py +0 -0
  29. h2ogpte/cli/ui/hbot_prompt.py +435 -0
  30. h2ogpte/cli/ui/prompts.py +129 -0
  31. h2ogpte/cli/ui/status_bar.py +133 -0
  32. h2ogpte/cli/utils/__init__.py +0 -0
  33. h2ogpte/cli/utils/file_manager.py +411 -0
  34. h2ogpte/h2ogpte.py +471 -67
  35. h2ogpte/h2ogpte_async.py +482 -68
  36. h2ogpte/h2ogpte_sync_base.py +8 -1
  37. h2ogpte/rest_async/__init__.py +6 -3
  38. h2ogpte/rest_async/api/chat_api.py +29 -0
  39. h2ogpte/rest_async/api/collections_api.py +293 -0
  40. h2ogpte/rest_async/api/extractors_api.py +2874 -70
  41. h2ogpte/rest_async/api/prompt_templates_api.py +32 -32
  42. h2ogpte/rest_async/api_client.py +1 -1
  43. h2ogpte/rest_async/configuration.py +1 -1
  44. h2ogpte/rest_async/models/__init__.py +5 -2
  45. h2ogpte/rest_async/models/chat_completion.py +4 -2
  46. h2ogpte/rest_async/models/chat_completion_delta.py +5 -3
  47. h2ogpte/rest_async/models/chat_completion_request.py +1 -1
  48. h2ogpte/rest_async/models/chat_session.py +4 -2
  49. h2ogpte/rest_async/models/chat_settings.py +1 -1
  50. h2ogpte/rest_async/models/collection.py +4 -2
  51. h2ogpte/rest_async/models/collection_create_request.py +4 -2
  52. h2ogpte/rest_async/models/create_chat_session_request.py +87 -0
  53. h2ogpte/rest_async/models/extraction_request.py +1 -1
  54. h2ogpte/rest_async/models/extractor.py +4 -2
  55. h2ogpte/rest_async/models/guardrails_settings.py +8 -4
  56. h2ogpte/rest_async/models/guardrails_settings_create_request.py +1 -1
  57. h2ogpte/rest_async/models/process_document_job_request.py +1 -1
  58. h2ogpte/rest_async/models/question_request.py +1 -1
  59. h2ogpte/rest_async/models/{reset_and_share_prompt_template_request.py → reset_and_share_request.py} +6 -6
  60. h2ogpte/{rest_sync/models/reset_and_share_prompt_template_with_groups_request.py → rest_async/models/reset_and_share_with_groups_request.py} +6 -6
  61. h2ogpte/rest_async/models/summarize_request.py +1 -1
  62. h2ogpte/rest_async/models/update_collection_workspace_request.py +87 -0
  63. h2ogpte/rest_async/models/update_extractor_privacy_request.py +87 -0
  64. h2ogpte/rest_sync/__init__.py +6 -3
  65. h2ogpte/rest_sync/api/chat_api.py +29 -0
  66. h2ogpte/rest_sync/api/collections_api.py +293 -0
  67. h2ogpte/rest_sync/api/extractors_api.py +2874 -70
  68. h2ogpte/rest_sync/api/prompt_templates_api.py +32 -32
  69. h2ogpte/rest_sync/api_client.py +1 -1
  70. h2ogpte/rest_sync/configuration.py +1 -1
  71. h2ogpte/rest_sync/models/__init__.py +5 -2
  72. h2ogpte/rest_sync/models/chat_completion.py +4 -2
  73. h2ogpte/rest_sync/models/chat_completion_delta.py +5 -3
  74. h2ogpte/rest_sync/models/chat_completion_request.py +1 -1
  75. h2ogpte/rest_sync/models/chat_session.py +4 -2
  76. h2ogpte/rest_sync/models/chat_settings.py +1 -1
  77. h2ogpte/rest_sync/models/collection.py +4 -2
  78. h2ogpte/rest_sync/models/collection_create_request.py +4 -2
  79. h2ogpte/rest_sync/models/create_chat_session_request.py +87 -0
  80. h2ogpte/rest_sync/models/extraction_request.py +1 -1
  81. h2ogpte/rest_sync/models/extractor.py +4 -2
  82. h2ogpte/rest_sync/models/guardrails_settings.py +8 -4
  83. h2ogpte/rest_sync/models/guardrails_settings_create_request.py +1 -1
  84. h2ogpte/rest_sync/models/process_document_job_request.py +1 -1
  85. h2ogpte/rest_sync/models/question_request.py +1 -1
  86. h2ogpte/rest_sync/models/{reset_and_share_prompt_template_request.py → reset_and_share_request.py} +6 -6
  87. h2ogpte/{rest_async/models/reset_and_share_prompt_template_with_groups_request.py → rest_sync/models/reset_and_share_with_groups_request.py} +6 -6
  88. h2ogpte/rest_sync/models/summarize_request.py +1 -1
  89. h2ogpte/rest_sync/models/update_collection_workspace_request.py +87 -0
  90. h2ogpte/rest_sync/models/update_extractor_privacy_request.py +87 -0
  91. h2ogpte/session.py +3 -2
  92. h2ogpte/session_async.py +22 -6
  93. h2ogpte/types.py +6 -0
  94. {h2ogpte-1.6.41rc5.dist-info → h2ogpte-1.6.43rc1.dist-info}/METADATA +5 -1
  95. {h2ogpte-1.6.41rc5.dist-info → h2ogpte-1.6.43rc1.dist-info}/RECORD +98 -59
  96. h2ogpte-1.6.43rc1.dist-info/entry_points.txt +2 -0
  97. {h2ogpte-1.6.41rc5.dist-info → h2ogpte-1.6.43rc1.dist-info}/WHEEL +0 -0
  98. {h2ogpte-1.6.41rc5.dist-info → h2ogpte-1.6.43rc1.dist-info}/top_level.txt +0 -0
@@ -21,6 +21,11 @@ from typing import List, Optional
21
21
  from typing_extensions import Annotated
22
22
  from h2ogpte.rest_async.models.extractor import Extractor
23
23
  from h2ogpte.rest_async.models.extractor_create_request import ExtractorCreateRequest
24
+ from h2ogpte.rest_async.models.group_share_permission import GroupSharePermission
25
+ from h2ogpte.rest_async.models.reset_and_share_request import ResetAndShareRequest
26
+ from h2ogpte.rest_async.models.reset_and_share_with_groups_request import ResetAndShareWithGroupsRequest
27
+ from h2ogpte.rest_async.models.share_permission import SharePermission
28
+ from h2ogpte.rest_async.models.update_extractor_privacy_request import UpdateExtractorPrivacyRequest
24
29
 
25
30
  from h2ogpte.rest_async.api_client import ApiClient, RequestSerialized
26
31
  from h2ogpte.rest_async.api_response import ApiResponse
@@ -849,11 +854,9 @@ class ExtractorsApi:
849
854
 
850
855
 
851
856
  @validate_call
852
- async def list_extractors(
857
+ async def get_extractor_group_permissions(
853
858
  self,
854
- offset: Annotated[Optional[StrictInt], Field(description="How many extractors to skip before returning.")] = None,
855
- limit: Annotated[Optional[StrictInt], Field(description="How many extractors to return.")] = None,
856
- name_filter: Annotated[Optional[StrictStr], Field(description="Filter extractors by name.")] = None,
859
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
857
860
  _request_timeout: Union[
858
861
  None,
859
862
  Annotated[StrictFloat, Field(gt=0)],
@@ -866,17 +869,13 @@ class ExtractorsApi:
866
869
  _content_type: Optional[StrictStr] = None,
867
870
  _headers: Optional[Dict[StrictStr, Any]] = None,
868
871
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
869
- ) -> List[Extractor]:
870
- """List extractors.
872
+ ) -> List[GroupSharePermission]:
873
+ """Returns a list of group access permissions for a given extractor.
871
874
 
872
- List extractors. The output is sorted by create time in descending order.
875
+ The returned list of group permissions denoting which groups have access to the extractor.
873
876
 
874
- :param offset: How many extractors to skip before returning.
875
- :type offset: int
876
- :param limit: How many extractors to return.
877
- :type limit: int
878
- :param name_filter: Filter extractors by name.
879
- :type name_filter: str
877
+ :param extractor_id: Id of the extractor. (required)
878
+ :type extractor_id: str
880
879
  :param _request_timeout: timeout setting for this request. If one
881
880
  number provided, it will be total request
882
881
  timeout. It can also be a pair (tuple) of
@@ -899,10 +898,8 @@ class ExtractorsApi:
899
898
  :return: Returns the result object.
900
899
  """ # noqa: E501
901
900
 
902
- _param = self._list_extractors_serialize(
903
- offset=offset,
904
- limit=limit,
905
- name_filter=name_filter,
901
+ _param = self._get_extractor_group_permissions_serialize(
902
+ extractor_id=extractor_id,
906
903
  _request_auth=_request_auth,
907
904
  _content_type=_content_type,
908
905
  _headers=_headers,
@@ -910,7 +907,7 @@ class ExtractorsApi:
910
907
  )
911
908
 
912
909
  _response_types_map: Dict[str, Optional[str]] = {
913
- '200': "List[Extractor]",
910
+ '200': "List[GroupSharePermission]",
914
911
  '401': "EndpointError",
915
912
  }
916
913
  response_data = await self.api_client.call_api(
@@ -925,11 +922,9 @@ class ExtractorsApi:
925
922
 
926
923
 
927
924
  @validate_call
928
- async def list_extractors_with_http_info(
925
+ async def get_extractor_group_permissions_with_http_info(
929
926
  self,
930
- offset: Annotated[Optional[StrictInt], Field(description="How many extractors to skip before returning.")] = None,
931
- limit: Annotated[Optional[StrictInt], Field(description="How many extractors to return.")] = None,
932
- name_filter: Annotated[Optional[StrictStr], Field(description="Filter extractors by name.")] = None,
927
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
933
928
  _request_timeout: Union[
934
929
  None,
935
930
  Annotated[StrictFloat, Field(gt=0)],
@@ -942,17 +937,13 @@ class ExtractorsApi:
942
937
  _content_type: Optional[StrictStr] = None,
943
938
  _headers: Optional[Dict[StrictStr, Any]] = None,
944
939
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
945
- ) -> ApiResponse[List[Extractor]]:
946
- """List extractors.
940
+ ) -> ApiResponse[List[GroupSharePermission]]:
941
+ """Returns a list of group access permissions for a given extractor.
947
942
 
948
- List extractors. The output is sorted by create time in descending order.
943
+ The returned list of group permissions denoting which groups have access to the extractor.
949
944
 
950
- :param offset: How many extractors to skip before returning.
951
- :type offset: int
952
- :param limit: How many extractors to return.
953
- :type limit: int
954
- :param name_filter: Filter extractors by name.
955
- :type name_filter: str
945
+ :param extractor_id: Id of the extractor. (required)
946
+ :type extractor_id: str
956
947
  :param _request_timeout: timeout setting for this request. If one
957
948
  number provided, it will be total request
958
949
  timeout. It can also be a pair (tuple) of
@@ -975,10 +966,8 @@ class ExtractorsApi:
975
966
  :return: Returns the result object.
976
967
  """ # noqa: E501
977
968
 
978
- _param = self._list_extractors_serialize(
979
- offset=offset,
980
- limit=limit,
981
- name_filter=name_filter,
969
+ _param = self._get_extractor_group_permissions_serialize(
970
+ extractor_id=extractor_id,
982
971
  _request_auth=_request_auth,
983
972
  _content_type=_content_type,
984
973
  _headers=_headers,
@@ -986,7 +975,7 @@ class ExtractorsApi:
986
975
  )
987
976
 
988
977
  _response_types_map: Dict[str, Optional[str]] = {
989
- '200': "List[Extractor]",
978
+ '200': "List[GroupSharePermission]",
990
979
  '401': "EndpointError",
991
980
  }
992
981
  response_data = await self.api_client.call_api(
@@ -1001,11 +990,9 @@ class ExtractorsApi:
1001
990
 
1002
991
 
1003
992
  @validate_call
1004
- async def list_extractors_without_preload_content(
993
+ async def get_extractor_group_permissions_without_preload_content(
1005
994
  self,
1006
- offset: Annotated[Optional[StrictInt], Field(description="How many extractors to skip before returning.")] = None,
1007
- limit: Annotated[Optional[StrictInt], Field(description="How many extractors to return.")] = None,
1008
- name_filter: Annotated[Optional[StrictStr], Field(description="Filter extractors by name.")] = None,
995
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
1009
996
  _request_timeout: Union[
1010
997
  None,
1011
998
  Annotated[StrictFloat, Field(gt=0)],
@@ -1019,16 +1006,12 @@ class ExtractorsApi:
1019
1006
  _headers: Optional[Dict[StrictStr, Any]] = None,
1020
1007
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1021
1008
  ) -> RESTResponseType:
1022
- """List extractors.
1009
+ """Returns a list of group access permissions for a given extractor.
1023
1010
 
1024
- List extractors. The output is sorted by create time in descending order.
1011
+ The returned list of group permissions denoting which groups have access to the extractor.
1025
1012
 
1026
- :param offset: How many extractors to skip before returning.
1027
- :type offset: int
1028
- :param limit: How many extractors to return.
1029
- :type limit: int
1030
- :param name_filter: Filter extractors by name.
1031
- :type name_filter: str
1013
+ :param extractor_id: Id of the extractor. (required)
1014
+ :type extractor_id: str
1032
1015
  :param _request_timeout: timeout setting for this request. If one
1033
1016
  number provided, it will be total request
1034
1017
  timeout. It can also be a pair (tuple) of
@@ -1051,10 +1034,8 @@ class ExtractorsApi:
1051
1034
  :return: Returns the result object.
1052
1035
  """ # noqa: E501
1053
1036
 
1054
- _param = self._list_extractors_serialize(
1055
- offset=offset,
1056
- limit=limit,
1057
- name_filter=name_filter,
1037
+ _param = self._get_extractor_group_permissions_serialize(
1038
+ extractor_id=extractor_id,
1058
1039
  _request_auth=_request_auth,
1059
1040
  _content_type=_content_type,
1060
1041
  _headers=_headers,
@@ -1062,7 +1043,7 @@ class ExtractorsApi:
1062
1043
  )
1063
1044
 
1064
1045
  _response_types_map: Dict[str, Optional[str]] = {
1065
- '200': "List[Extractor]",
1046
+ '200': "List[GroupSharePermission]",
1066
1047
  '401': "EndpointError",
1067
1048
  }
1068
1049
  response_data = await self.api_client.call_api(
@@ -1072,11 +1053,9 @@ class ExtractorsApi:
1072
1053
  return response_data.response
1073
1054
 
1074
1055
 
1075
- def _list_extractors_serialize(
1056
+ def _get_extractor_group_permissions_serialize(
1076
1057
  self,
1077
- offset,
1078
- limit,
1079
- name_filter,
1058
+ extractor_id,
1080
1059
  _request_auth,
1081
1060
  _content_type,
1082
1061
  _headers,
@@ -1098,19 +1077,9 @@ class ExtractorsApi:
1098
1077
  _body_params: Optional[bytes] = None
1099
1078
 
1100
1079
  # process the path parameters
1080
+ if extractor_id is not None:
1081
+ _path_params['extractor_id'] = extractor_id
1101
1082
  # process the query parameters
1102
- if offset is not None:
1103
-
1104
- _query_params.append(('offset', offset))
1105
-
1106
- if limit is not None:
1107
-
1108
- _query_params.append(('limit', limit))
1109
-
1110
- if name_filter is not None:
1111
-
1112
- _query_params.append(('name_filter', name_filter))
1113
-
1114
1083
  # process the header parameters
1115
1084
  # process the form parameters
1116
1085
  # process the body parameter
@@ -1132,7 +1101,2842 @@ class ExtractorsApi:
1132
1101
 
1133
1102
  return self.api_client.param_serialize(
1134
1103
  method='GET',
1135
- resource_path='/extractors',
1104
+ resource_path='/extractors/{extractor_id}/group_permissions',
1105
+ path_params=_path_params,
1106
+ query_params=_query_params,
1107
+ header_params=_header_params,
1108
+ body=_body_params,
1109
+ post_params=_form_params,
1110
+ files=_files,
1111
+ auth_settings=_auth_settings,
1112
+ collection_formats=_collection_formats,
1113
+ _host=_host,
1114
+ _request_auth=_request_auth
1115
+ )
1116
+
1117
+
1118
+
1119
+
1120
+ @validate_call
1121
+ async def get_extractor_permissions(
1122
+ self,
1123
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
1124
+ _request_timeout: Union[
1125
+ None,
1126
+ Annotated[StrictFloat, Field(gt=0)],
1127
+ Tuple[
1128
+ Annotated[StrictFloat, Field(gt=0)],
1129
+ Annotated[StrictFloat, Field(gt=0)]
1130
+ ]
1131
+ ] = None,
1132
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1133
+ _content_type: Optional[StrictStr] = None,
1134
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1135
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1136
+ ) -> List[SharePermission]:
1137
+ """Returns a list of users having access to given extractor.
1138
+
1139
+ The returned list of permissions denotes who has access to the extractor.
1140
+
1141
+ :param extractor_id: Id of the extractor. (required)
1142
+ :type extractor_id: str
1143
+ :param _request_timeout: timeout setting for this request. If one
1144
+ number provided, it will be total request
1145
+ timeout. It can also be a pair (tuple) of
1146
+ (connection, read) timeouts.
1147
+ :type _request_timeout: int, tuple(int, int), optional
1148
+ :param _request_auth: set to override the auth_settings for an a single
1149
+ request; this effectively ignores the
1150
+ authentication in the spec for a single request.
1151
+ :type _request_auth: dict, optional
1152
+ :param _content_type: force content-type for the request.
1153
+ :type _content_type: str, Optional
1154
+ :param _headers: set to override the headers for a single
1155
+ request; this effectively ignores the headers
1156
+ in the spec for a single request.
1157
+ :type _headers: dict, optional
1158
+ :param _host_index: set to override the host_index for a single
1159
+ request; this effectively ignores the host_index
1160
+ in the spec for a single request.
1161
+ :type _host_index: int, optional
1162
+ :return: Returns the result object.
1163
+ """ # noqa: E501
1164
+
1165
+ _param = self._get_extractor_permissions_serialize(
1166
+ extractor_id=extractor_id,
1167
+ _request_auth=_request_auth,
1168
+ _content_type=_content_type,
1169
+ _headers=_headers,
1170
+ _host_index=_host_index
1171
+ )
1172
+
1173
+ _response_types_map: Dict[str, Optional[str]] = {
1174
+ '200': "List[SharePermission]",
1175
+ '401': "EndpointError",
1176
+ }
1177
+ response_data = await self.api_client.call_api(
1178
+ *_param,
1179
+ _request_timeout=_request_timeout
1180
+ )
1181
+ await response_data.read()
1182
+ return self.api_client.response_deserialize(
1183
+ response_data=response_data,
1184
+ response_types_map=_response_types_map,
1185
+ ).data
1186
+
1187
+
1188
+ @validate_call
1189
+ async def get_extractor_permissions_with_http_info(
1190
+ self,
1191
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
1192
+ _request_timeout: Union[
1193
+ None,
1194
+ Annotated[StrictFloat, Field(gt=0)],
1195
+ Tuple[
1196
+ Annotated[StrictFloat, Field(gt=0)],
1197
+ Annotated[StrictFloat, Field(gt=0)]
1198
+ ]
1199
+ ] = None,
1200
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1201
+ _content_type: Optional[StrictStr] = None,
1202
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1203
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1204
+ ) -> ApiResponse[List[SharePermission]]:
1205
+ """Returns a list of users having access to given extractor.
1206
+
1207
+ The returned list of permissions denotes who has access to the extractor.
1208
+
1209
+ :param extractor_id: Id of the extractor. (required)
1210
+ :type extractor_id: str
1211
+ :param _request_timeout: timeout setting for this request. If one
1212
+ number provided, it will be total request
1213
+ timeout. It can also be a pair (tuple) of
1214
+ (connection, read) timeouts.
1215
+ :type _request_timeout: int, tuple(int, int), optional
1216
+ :param _request_auth: set to override the auth_settings for an a single
1217
+ request; this effectively ignores the
1218
+ authentication in the spec for a single request.
1219
+ :type _request_auth: dict, optional
1220
+ :param _content_type: force content-type for the request.
1221
+ :type _content_type: str, Optional
1222
+ :param _headers: set to override the headers for a single
1223
+ request; this effectively ignores the headers
1224
+ in the spec for a single request.
1225
+ :type _headers: dict, optional
1226
+ :param _host_index: set to override the host_index for a single
1227
+ request; this effectively ignores the host_index
1228
+ in the spec for a single request.
1229
+ :type _host_index: int, optional
1230
+ :return: Returns the result object.
1231
+ """ # noqa: E501
1232
+
1233
+ _param = self._get_extractor_permissions_serialize(
1234
+ extractor_id=extractor_id,
1235
+ _request_auth=_request_auth,
1236
+ _content_type=_content_type,
1237
+ _headers=_headers,
1238
+ _host_index=_host_index
1239
+ )
1240
+
1241
+ _response_types_map: Dict[str, Optional[str]] = {
1242
+ '200': "List[SharePermission]",
1243
+ '401': "EndpointError",
1244
+ }
1245
+ response_data = await self.api_client.call_api(
1246
+ *_param,
1247
+ _request_timeout=_request_timeout
1248
+ )
1249
+ await response_data.read()
1250
+ return self.api_client.response_deserialize(
1251
+ response_data=response_data,
1252
+ response_types_map=_response_types_map,
1253
+ )
1254
+
1255
+
1256
+ @validate_call
1257
+ async def get_extractor_permissions_without_preload_content(
1258
+ self,
1259
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
1260
+ _request_timeout: Union[
1261
+ None,
1262
+ Annotated[StrictFloat, Field(gt=0)],
1263
+ Tuple[
1264
+ Annotated[StrictFloat, Field(gt=0)],
1265
+ Annotated[StrictFloat, Field(gt=0)]
1266
+ ]
1267
+ ] = None,
1268
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1269
+ _content_type: Optional[StrictStr] = None,
1270
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1271
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1272
+ ) -> RESTResponseType:
1273
+ """Returns a list of users having access to given extractor.
1274
+
1275
+ The returned list of permissions denotes who has access to the extractor.
1276
+
1277
+ :param extractor_id: Id of the extractor. (required)
1278
+ :type extractor_id: str
1279
+ :param _request_timeout: timeout setting for this request. If one
1280
+ number provided, it will be total request
1281
+ timeout. It can also be a pair (tuple) of
1282
+ (connection, read) timeouts.
1283
+ :type _request_timeout: int, tuple(int, int), optional
1284
+ :param _request_auth: set to override the auth_settings for an a single
1285
+ request; this effectively ignores the
1286
+ authentication in the spec for a single request.
1287
+ :type _request_auth: dict, optional
1288
+ :param _content_type: force content-type for the request.
1289
+ :type _content_type: str, Optional
1290
+ :param _headers: set to override the headers for a single
1291
+ request; this effectively ignores the headers
1292
+ in the spec for a single request.
1293
+ :type _headers: dict, optional
1294
+ :param _host_index: set to override the host_index for a single
1295
+ request; this effectively ignores the host_index
1296
+ in the spec for a single request.
1297
+ :type _host_index: int, optional
1298
+ :return: Returns the result object.
1299
+ """ # noqa: E501
1300
+
1301
+ _param = self._get_extractor_permissions_serialize(
1302
+ extractor_id=extractor_id,
1303
+ _request_auth=_request_auth,
1304
+ _content_type=_content_type,
1305
+ _headers=_headers,
1306
+ _host_index=_host_index
1307
+ )
1308
+
1309
+ _response_types_map: Dict[str, Optional[str]] = {
1310
+ '200': "List[SharePermission]",
1311
+ '401': "EndpointError",
1312
+ }
1313
+ response_data = await self.api_client.call_api(
1314
+ *_param,
1315
+ _request_timeout=_request_timeout
1316
+ )
1317
+ return response_data.response
1318
+
1319
+
1320
+ def _get_extractor_permissions_serialize(
1321
+ self,
1322
+ extractor_id,
1323
+ _request_auth,
1324
+ _content_type,
1325
+ _headers,
1326
+ _host_index,
1327
+ ) -> RequestSerialized:
1328
+
1329
+ _host = None
1330
+
1331
+ _collection_formats: Dict[str, str] = {
1332
+ }
1333
+
1334
+ _path_params: Dict[str, str] = {}
1335
+ _query_params: List[Tuple[str, str]] = []
1336
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1337
+ _form_params: List[Tuple[str, str]] = []
1338
+ _files: Dict[
1339
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1340
+ ] = {}
1341
+ _body_params: Optional[bytes] = None
1342
+
1343
+ # process the path parameters
1344
+ if extractor_id is not None:
1345
+ _path_params['extractor_id'] = extractor_id
1346
+ # process the query parameters
1347
+ # process the header parameters
1348
+ # process the form parameters
1349
+ # process the body parameter
1350
+
1351
+
1352
+ # set the HTTP header `Accept`
1353
+ if 'Accept' not in _header_params:
1354
+ _header_params['Accept'] = self.api_client.select_header_accept(
1355
+ [
1356
+ 'application/json'
1357
+ ]
1358
+ )
1359
+
1360
+
1361
+ # authentication setting
1362
+ _auth_settings: List[str] = [
1363
+ 'bearerAuth'
1364
+ ]
1365
+
1366
+ return self.api_client.param_serialize(
1367
+ method='GET',
1368
+ resource_path='/extractors/{extractor_id}/permissions',
1369
+ path_params=_path_params,
1370
+ query_params=_query_params,
1371
+ header_params=_header_params,
1372
+ body=_body_params,
1373
+ post_params=_form_params,
1374
+ files=_files,
1375
+ auth_settings=_auth_settings,
1376
+ collection_formats=_collection_formats,
1377
+ _host=_host,
1378
+ _request_auth=_request_auth
1379
+ )
1380
+
1381
+
1382
+
1383
+
1384
+ @validate_call
1385
+ async def list_extractors(
1386
+ self,
1387
+ offset: Annotated[Optional[StrictInt], Field(description="How many extractors to skip before returning.")] = None,
1388
+ limit: Annotated[Optional[StrictInt], Field(description="How many extractors to return.")] = None,
1389
+ name_filter: Annotated[Optional[StrictStr], Field(description="Filter extractors by name.")] = None,
1390
+ _request_timeout: Union[
1391
+ None,
1392
+ Annotated[StrictFloat, Field(gt=0)],
1393
+ Tuple[
1394
+ Annotated[StrictFloat, Field(gt=0)],
1395
+ Annotated[StrictFloat, Field(gt=0)]
1396
+ ]
1397
+ ] = None,
1398
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1399
+ _content_type: Optional[StrictStr] = None,
1400
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1401
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1402
+ ) -> List[Extractor]:
1403
+ """List extractors.
1404
+
1405
+ List extractors. The output is sorted by create time in descending order.
1406
+
1407
+ :param offset: How many extractors to skip before returning.
1408
+ :type offset: int
1409
+ :param limit: How many extractors to return.
1410
+ :type limit: int
1411
+ :param name_filter: Filter extractors by name.
1412
+ :type name_filter: str
1413
+ :param _request_timeout: timeout setting for this request. If one
1414
+ number provided, it will be total request
1415
+ timeout. It can also be a pair (tuple) of
1416
+ (connection, read) timeouts.
1417
+ :type _request_timeout: int, tuple(int, int), optional
1418
+ :param _request_auth: set to override the auth_settings for an a single
1419
+ request; this effectively ignores the
1420
+ authentication in the spec for a single request.
1421
+ :type _request_auth: dict, optional
1422
+ :param _content_type: force content-type for the request.
1423
+ :type _content_type: str, Optional
1424
+ :param _headers: set to override the headers for a single
1425
+ request; this effectively ignores the headers
1426
+ in the spec for a single request.
1427
+ :type _headers: dict, optional
1428
+ :param _host_index: set to override the host_index for a single
1429
+ request; this effectively ignores the host_index
1430
+ in the spec for a single request.
1431
+ :type _host_index: int, optional
1432
+ :return: Returns the result object.
1433
+ """ # noqa: E501
1434
+
1435
+ _param = self._list_extractors_serialize(
1436
+ offset=offset,
1437
+ limit=limit,
1438
+ name_filter=name_filter,
1439
+ _request_auth=_request_auth,
1440
+ _content_type=_content_type,
1441
+ _headers=_headers,
1442
+ _host_index=_host_index
1443
+ )
1444
+
1445
+ _response_types_map: Dict[str, Optional[str]] = {
1446
+ '200': "List[Extractor]",
1447
+ '401': "EndpointError",
1448
+ }
1449
+ response_data = await self.api_client.call_api(
1450
+ *_param,
1451
+ _request_timeout=_request_timeout
1452
+ )
1453
+ await response_data.read()
1454
+ return self.api_client.response_deserialize(
1455
+ response_data=response_data,
1456
+ response_types_map=_response_types_map,
1457
+ ).data
1458
+
1459
+
1460
+ @validate_call
1461
+ async def list_extractors_with_http_info(
1462
+ self,
1463
+ offset: Annotated[Optional[StrictInt], Field(description="How many extractors to skip before returning.")] = None,
1464
+ limit: Annotated[Optional[StrictInt], Field(description="How many extractors to return.")] = None,
1465
+ name_filter: Annotated[Optional[StrictStr], Field(description="Filter extractors by name.")] = None,
1466
+ _request_timeout: Union[
1467
+ None,
1468
+ Annotated[StrictFloat, Field(gt=0)],
1469
+ Tuple[
1470
+ Annotated[StrictFloat, Field(gt=0)],
1471
+ Annotated[StrictFloat, Field(gt=0)]
1472
+ ]
1473
+ ] = None,
1474
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1475
+ _content_type: Optional[StrictStr] = None,
1476
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1477
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1478
+ ) -> ApiResponse[List[Extractor]]:
1479
+ """List extractors.
1480
+
1481
+ List extractors. The output is sorted by create time in descending order.
1482
+
1483
+ :param offset: How many extractors to skip before returning.
1484
+ :type offset: int
1485
+ :param limit: How many extractors to return.
1486
+ :type limit: int
1487
+ :param name_filter: Filter extractors by name.
1488
+ :type name_filter: str
1489
+ :param _request_timeout: timeout setting for this request. If one
1490
+ number provided, it will be total request
1491
+ timeout. It can also be a pair (tuple) of
1492
+ (connection, read) timeouts.
1493
+ :type _request_timeout: int, tuple(int, int), optional
1494
+ :param _request_auth: set to override the auth_settings for an a single
1495
+ request; this effectively ignores the
1496
+ authentication in the spec for a single request.
1497
+ :type _request_auth: dict, optional
1498
+ :param _content_type: force content-type for the request.
1499
+ :type _content_type: str, Optional
1500
+ :param _headers: set to override the headers for a single
1501
+ request; this effectively ignores the headers
1502
+ in the spec for a single request.
1503
+ :type _headers: dict, optional
1504
+ :param _host_index: set to override the host_index for a single
1505
+ request; this effectively ignores the host_index
1506
+ in the spec for a single request.
1507
+ :type _host_index: int, optional
1508
+ :return: Returns the result object.
1509
+ """ # noqa: E501
1510
+
1511
+ _param = self._list_extractors_serialize(
1512
+ offset=offset,
1513
+ limit=limit,
1514
+ name_filter=name_filter,
1515
+ _request_auth=_request_auth,
1516
+ _content_type=_content_type,
1517
+ _headers=_headers,
1518
+ _host_index=_host_index
1519
+ )
1520
+
1521
+ _response_types_map: Dict[str, Optional[str]] = {
1522
+ '200': "List[Extractor]",
1523
+ '401': "EndpointError",
1524
+ }
1525
+ response_data = await self.api_client.call_api(
1526
+ *_param,
1527
+ _request_timeout=_request_timeout
1528
+ )
1529
+ await response_data.read()
1530
+ return self.api_client.response_deserialize(
1531
+ response_data=response_data,
1532
+ response_types_map=_response_types_map,
1533
+ )
1534
+
1535
+
1536
+ @validate_call
1537
+ async def list_extractors_without_preload_content(
1538
+ self,
1539
+ offset: Annotated[Optional[StrictInt], Field(description="How many extractors to skip before returning.")] = None,
1540
+ limit: Annotated[Optional[StrictInt], Field(description="How many extractors to return.")] = None,
1541
+ name_filter: Annotated[Optional[StrictStr], Field(description="Filter extractors by name.")] = None,
1542
+ _request_timeout: Union[
1543
+ None,
1544
+ Annotated[StrictFloat, Field(gt=0)],
1545
+ Tuple[
1546
+ Annotated[StrictFloat, Field(gt=0)],
1547
+ Annotated[StrictFloat, Field(gt=0)]
1548
+ ]
1549
+ ] = None,
1550
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1551
+ _content_type: Optional[StrictStr] = None,
1552
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1553
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1554
+ ) -> RESTResponseType:
1555
+ """List extractors.
1556
+
1557
+ List extractors. The output is sorted by create time in descending order.
1558
+
1559
+ :param offset: How many extractors to skip before returning.
1560
+ :type offset: int
1561
+ :param limit: How many extractors to return.
1562
+ :type limit: int
1563
+ :param name_filter: Filter extractors by name.
1564
+ :type name_filter: str
1565
+ :param _request_timeout: timeout setting for this request. If one
1566
+ number provided, it will be total request
1567
+ timeout. It can also be a pair (tuple) of
1568
+ (connection, read) timeouts.
1569
+ :type _request_timeout: int, tuple(int, int), optional
1570
+ :param _request_auth: set to override the auth_settings for an a single
1571
+ request; this effectively ignores the
1572
+ authentication in the spec for a single request.
1573
+ :type _request_auth: dict, optional
1574
+ :param _content_type: force content-type for the request.
1575
+ :type _content_type: str, Optional
1576
+ :param _headers: set to override the headers for a single
1577
+ request; this effectively ignores the headers
1578
+ in the spec for a single request.
1579
+ :type _headers: dict, optional
1580
+ :param _host_index: set to override the host_index for a single
1581
+ request; this effectively ignores the host_index
1582
+ in the spec for a single request.
1583
+ :type _host_index: int, optional
1584
+ :return: Returns the result object.
1585
+ """ # noqa: E501
1586
+
1587
+ _param = self._list_extractors_serialize(
1588
+ offset=offset,
1589
+ limit=limit,
1590
+ name_filter=name_filter,
1591
+ _request_auth=_request_auth,
1592
+ _content_type=_content_type,
1593
+ _headers=_headers,
1594
+ _host_index=_host_index
1595
+ )
1596
+
1597
+ _response_types_map: Dict[str, Optional[str]] = {
1598
+ '200': "List[Extractor]",
1599
+ '401': "EndpointError",
1600
+ }
1601
+ response_data = await self.api_client.call_api(
1602
+ *_param,
1603
+ _request_timeout=_request_timeout
1604
+ )
1605
+ return response_data.response
1606
+
1607
+
1608
+ def _list_extractors_serialize(
1609
+ self,
1610
+ offset,
1611
+ limit,
1612
+ name_filter,
1613
+ _request_auth,
1614
+ _content_type,
1615
+ _headers,
1616
+ _host_index,
1617
+ ) -> RequestSerialized:
1618
+
1619
+ _host = None
1620
+
1621
+ _collection_formats: Dict[str, str] = {
1622
+ }
1623
+
1624
+ _path_params: Dict[str, str] = {}
1625
+ _query_params: List[Tuple[str, str]] = []
1626
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1627
+ _form_params: List[Tuple[str, str]] = []
1628
+ _files: Dict[
1629
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1630
+ ] = {}
1631
+ _body_params: Optional[bytes] = None
1632
+
1633
+ # process the path parameters
1634
+ # process the query parameters
1635
+ if offset is not None:
1636
+
1637
+ _query_params.append(('offset', offset))
1638
+
1639
+ if limit is not None:
1640
+
1641
+ _query_params.append(('limit', limit))
1642
+
1643
+ if name_filter is not None:
1644
+
1645
+ _query_params.append(('name_filter', name_filter))
1646
+
1647
+ # process the header parameters
1648
+ # process the form parameters
1649
+ # process the body parameter
1650
+
1651
+
1652
+ # set the HTTP header `Accept`
1653
+ if 'Accept' not in _header_params:
1654
+ _header_params['Accept'] = self.api_client.select_header_accept(
1655
+ [
1656
+ 'application/json'
1657
+ ]
1658
+ )
1659
+
1660
+
1661
+ # authentication setting
1662
+ _auth_settings: List[str] = [
1663
+ 'bearerAuth'
1664
+ ]
1665
+
1666
+ return self.api_client.param_serialize(
1667
+ method='GET',
1668
+ resource_path='/extractors',
1669
+ path_params=_path_params,
1670
+ query_params=_query_params,
1671
+ header_params=_header_params,
1672
+ body=_body_params,
1673
+ post_params=_form_params,
1674
+ files=_files,
1675
+ auth_settings=_auth_settings,
1676
+ collection_formats=_collection_formats,
1677
+ _host=_host,
1678
+ _request_auth=_request_auth
1679
+ )
1680
+
1681
+
1682
+
1683
+
1684
+ @validate_call
1685
+ async def reset_and_share_extractor(
1686
+ self,
1687
+ extractor_id: Annotated[StrictStr, Field(description="Id of an extractor.")],
1688
+ reset_and_share_request: Annotated[ResetAndShareRequest, Field(description="List of usernames the extractor should be shared with.")],
1689
+ _request_timeout: Union[
1690
+ None,
1691
+ Annotated[StrictFloat, Field(gt=0)],
1692
+ Tuple[
1693
+ Annotated[StrictFloat, Field(gt=0)],
1694
+ Annotated[StrictFloat, Field(gt=0)]
1695
+ ]
1696
+ ] = None,
1697
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1698
+ _content_type: Optional[StrictStr] = None,
1699
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1700
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1701
+ ) -> None:
1702
+ """Resets and shares an extractor to a new list of users.
1703
+
1704
+ Resets and shares an extractor to a new list of users.
1705
+
1706
+ :param extractor_id: Id of an extractor. (required)
1707
+ :type extractor_id: str
1708
+ :param reset_and_share_request: List of usernames the extractor should be shared with. (required)
1709
+ :type reset_and_share_request: ResetAndShareRequest
1710
+ :param _request_timeout: timeout setting for this request. If one
1711
+ number provided, it will be total request
1712
+ timeout. It can also be a pair (tuple) of
1713
+ (connection, read) timeouts.
1714
+ :type _request_timeout: int, tuple(int, int), optional
1715
+ :param _request_auth: set to override the auth_settings for an a single
1716
+ request; this effectively ignores the
1717
+ authentication in the spec for a single request.
1718
+ :type _request_auth: dict, optional
1719
+ :param _content_type: force content-type for the request.
1720
+ :type _content_type: str, Optional
1721
+ :param _headers: set to override the headers for a single
1722
+ request; this effectively ignores the headers
1723
+ in the spec for a single request.
1724
+ :type _headers: dict, optional
1725
+ :param _host_index: set to override the host_index for a single
1726
+ request; this effectively ignores the host_index
1727
+ in the spec for a single request.
1728
+ :type _host_index: int, optional
1729
+ :return: Returns the result object.
1730
+ """ # noqa: E501
1731
+
1732
+ _param = self._reset_and_share_extractor_serialize(
1733
+ extractor_id=extractor_id,
1734
+ reset_and_share_request=reset_and_share_request,
1735
+ _request_auth=_request_auth,
1736
+ _content_type=_content_type,
1737
+ _headers=_headers,
1738
+ _host_index=_host_index
1739
+ )
1740
+
1741
+ _response_types_map: Dict[str, Optional[str]] = {
1742
+ '204': None,
1743
+ '401': "EndpointError",
1744
+ }
1745
+ response_data = await self.api_client.call_api(
1746
+ *_param,
1747
+ _request_timeout=_request_timeout
1748
+ )
1749
+ await response_data.read()
1750
+ return self.api_client.response_deserialize(
1751
+ response_data=response_data,
1752
+ response_types_map=_response_types_map,
1753
+ ).data
1754
+
1755
+
1756
+ @validate_call
1757
+ async def reset_and_share_extractor_with_http_info(
1758
+ self,
1759
+ extractor_id: Annotated[StrictStr, Field(description="Id of an extractor.")],
1760
+ reset_and_share_request: Annotated[ResetAndShareRequest, Field(description="List of usernames the extractor should be shared with.")],
1761
+ _request_timeout: Union[
1762
+ None,
1763
+ Annotated[StrictFloat, Field(gt=0)],
1764
+ Tuple[
1765
+ Annotated[StrictFloat, Field(gt=0)],
1766
+ Annotated[StrictFloat, Field(gt=0)]
1767
+ ]
1768
+ ] = None,
1769
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1770
+ _content_type: Optional[StrictStr] = None,
1771
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1772
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1773
+ ) -> ApiResponse[None]:
1774
+ """Resets and shares an extractor to a new list of users.
1775
+
1776
+ Resets and shares an extractor to a new list of users.
1777
+
1778
+ :param extractor_id: Id of an extractor. (required)
1779
+ :type extractor_id: str
1780
+ :param reset_and_share_request: List of usernames the extractor should be shared with. (required)
1781
+ :type reset_and_share_request: ResetAndShareRequest
1782
+ :param _request_timeout: timeout setting for this request. If one
1783
+ number provided, it will be total request
1784
+ timeout. It can also be a pair (tuple) of
1785
+ (connection, read) timeouts.
1786
+ :type _request_timeout: int, tuple(int, int), optional
1787
+ :param _request_auth: set to override the auth_settings for an a single
1788
+ request; this effectively ignores the
1789
+ authentication in the spec for a single request.
1790
+ :type _request_auth: dict, optional
1791
+ :param _content_type: force content-type for the request.
1792
+ :type _content_type: str, Optional
1793
+ :param _headers: set to override the headers for a single
1794
+ request; this effectively ignores the headers
1795
+ in the spec for a single request.
1796
+ :type _headers: dict, optional
1797
+ :param _host_index: set to override the host_index for a single
1798
+ request; this effectively ignores the host_index
1799
+ in the spec for a single request.
1800
+ :type _host_index: int, optional
1801
+ :return: Returns the result object.
1802
+ """ # noqa: E501
1803
+
1804
+ _param = self._reset_and_share_extractor_serialize(
1805
+ extractor_id=extractor_id,
1806
+ reset_and_share_request=reset_and_share_request,
1807
+ _request_auth=_request_auth,
1808
+ _content_type=_content_type,
1809
+ _headers=_headers,
1810
+ _host_index=_host_index
1811
+ )
1812
+
1813
+ _response_types_map: Dict[str, Optional[str]] = {
1814
+ '204': None,
1815
+ '401': "EndpointError",
1816
+ }
1817
+ response_data = await self.api_client.call_api(
1818
+ *_param,
1819
+ _request_timeout=_request_timeout
1820
+ )
1821
+ await response_data.read()
1822
+ return self.api_client.response_deserialize(
1823
+ response_data=response_data,
1824
+ response_types_map=_response_types_map,
1825
+ )
1826
+
1827
+
1828
+ @validate_call
1829
+ async def reset_and_share_extractor_without_preload_content(
1830
+ self,
1831
+ extractor_id: Annotated[StrictStr, Field(description="Id of an extractor.")],
1832
+ reset_and_share_request: Annotated[ResetAndShareRequest, Field(description="List of usernames the extractor should be shared with.")],
1833
+ _request_timeout: Union[
1834
+ None,
1835
+ Annotated[StrictFloat, Field(gt=0)],
1836
+ Tuple[
1837
+ Annotated[StrictFloat, Field(gt=0)],
1838
+ Annotated[StrictFloat, Field(gt=0)]
1839
+ ]
1840
+ ] = None,
1841
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1842
+ _content_type: Optional[StrictStr] = None,
1843
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1844
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1845
+ ) -> RESTResponseType:
1846
+ """Resets and shares an extractor to a new list of users.
1847
+
1848
+ Resets and shares an extractor to a new list of users.
1849
+
1850
+ :param extractor_id: Id of an extractor. (required)
1851
+ :type extractor_id: str
1852
+ :param reset_and_share_request: List of usernames the extractor should be shared with. (required)
1853
+ :type reset_and_share_request: ResetAndShareRequest
1854
+ :param _request_timeout: timeout setting for this request. If one
1855
+ number provided, it will be total request
1856
+ timeout. It can also be a pair (tuple) of
1857
+ (connection, read) timeouts.
1858
+ :type _request_timeout: int, tuple(int, int), optional
1859
+ :param _request_auth: set to override the auth_settings for an a single
1860
+ request; this effectively ignores the
1861
+ authentication in the spec for a single request.
1862
+ :type _request_auth: dict, optional
1863
+ :param _content_type: force content-type for the request.
1864
+ :type _content_type: str, Optional
1865
+ :param _headers: set to override the headers for a single
1866
+ request; this effectively ignores the headers
1867
+ in the spec for a single request.
1868
+ :type _headers: dict, optional
1869
+ :param _host_index: set to override the host_index for a single
1870
+ request; this effectively ignores the host_index
1871
+ in the spec for a single request.
1872
+ :type _host_index: int, optional
1873
+ :return: Returns the result object.
1874
+ """ # noqa: E501
1875
+
1876
+ _param = self._reset_and_share_extractor_serialize(
1877
+ extractor_id=extractor_id,
1878
+ reset_and_share_request=reset_and_share_request,
1879
+ _request_auth=_request_auth,
1880
+ _content_type=_content_type,
1881
+ _headers=_headers,
1882
+ _host_index=_host_index
1883
+ )
1884
+
1885
+ _response_types_map: Dict[str, Optional[str]] = {
1886
+ '204': None,
1887
+ '401': "EndpointError",
1888
+ }
1889
+ response_data = await self.api_client.call_api(
1890
+ *_param,
1891
+ _request_timeout=_request_timeout
1892
+ )
1893
+ return response_data.response
1894
+
1895
+
1896
+ def _reset_and_share_extractor_serialize(
1897
+ self,
1898
+ extractor_id,
1899
+ reset_and_share_request,
1900
+ _request_auth,
1901
+ _content_type,
1902
+ _headers,
1903
+ _host_index,
1904
+ ) -> RequestSerialized:
1905
+
1906
+ _host = None
1907
+
1908
+ _collection_formats: Dict[str, str] = {
1909
+ }
1910
+
1911
+ _path_params: Dict[str, str] = {}
1912
+ _query_params: List[Tuple[str, str]] = []
1913
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1914
+ _form_params: List[Tuple[str, str]] = []
1915
+ _files: Dict[
1916
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1917
+ ] = {}
1918
+ _body_params: Optional[bytes] = None
1919
+
1920
+ # process the path parameters
1921
+ if extractor_id is not None:
1922
+ _path_params['extractor_id'] = extractor_id
1923
+ # process the query parameters
1924
+ # process the header parameters
1925
+ # process the form parameters
1926
+ # process the body parameter
1927
+ if reset_and_share_request is not None:
1928
+ _body_params = reset_and_share_request
1929
+
1930
+
1931
+ # set the HTTP header `Accept`
1932
+ if 'Accept' not in _header_params:
1933
+ _header_params['Accept'] = self.api_client.select_header_accept(
1934
+ [
1935
+ 'application/json'
1936
+ ]
1937
+ )
1938
+
1939
+ # set the HTTP header `Content-Type`
1940
+ if _content_type:
1941
+ _header_params['Content-Type'] = _content_type
1942
+ else:
1943
+ _default_content_type = (
1944
+ self.api_client.select_header_content_type(
1945
+ [
1946
+ 'application/json'
1947
+ ]
1948
+ )
1949
+ )
1950
+ if _default_content_type is not None:
1951
+ _header_params['Content-Type'] = _default_content_type
1952
+
1953
+ # authentication setting
1954
+ _auth_settings: List[str] = [
1955
+ 'bearerAuth'
1956
+ ]
1957
+
1958
+ return self.api_client.param_serialize(
1959
+ method='PUT',
1960
+ resource_path='/extractors/{extractor_id}/permissions',
1961
+ path_params=_path_params,
1962
+ query_params=_query_params,
1963
+ header_params=_header_params,
1964
+ body=_body_params,
1965
+ post_params=_form_params,
1966
+ files=_files,
1967
+ auth_settings=_auth_settings,
1968
+ collection_formats=_collection_formats,
1969
+ _host=_host,
1970
+ _request_auth=_request_auth
1971
+ )
1972
+
1973
+
1974
+
1975
+
1976
+ @validate_call
1977
+ async def reset_and_share_extractor_with_groups(
1978
+ self,
1979
+ extractor_id: Annotated[StrictStr, Field(description="Id of an extractor")],
1980
+ reset_and_share_with_groups_request: Annotated[ResetAndShareWithGroupsRequest, Field(description="List of group ids the extractor should be shared with.")],
1981
+ _request_timeout: Union[
1982
+ None,
1983
+ Annotated[StrictFloat, Field(gt=0)],
1984
+ Tuple[
1985
+ Annotated[StrictFloat, Field(gt=0)],
1986
+ Annotated[StrictFloat, Field(gt=0)]
1987
+ ]
1988
+ ] = None,
1989
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1990
+ _content_type: Optional[StrictStr] = None,
1991
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1992
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1993
+ ) -> None:
1994
+ """Resets and shares an extractor to a new list of groups.
1995
+
1996
+ Resets and shares an extractor to a new list of groups.
1997
+
1998
+ :param extractor_id: Id of an extractor (required)
1999
+ :type extractor_id: str
2000
+ :param reset_and_share_with_groups_request: List of group ids the extractor should be shared with. (required)
2001
+ :type reset_and_share_with_groups_request: ResetAndShareWithGroupsRequest
2002
+ :param _request_timeout: timeout setting for this request. If one
2003
+ number provided, it will be total request
2004
+ timeout. It can also be a pair (tuple) of
2005
+ (connection, read) timeouts.
2006
+ :type _request_timeout: int, tuple(int, int), optional
2007
+ :param _request_auth: set to override the auth_settings for an a single
2008
+ request; this effectively ignores the
2009
+ authentication in the spec for a single request.
2010
+ :type _request_auth: dict, optional
2011
+ :param _content_type: force content-type for the request.
2012
+ :type _content_type: str, Optional
2013
+ :param _headers: set to override the headers for a single
2014
+ request; this effectively ignores the headers
2015
+ in the spec for a single request.
2016
+ :type _headers: dict, optional
2017
+ :param _host_index: set to override the host_index for a single
2018
+ request; this effectively ignores the host_index
2019
+ in the spec for a single request.
2020
+ :type _host_index: int, optional
2021
+ :return: Returns the result object.
2022
+ """ # noqa: E501
2023
+
2024
+ _param = self._reset_and_share_extractor_with_groups_serialize(
2025
+ extractor_id=extractor_id,
2026
+ reset_and_share_with_groups_request=reset_and_share_with_groups_request,
2027
+ _request_auth=_request_auth,
2028
+ _content_type=_content_type,
2029
+ _headers=_headers,
2030
+ _host_index=_host_index
2031
+ )
2032
+
2033
+ _response_types_map: Dict[str, Optional[str]] = {
2034
+ '204': None,
2035
+ '401': "EndpointError",
2036
+ }
2037
+ response_data = await self.api_client.call_api(
2038
+ *_param,
2039
+ _request_timeout=_request_timeout
2040
+ )
2041
+ await response_data.read()
2042
+ return self.api_client.response_deserialize(
2043
+ response_data=response_data,
2044
+ response_types_map=_response_types_map,
2045
+ ).data
2046
+
2047
+
2048
+ @validate_call
2049
+ async def reset_and_share_extractor_with_groups_with_http_info(
2050
+ self,
2051
+ extractor_id: Annotated[StrictStr, Field(description="Id of an extractor")],
2052
+ reset_and_share_with_groups_request: Annotated[ResetAndShareWithGroupsRequest, Field(description="List of group ids the extractor should be shared with.")],
2053
+ _request_timeout: Union[
2054
+ None,
2055
+ Annotated[StrictFloat, Field(gt=0)],
2056
+ Tuple[
2057
+ Annotated[StrictFloat, Field(gt=0)],
2058
+ Annotated[StrictFloat, Field(gt=0)]
2059
+ ]
2060
+ ] = None,
2061
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2062
+ _content_type: Optional[StrictStr] = None,
2063
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2064
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2065
+ ) -> ApiResponse[None]:
2066
+ """Resets and shares an extractor to a new list of groups.
2067
+
2068
+ Resets and shares an extractor to a new list of groups.
2069
+
2070
+ :param extractor_id: Id of an extractor (required)
2071
+ :type extractor_id: str
2072
+ :param reset_and_share_with_groups_request: List of group ids the extractor should be shared with. (required)
2073
+ :type reset_and_share_with_groups_request: ResetAndShareWithGroupsRequest
2074
+ :param _request_timeout: timeout setting for this request. If one
2075
+ number provided, it will be total request
2076
+ timeout. It can also be a pair (tuple) of
2077
+ (connection, read) timeouts.
2078
+ :type _request_timeout: int, tuple(int, int), optional
2079
+ :param _request_auth: set to override the auth_settings for an a single
2080
+ request; this effectively ignores the
2081
+ authentication in the spec for a single request.
2082
+ :type _request_auth: dict, optional
2083
+ :param _content_type: force content-type for the request.
2084
+ :type _content_type: str, Optional
2085
+ :param _headers: set to override the headers for a single
2086
+ request; this effectively ignores the headers
2087
+ in the spec for a single request.
2088
+ :type _headers: dict, optional
2089
+ :param _host_index: set to override the host_index for a single
2090
+ request; this effectively ignores the host_index
2091
+ in the spec for a single request.
2092
+ :type _host_index: int, optional
2093
+ :return: Returns the result object.
2094
+ """ # noqa: E501
2095
+
2096
+ _param = self._reset_and_share_extractor_with_groups_serialize(
2097
+ extractor_id=extractor_id,
2098
+ reset_and_share_with_groups_request=reset_and_share_with_groups_request,
2099
+ _request_auth=_request_auth,
2100
+ _content_type=_content_type,
2101
+ _headers=_headers,
2102
+ _host_index=_host_index
2103
+ )
2104
+
2105
+ _response_types_map: Dict[str, Optional[str]] = {
2106
+ '204': None,
2107
+ '401': "EndpointError",
2108
+ }
2109
+ response_data = await self.api_client.call_api(
2110
+ *_param,
2111
+ _request_timeout=_request_timeout
2112
+ )
2113
+ await response_data.read()
2114
+ return self.api_client.response_deserialize(
2115
+ response_data=response_data,
2116
+ response_types_map=_response_types_map,
2117
+ )
2118
+
2119
+
2120
+ @validate_call
2121
+ async def reset_and_share_extractor_with_groups_without_preload_content(
2122
+ self,
2123
+ extractor_id: Annotated[StrictStr, Field(description="Id of an extractor")],
2124
+ reset_and_share_with_groups_request: Annotated[ResetAndShareWithGroupsRequest, Field(description="List of group ids the extractor should be shared with.")],
2125
+ _request_timeout: Union[
2126
+ None,
2127
+ Annotated[StrictFloat, Field(gt=0)],
2128
+ Tuple[
2129
+ Annotated[StrictFloat, Field(gt=0)],
2130
+ Annotated[StrictFloat, Field(gt=0)]
2131
+ ]
2132
+ ] = None,
2133
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2134
+ _content_type: Optional[StrictStr] = None,
2135
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2136
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2137
+ ) -> RESTResponseType:
2138
+ """Resets and shares an extractor to a new list of groups.
2139
+
2140
+ Resets and shares an extractor to a new list of groups.
2141
+
2142
+ :param extractor_id: Id of an extractor (required)
2143
+ :type extractor_id: str
2144
+ :param reset_and_share_with_groups_request: List of group ids the extractor should be shared with. (required)
2145
+ :type reset_and_share_with_groups_request: ResetAndShareWithGroupsRequest
2146
+ :param _request_timeout: timeout setting for this request. If one
2147
+ number provided, it will be total request
2148
+ timeout. It can also be a pair (tuple) of
2149
+ (connection, read) timeouts.
2150
+ :type _request_timeout: int, tuple(int, int), optional
2151
+ :param _request_auth: set to override the auth_settings for an a single
2152
+ request; this effectively ignores the
2153
+ authentication in the spec for a single request.
2154
+ :type _request_auth: dict, optional
2155
+ :param _content_type: force content-type for the request.
2156
+ :type _content_type: str, Optional
2157
+ :param _headers: set to override the headers for a single
2158
+ request; this effectively ignores the headers
2159
+ in the spec for a single request.
2160
+ :type _headers: dict, optional
2161
+ :param _host_index: set to override the host_index for a single
2162
+ request; this effectively ignores the host_index
2163
+ in the spec for a single request.
2164
+ :type _host_index: int, optional
2165
+ :return: Returns the result object.
2166
+ """ # noqa: E501
2167
+
2168
+ _param = self._reset_and_share_extractor_with_groups_serialize(
2169
+ extractor_id=extractor_id,
2170
+ reset_and_share_with_groups_request=reset_and_share_with_groups_request,
2171
+ _request_auth=_request_auth,
2172
+ _content_type=_content_type,
2173
+ _headers=_headers,
2174
+ _host_index=_host_index
2175
+ )
2176
+
2177
+ _response_types_map: Dict[str, Optional[str]] = {
2178
+ '204': None,
2179
+ '401': "EndpointError",
2180
+ }
2181
+ response_data = await self.api_client.call_api(
2182
+ *_param,
2183
+ _request_timeout=_request_timeout
2184
+ )
2185
+ return response_data.response
2186
+
2187
+
2188
+ def _reset_and_share_extractor_with_groups_serialize(
2189
+ self,
2190
+ extractor_id,
2191
+ reset_and_share_with_groups_request,
2192
+ _request_auth,
2193
+ _content_type,
2194
+ _headers,
2195
+ _host_index,
2196
+ ) -> RequestSerialized:
2197
+
2198
+ _host = None
2199
+
2200
+ _collection_formats: Dict[str, str] = {
2201
+ }
2202
+
2203
+ _path_params: Dict[str, str] = {}
2204
+ _query_params: List[Tuple[str, str]] = []
2205
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2206
+ _form_params: List[Tuple[str, str]] = []
2207
+ _files: Dict[
2208
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2209
+ ] = {}
2210
+ _body_params: Optional[bytes] = None
2211
+
2212
+ # process the path parameters
2213
+ if extractor_id is not None:
2214
+ _path_params['extractor_id'] = extractor_id
2215
+ # process the query parameters
2216
+ # process the header parameters
2217
+ # process the form parameters
2218
+ # process the body parameter
2219
+ if reset_and_share_with_groups_request is not None:
2220
+ _body_params = reset_and_share_with_groups_request
2221
+
2222
+
2223
+ # set the HTTP header `Accept`
2224
+ if 'Accept' not in _header_params:
2225
+ _header_params['Accept'] = self.api_client.select_header_accept(
2226
+ [
2227
+ 'application/json'
2228
+ ]
2229
+ )
2230
+
2231
+ # set the HTTP header `Content-Type`
2232
+ if _content_type:
2233
+ _header_params['Content-Type'] = _content_type
2234
+ else:
2235
+ _default_content_type = (
2236
+ self.api_client.select_header_content_type(
2237
+ [
2238
+ 'application/json'
2239
+ ]
2240
+ )
2241
+ )
2242
+ if _default_content_type is not None:
2243
+ _header_params['Content-Type'] = _default_content_type
2244
+
2245
+ # authentication setting
2246
+ _auth_settings: List[str] = [
2247
+ 'bearerAuth'
2248
+ ]
2249
+
2250
+ return self.api_client.param_serialize(
2251
+ method='PUT',
2252
+ resource_path='/extractors/{extractor_id}/group_permissions',
2253
+ path_params=_path_params,
2254
+ query_params=_query_params,
2255
+ header_params=_header_params,
2256
+ body=_body_params,
2257
+ post_params=_form_params,
2258
+ files=_files,
2259
+ auth_settings=_auth_settings,
2260
+ collection_formats=_collection_formats,
2261
+ _host=_host,
2262
+ _request_auth=_request_auth
2263
+ )
2264
+
2265
+
2266
+
2267
+
2268
+ @validate_call
2269
+ async def share_extractor(
2270
+ self,
2271
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
2272
+ username: Annotated[StrictStr, Field(description="User name that will obtain access to the extractor")],
2273
+ _request_timeout: Union[
2274
+ None,
2275
+ Annotated[StrictFloat, Field(gt=0)],
2276
+ Tuple[
2277
+ Annotated[StrictFloat, Field(gt=0)],
2278
+ Annotated[StrictFloat, Field(gt=0)]
2279
+ ]
2280
+ ] = None,
2281
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2282
+ _content_type: Optional[StrictStr] = None,
2283
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2284
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2285
+ ) -> None:
2286
+ """Shares an extractor to a user.
2287
+
2288
+ Shares an extractor to a user.
2289
+
2290
+ :param extractor_id: Id of the extractor. (required)
2291
+ :type extractor_id: str
2292
+ :param username: User name that will obtain access to the extractor (required)
2293
+ :type username: str
2294
+ :param _request_timeout: timeout setting for this request. If one
2295
+ number provided, it will be total request
2296
+ timeout. It can also be a pair (tuple) of
2297
+ (connection, read) timeouts.
2298
+ :type _request_timeout: int, tuple(int, int), optional
2299
+ :param _request_auth: set to override the auth_settings for an a single
2300
+ request; this effectively ignores the
2301
+ authentication in the spec for a single request.
2302
+ :type _request_auth: dict, optional
2303
+ :param _content_type: force content-type for the request.
2304
+ :type _content_type: str, Optional
2305
+ :param _headers: set to override the headers for a single
2306
+ request; this effectively ignores the headers
2307
+ in the spec for a single request.
2308
+ :type _headers: dict, optional
2309
+ :param _host_index: set to override the host_index for a single
2310
+ request; this effectively ignores the host_index
2311
+ in the spec for a single request.
2312
+ :type _host_index: int, optional
2313
+ :return: Returns the result object.
2314
+ """ # noqa: E501
2315
+
2316
+ _param = self._share_extractor_serialize(
2317
+ extractor_id=extractor_id,
2318
+ username=username,
2319
+ _request_auth=_request_auth,
2320
+ _content_type=_content_type,
2321
+ _headers=_headers,
2322
+ _host_index=_host_index
2323
+ )
2324
+
2325
+ _response_types_map: Dict[str, Optional[str]] = {
2326
+ '204': None,
2327
+ '401': "EndpointError",
2328
+ '409': "EndpointError",
2329
+ }
2330
+ response_data = await self.api_client.call_api(
2331
+ *_param,
2332
+ _request_timeout=_request_timeout
2333
+ )
2334
+ await response_data.read()
2335
+ return self.api_client.response_deserialize(
2336
+ response_data=response_data,
2337
+ response_types_map=_response_types_map,
2338
+ ).data
2339
+
2340
+
2341
+ @validate_call
2342
+ async def share_extractor_with_http_info(
2343
+ self,
2344
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
2345
+ username: Annotated[StrictStr, Field(description="User name that will obtain access to the extractor")],
2346
+ _request_timeout: Union[
2347
+ None,
2348
+ Annotated[StrictFloat, Field(gt=0)],
2349
+ Tuple[
2350
+ Annotated[StrictFloat, Field(gt=0)],
2351
+ Annotated[StrictFloat, Field(gt=0)]
2352
+ ]
2353
+ ] = None,
2354
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2355
+ _content_type: Optional[StrictStr] = None,
2356
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2357
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2358
+ ) -> ApiResponse[None]:
2359
+ """Shares an extractor to a user.
2360
+
2361
+ Shares an extractor to a user.
2362
+
2363
+ :param extractor_id: Id of the extractor. (required)
2364
+ :type extractor_id: str
2365
+ :param username: User name that will obtain access to the extractor (required)
2366
+ :type username: str
2367
+ :param _request_timeout: timeout setting for this request. If one
2368
+ number provided, it will be total request
2369
+ timeout. It can also be a pair (tuple) of
2370
+ (connection, read) timeouts.
2371
+ :type _request_timeout: int, tuple(int, int), optional
2372
+ :param _request_auth: set to override the auth_settings for an a single
2373
+ request; this effectively ignores the
2374
+ authentication in the spec for a single request.
2375
+ :type _request_auth: dict, optional
2376
+ :param _content_type: force content-type for the request.
2377
+ :type _content_type: str, Optional
2378
+ :param _headers: set to override the headers for a single
2379
+ request; this effectively ignores the headers
2380
+ in the spec for a single request.
2381
+ :type _headers: dict, optional
2382
+ :param _host_index: set to override the host_index for a single
2383
+ request; this effectively ignores the host_index
2384
+ in the spec for a single request.
2385
+ :type _host_index: int, optional
2386
+ :return: Returns the result object.
2387
+ """ # noqa: E501
2388
+
2389
+ _param = self._share_extractor_serialize(
2390
+ extractor_id=extractor_id,
2391
+ username=username,
2392
+ _request_auth=_request_auth,
2393
+ _content_type=_content_type,
2394
+ _headers=_headers,
2395
+ _host_index=_host_index
2396
+ )
2397
+
2398
+ _response_types_map: Dict[str, Optional[str]] = {
2399
+ '204': None,
2400
+ '401': "EndpointError",
2401
+ '409': "EndpointError",
2402
+ }
2403
+ response_data = await self.api_client.call_api(
2404
+ *_param,
2405
+ _request_timeout=_request_timeout
2406
+ )
2407
+ await response_data.read()
2408
+ return self.api_client.response_deserialize(
2409
+ response_data=response_data,
2410
+ response_types_map=_response_types_map,
2411
+ )
2412
+
2413
+
2414
+ @validate_call
2415
+ async def share_extractor_without_preload_content(
2416
+ self,
2417
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
2418
+ username: Annotated[StrictStr, Field(description="User name that will obtain access to the extractor")],
2419
+ _request_timeout: Union[
2420
+ None,
2421
+ Annotated[StrictFloat, Field(gt=0)],
2422
+ Tuple[
2423
+ Annotated[StrictFloat, Field(gt=0)],
2424
+ Annotated[StrictFloat, Field(gt=0)]
2425
+ ]
2426
+ ] = None,
2427
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2428
+ _content_type: Optional[StrictStr] = None,
2429
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2430
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2431
+ ) -> RESTResponseType:
2432
+ """Shares an extractor to a user.
2433
+
2434
+ Shares an extractor to a user.
2435
+
2436
+ :param extractor_id: Id of the extractor. (required)
2437
+ :type extractor_id: str
2438
+ :param username: User name that will obtain access to the extractor (required)
2439
+ :type username: str
2440
+ :param _request_timeout: timeout setting for this request. If one
2441
+ number provided, it will be total request
2442
+ timeout. It can also be a pair (tuple) of
2443
+ (connection, read) timeouts.
2444
+ :type _request_timeout: int, tuple(int, int), optional
2445
+ :param _request_auth: set to override the auth_settings for an a single
2446
+ request; this effectively ignores the
2447
+ authentication in the spec for a single request.
2448
+ :type _request_auth: dict, optional
2449
+ :param _content_type: force content-type for the request.
2450
+ :type _content_type: str, Optional
2451
+ :param _headers: set to override the headers for a single
2452
+ request; this effectively ignores the headers
2453
+ in the spec for a single request.
2454
+ :type _headers: dict, optional
2455
+ :param _host_index: set to override the host_index for a single
2456
+ request; this effectively ignores the host_index
2457
+ in the spec for a single request.
2458
+ :type _host_index: int, optional
2459
+ :return: Returns the result object.
2460
+ """ # noqa: E501
2461
+
2462
+ _param = self._share_extractor_serialize(
2463
+ extractor_id=extractor_id,
2464
+ username=username,
2465
+ _request_auth=_request_auth,
2466
+ _content_type=_content_type,
2467
+ _headers=_headers,
2468
+ _host_index=_host_index
2469
+ )
2470
+
2471
+ _response_types_map: Dict[str, Optional[str]] = {
2472
+ '204': None,
2473
+ '401': "EndpointError",
2474
+ '409': "EndpointError",
2475
+ }
2476
+ response_data = await self.api_client.call_api(
2477
+ *_param,
2478
+ _request_timeout=_request_timeout
2479
+ )
2480
+ return response_data.response
2481
+
2482
+
2483
+ def _share_extractor_serialize(
2484
+ self,
2485
+ extractor_id,
2486
+ username,
2487
+ _request_auth,
2488
+ _content_type,
2489
+ _headers,
2490
+ _host_index,
2491
+ ) -> RequestSerialized:
2492
+
2493
+ _host = None
2494
+
2495
+ _collection_formats: Dict[str, str] = {
2496
+ }
2497
+
2498
+ _path_params: Dict[str, str] = {}
2499
+ _query_params: List[Tuple[str, str]] = []
2500
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2501
+ _form_params: List[Tuple[str, str]] = []
2502
+ _files: Dict[
2503
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2504
+ ] = {}
2505
+ _body_params: Optional[bytes] = None
2506
+
2507
+ # process the path parameters
2508
+ if extractor_id is not None:
2509
+ _path_params['extractor_id'] = extractor_id
2510
+ if username is not None:
2511
+ _path_params['username'] = username
2512
+ # process the query parameters
2513
+ # process the header parameters
2514
+ # process the form parameters
2515
+ # process the body parameter
2516
+
2517
+
2518
+ # set the HTTP header `Accept`
2519
+ if 'Accept' not in _header_params:
2520
+ _header_params['Accept'] = self.api_client.select_header_accept(
2521
+ [
2522
+ 'application/json'
2523
+ ]
2524
+ )
2525
+
2526
+
2527
+ # authentication setting
2528
+ _auth_settings: List[str] = [
2529
+ 'bearerAuth'
2530
+ ]
2531
+
2532
+ return self.api_client.param_serialize(
2533
+ method='PUT',
2534
+ resource_path='/extractors/{extractor_id}/permissions/{username}',
2535
+ path_params=_path_params,
2536
+ query_params=_query_params,
2537
+ header_params=_header_params,
2538
+ body=_body_params,
2539
+ post_params=_form_params,
2540
+ files=_files,
2541
+ auth_settings=_auth_settings,
2542
+ collection_formats=_collection_formats,
2543
+ _host=_host,
2544
+ _request_auth=_request_auth
2545
+ )
2546
+
2547
+
2548
+
2549
+
2550
+ @validate_call
2551
+ async def share_extractor_with_group(
2552
+ self,
2553
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
2554
+ group_id: Annotated[StrictStr, Field(description="Id of a group that will obtain access to the extractor.")],
2555
+ _request_timeout: Union[
2556
+ None,
2557
+ Annotated[StrictFloat, Field(gt=0)],
2558
+ Tuple[
2559
+ Annotated[StrictFloat, Field(gt=0)],
2560
+ Annotated[StrictFloat, Field(gt=0)]
2561
+ ]
2562
+ ] = None,
2563
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2564
+ _content_type: Optional[StrictStr] = None,
2565
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2566
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2567
+ ) -> None:
2568
+ """Shares an extractor to a group.
2569
+
2570
+ Shares an extractor to a group. The extractor_id attribute denotes the extractor to be shared.
2571
+
2572
+ :param extractor_id: Id of the extractor. (required)
2573
+ :type extractor_id: str
2574
+ :param group_id: Id of a group that will obtain access to the extractor. (required)
2575
+ :type group_id: str
2576
+ :param _request_timeout: timeout setting for this request. If one
2577
+ number provided, it will be total request
2578
+ timeout. It can also be a pair (tuple) of
2579
+ (connection, read) timeouts.
2580
+ :type _request_timeout: int, tuple(int, int), optional
2581
+ :param _request_auth: set to override the auth_settings for an a single
2582
+ request; this effectively ignores the
2583
+ authentication in the spec for a single request.
2584
+ :type _request_auth: dict, optional
2585
+ :param _content_type: force content-type for the request.
2586
+ :type _content_type: str, Optional
2587
+ :param _headers: set to override the headers for a single
2588
+ request; this effectively ignores the headers
2589
+ in the spec for a single request.
2590
+ :type _headers: dict, optional
2591
+ :param _host_index: set to override the host_index for a single
2592
+ request; this effectively ignores the host_index
2593
+ in the spec for a single request.
2594
+ :type _host_index: int, optional
2595
+ :return: Returns the result object.
2596
+ """ # noqa: E501
2597
+
2598
+ _param = self._share_extractor_with_group_serialize(
2599
+ extractor_id=extractor_id,
2600
+ group_id=group_id,
2601
+ _request_auth=_request_auth,
2602
+ _content_type=_content_type,
2603
+ _headers=_headers,
2604
+ _host_index=_host_index
2605
+ )
2606
+
2607
+ _response_types_map: Dict[str, Optional[str]] = {
2608
+ '204': None,
2609
+ '401': "EndpointError",
2610
+ '409': "EndpointError",
2611
+ }
2612
+ response_data = await self.api_client.call_api(
2613
+ *_param,
2614
+ _request_timeout=_request_timeout
2615
+ )
2616
+ await response_data.read()
2617
+ return self.api_client.response_deserialize(
2618
+ response_data=response_data,
2619
+ response_types_map=_response_types_map,
2620
+ ).data
2621
+
2622
+
2623
+ @validate_call
2624
+ async def share_extractor_with_group_with_http_info(
2625
+ self,
2626
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
2627
+ group_id: Annotated[StrictStr, Field(description="Id of a group that will obtain access to the extractor.")],
2628
+ _request_timeout: Union[
2629
+ None,
2630
+ Annotated[StrictFloat, Field(gt=0)],
2631
+ Tuple[
2632
+ Annotated[StrictFloat, Field(gt=0)],
2633
+ Annotated[StrictFloat, Field(gt=0)]
2634
+ ]
2635
+ ] = None,
2636
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2637
+ _content_type: Optional[StrictStr] = None,
2638
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2639
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2640
+ ) -> ApiResponse[None]:
2641
+ """Shares an extractor to a group.
2642
+
2643
+ Shares an extractor to a group. The extractor_id attribute denotes the extractor to be shared.
2644
+
2645
+ :param extractor_id: Id of the extractor. (required)
2646
+ :type extractor_id: str
2647
+ :param group_id: Id of a group that will obtain access to the extractor. (required)
2648
+ :type group_id: str
2649
+ :param _request_timeout: timeout setting for this request. If one
2650
+ number provided, it will be total request
2651
+ timeout. It can also be a pair (tuple) of
2652
+ (connection, read) timeouts.
2653
+ :type _request_timeout: int, tuple(int, int), optional
2654
+ :param _request_auth: set to override the auth_settings for an a single
2655
+ request; this effectively ignores the
2656
+ authentication in the spec for a single request.
2657
+ :type _request_auth: dict, optional
2658
+ :param _content_type: force content-type for the request.
2659
+ :type _content_type: str, Optional
2660
+ :param _headers: set to override the headers for a single
2661
+ request; this effectively ignores the headers
2662
+ in the spec for a single request.
2663
+ :type _headers: dict, optional
2664
+ :param _host_index: set to override the host_index for a single
2665
+ request; this effectively ignores the host_index
2666
+ in the spec for a single request.
2667
+ :type _host_index: int, optional
2668
+ :return: Returns the result object.
2669
+ """ # noqa: E501
2670
+
2671
+ _param = self._share_extractor_with_group_serialize(
2672
+ extractor_id=extractor_id,
2673
+ group_id=group_id,
2674
+ _request_auth=_request_auth,
2675
+ _content_type=_content_type,
2676
+ _headers=_headers,
2677
+ _host_index=_host_index
2678
+ )
2679
+
2680
+ _response_types_map: Dict[str, Optional[str]] = {
2681
+ '204': None,
2682
+ '401': "EndpointError",
2683
+ '409': "EndpointError",
2684
+ }
2685
+ response_data = await self.api_client.call_api(
2686
+ *_param,
2687
+ _request_timeout=_request_timeout
2688
+ )
2689
+ await response_data.read()
2690
+ return self.api_client.response_deserialize(
2691
+ response_data=response_data,
2692
+ response_types_map=_response_types_map,
2693
+ )
2694
+
2695
+
2696
+ @validate_call
2697
+ async def share_extractor_with_group_without_preload_content(
2698
+ self,
2699
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
2700
+ group_id: Annotated[StrictStr, Field(description="Id of a group that will obtain access to the extractor.")],
2701
+ _request_timeout: Union[
2702
+ None,
2703
+ Annotated[StrictFloat, Field(gt=0)],
2704
+ Tuple[
2705
+ Annotated[StrictFloat, Field(gt=0)],
2706
+ Annotated[StrictFloat, Field(gt=0)]
2707
+ ]
2708
+ ] = None,
2709
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2710
+ _content_type: Optional[StrictStr] = None,
2711
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2712
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2713
+ ) -> RESTResponseType:
2714
+ """Shares an extractor to a group.
2715
+
2716
+ Shares an extractor to a group. The extractor_id attribute denotes the extractor to be shared.
2717
+
2718
+ :param extractor_id: Id of the extractor. (required)
2719
+ :type extractor_id: str
2720
+ :param group_id: Id of a group that will obtain access to the extractor. (required)
2721
+ :type group_id: str
2722
+ :param _request_timeout: timeout setting for this request. If one
2723
+ number provided, it will be total request
2724
+ timeout. It can also be a pair (tuple) of
2725
+ (connection, read) timeouts.
2726
+ :type _request_timeout: int, tuple(int, int), optional
2727
+ :param _request_auth: set to override the auth_settings for an a single
2728
+ request; this effectively ignores the
2729
+ authentication in the spec for a single request.
2730
+ :type _request_auth: dict, optional
2731
+ :param _content_type: force content-type for the request.
2732
+ :type _content_type: str, Optional
2733
+ :param _headers: set to override the headers for a single
2734
+ request; this effectively ignores the headers
2735
+ in the spec for a single request.
2736
+ :type _headers: dict, optional
2737
+ :param _host_index: set to override the host_index for a single
2738
+ request; this effectively ignores the host_index
2739
+ in the spec for a single request.
2740
+ :type _host_index: int, optional
2741
+ :return: Returns the result object.
2742
+ """ # noqa: E501
2743
+
2744
+ _param = self._share_extractor_with_group_serialize(
2745
+ extractor_id=extractor_id,
2746
+ group_id=group_id,
2747
+ _request_auth=_request_auth,
2748
+ _content_type=_content_type,
2749
+ _headers=_headers,
2750
+ _host_index=_host_index
2751
+ )
2752
+
2753
+ _response_types_map: Dict[str, Optional[str]] = {
2754
+ '204': None,
2755
+ '401': "EndpointError",
2756
+ '409': "EndpointError",
2757
+ }
2758
+ response_data = await self.api_client.call_api(
2759
+ *_param,
2760
+ _request_timeout=_request_timeout
2761
+ )
2762
+ return response_data.response
2763
+
2764
+
2765
+ def _share_extractor_with_group_serialize(
2766
+ self,
2767
+ extractor_id,
2768
+ group_id,
2769
+ _request_auth,
2770
+ _content_type,
2771
+ _headers,
2772
+ _host_index,
2773
+ ) -> RequestSerialized:
2774
+
2775
+ _host = None
2776
+
2777
+ _collection_formats: Dict[str, str] = {
2778
+ }
2779
+
2780
+ _path_params: Dict[str, str] = {}
2781
+ _query_params: List[Tuple[str, str]] = []
2782
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2783
+ _form_params: List[Tuple[str, str]] = []
2784
+ _files: Dict[
2785
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2786
+ ] = {}
2787
+ _body_params: Optional[bytes] = None
2788
+
2789
+ # process the path parameters
2790
+ if extractor_id is not None:
2791
+ _path_params['extractor_id'] = extractor_id
2792
+ if group_id is not None:
2793
+ _path_params['group_id'] = group_id
2794
+ # process the query parameters
2795
+ # process the header parameters
2796
+ # process the form parameters
2797
+ # process the body parameter
2798
+
2799
+
2800
+ # set the HTTP header `Accept`
2801
+ if 'Accept' not in _header_params:
2802
+ _header_params['Accept'] = self.api_client.select_header_accept(
2803
+ [
2804
+ 'application/json'
2805
+ ]
2806
+ )
2807
+
2808
+
2809
+ # authentication setting
2810
+ _auth_settings: List[str] = [
2811
+ 'bearerAuth'
2812
+ ]
2813
+
2814
+ return self.api_client.param_serialize(
2815
+ method='PUT',
2816
+ resource_path='/extractors/{extractor_id}/group_permissions/{group_id}',
2817
+ path_params=_path_params,
2818
+ query_params=_query_params,
2819
+ header_params=_header_params,
2820
+ body=_body_params,
2821
+ post_params=_form_params,
2822
+ files=_files,
2823
+ auth_settings=_auth_settings,
2824
+ collection_formats=_collection_formats,
2825
+ _host=_host,
2826
+ _request_auth=_request_auth
2827
+ )
2828
+
2829
+
2830
+
2831
+
2832
+ @validate_call
2833
+ async def unshare_extractor(
2834
+ self,
2835
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
2836
+ username: Annotated[StrictStr, Field(description="User name that will lose access to the extractor")],
2837
+ _request_timeout: Union[
2838
+ None,
2839
+ Annotated[StrictFloat, Field(gt=0)],
2840
+ Tuple[
2841
+ Annotated[StrictFloat, Field(gt=0)],
2842
+ Annotated[StrictFloat, Field(gt=0)]
2843
+ ]
2844
+ ] = None,
2845
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2846
+ _content_type: Optional[StrictStr] = None,
2847
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2848
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2849
+ ) -> None:
2850
+ """Removes sharing of an extractor to a user.
2851
+
2852
+ Removes sharing of an extractor to a user.
2853
+
2854
+ :param extractor_id: Id of the extractor. (required)
2855
+ :type extractor_id: str
2856
+ :param username: User name that will lose access to the extractor (required)
2857
+ :type username: str
2858
+ :param _request_timeout: timeout setting for this request. If one
2859
+ number provided, it will be total request
2860
+ timeout. It can also be a pair (tuple) of
2861
+ (connection, read) timeouts.
2862
+ :type _request_timeout: int, tuple(int, int), optional
2863
+ :param _request_auth: set to override the auth_settings for an a single
2864
+ request; this effectively ignores the
2865
+ authentication in the spec for a single request.
2866
+ :type _request_auth: dict, optional
2867
+ :param _content_type: force content-type for the request.
2868
+ :type _content_type: str, Optional
2869
+ :param _headers: set to override the headers for a single
2870
+ request; this effectively ignores the headers
2871
+ in the spec for a single request.
2872
+ :type _headers: dict, optional
2873
+ :param _host_index: set to override the host_index for a single
2874
+ request; this effectively ignores the host_index
2875
+ in the spec for a single request.
2876
+ :type _host_index: int, optional
2877
+ :return: Returns the result object.
2878
+ """ # noqa: E501
2879
+
2880
+ _param = self._unshare_extractor_serialize(
2881
+ extractor_id=extractor_id,
2882
+ username=username,
2883
+ _request_auth=_request_auth,
2884
+ _content_type=_content_type,
2885
+ _headers=_headers,
2886
+ _host_index=_host_index
2887
+ )
2888
+
2889
+ _response_types_map: Dict[str, Optional[str]] = {
2890
+ '204': None,
2891
+ '401': "EndpointError",
2892
+ '409': "EndpointError",
2893
+ }
2894
+ response_data = await self.api_client.call_api(
2895
+ *_param,
2896
+ _request_timeout=_request_timeout
2897
+ )
2898
+ await response_data.read()
2899
+ return self.api_client.response_deserialize(
2900
+ response_data=response_data,
2901
+ response_types_map=_response_types_map,
2902
+ ).data
2903
+
2904
+
2905
+ @validate_call
2906
+ async def unshare_extractor_with_http_info(
2907
+ self,
2908
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
2909
+ username: Annotated[StrictStr, Field(description="User name that will lose access to the extractor")],
2910
+ _request_timeout: Union[
2911
+ None,
2912
+ Annotated[StrictFloat, Field(gt=0)],
2913
+ Tuple[
2914
+ Annotated[StrictFloat, Field(gt=0)],
2915
+ Annotated[StrictFloat, Field(gt=0)]
2916
+ ]
2917
+ ] = None,
2918
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2919
+ _content_type: Optional[StrictStr] = None,
2920
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2921
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2922
+ ) -> ApiResponse[None]:
2923
+ """Removes sharing of an extractor to a user.
2924
+
2925
+ Removes sharing of an extractor to a user.
2926
+
2927
+ :param extractor_id: Id of the extractor. (required)
2928
+ :type extractor_id: str
2929
+ :param username: User name that will lose access to the extractor (required)
2930
+ :type username: str
2931
+ :param _request_timeout: timeout setting for this request. If one
2932
+ number provided, it will be total request
2933
+ timeout. It can also be a pair (tuple) of
2934
+ (connection, read) timeouts.
2935
+ :type _request_timeout: int, tuple(int, int), optional
2936
+ :param _request_auth: set to override the auth_settings for an a single
2937
+ request; this effectively ignores the
2938
+ authentication in the spec for a single request.
2939
+ :type _request_auth: dict, optional
2940
+ :param _content_type: force content-type for the request.
2941
+ :type _content_type: str, Optional
2942
+ :param _headers: set to override the headers for a single
2943
+ request; this effectively ignores the headers
2944
+ in the spec for a single request.
2945
+ :type _headers: dict, optional
2946
+ :param _host_index: set to override the host_index for a single
2947
+ request; this effectively ignores the host_index
2948
+ in the spec for a single request.
2949
+ :type _host_index: int, optional
2950
+ :return: Returns the result object.
2951
+ """ # noqa: E501
2952
+
2953
+ _param = self._unshare_extractor_serialize(
2954
+ extractor_id=extractor_id,
2955
+ username=username,
2956
+ _request_auth=_request_auth,
2957
+ _content_type=_content_type,
2958
+ _headers=_headers,
2959
+ _host_index=_host_index
2960
+ )
2961
+
2962
+ _response_types_map: Dict[str, Optional[str]] = {
2963
+ '204': None,
2964
+ '401': "EndpointError",
2965
+ '409': "EndpointError",
2966
+ }
2967
+ response_data = await self.api_client.call_api(
2968
+ *_param,
2969
+ _request_timeout=_request_timeout
2970
+ )
2971
+ await response_data.read()
2972
+ return self.api_client.response_deserialize(
2973
+ response_data=response_data,
2974
+ response_types_map=_response_types_map,
2975
+ )
2976
+
2977
+
2978
+ @validate_call
2979
+ async def unshare_extractor_without_preload_content(
2980
+ self,
2981
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
2982
+ username: Annotated[StrictStr, Field(description="User name that will lose access to the extractor")],
2983
+ _request_timeout: Union[
2984
+ None,
2985
+ Annotated[StrictFloat, Field(gt=0)],
2986
+ Tuple[
2987
+ Annotated[StrictFloat, Field(gt=0)],
2988
+ Annotated[StrictFloat, Field(gt=0)]
2989
+ ]
2990
+ ] = None,
2991
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2992
+ _content_type: Optional[StrictStr] = None,
2993
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2994
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2995
+ ) -> RESTResponseType:
2996
+ """Removes sharing of an extractor to a user.
2997
+
2998
+ Removes sharing of an extractor to a user.
2999
+
3000
+ :param extractor_id: Id of the extractor. (required)
3001
+ :type extractor_id: str
3002
+ :param username: User name that will lose access to the extractor (required)
3003
+ :type username: str
3004
+ :param _request_timeout: timeout setting for this request. If one
3005
+ number provided, it will be total request
3006
+ timeout. It can also be a pair (tuple) of
3007
+ (connection, read) timeouts.
3008
+ :type _request_timeout: int, tuple(int, int), optional
3009
+ :param _request_auth: set to override the auth_settings for an a single
3010
+ request; this effectively ignores the
3011
+ authentication in the spec for a single request.
3012
+ :type _request_auth: dict, optional
3013
+ :param _content_type: force content-type for the request.
3014
+ :type _content_type: str, Optional
3015
+ :param _headers: set to override the headers for a single
3016
+ request; this effectively ignores the headers
3017
+ in the spec for a single request.
3018
+ :type _headers: dict, optional
3019
+ :param _host_index: set to override the host_index for a single
3020
+ request; this effectively ignores the host_index
3021
+ in the spec for a single request.
3022
+ :type _host_index: int, optional
3023
+ :return: Returns the result object.
3024
+ """ # noqa: E501
3025
+
3026
+ _param = self._unshare_extractor_serialize(
3027
+ extractor_id=extractor_id,
3028
+ username=username,
3029
+ _request_auth=_request_auth,
3030
+ _content_type=_content_type,
3031
+ _headers=_headers,
3032
+ _host_index=_host_index
3033
+ )
3034
+
3035
+ _response_types_map: Dict[str, Optional[str]] = {
3036
+ '204': None,
3037
+ '401': "EndpointError",
3038
+ '409': "EndpointError",
3039
+ }
3040
+ response_data = await self.api_client.call_api(
3041
+ *_param,
3042
+ _request_timeout=_request_timeout
3043
+ )
3044
+ return response_data.response
3045
+
3046
+
3047
+ def _unshare_extractor_serialize(
3048
+ self,
3049
+ extractor_id,
3050
+ username,
3051
+ _request_auth,
3052
+ _content_type,
3053
+ _headers,
3054
+ _host_index,
3055
+ ) -> RequestSerialized:
3056
+
3057
+ _host = None
3058
+
3059
+ _collection_formats: Dict[str, str] = {
3060
+ }
3061
+
3062
+ _path_params: Dict[str, str] = {}
3063
+ _query_params: List[Tuple[str, str]] = []
3064
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3065
+ _form_params: List[Tuple[str, str]] = []
3066
+ _files: Dict[
3067
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3068
+ ] = {}
3069
+ _body_params: Optional[bytes] = None
3070
+
3071
+ # process the path parameters
3072
+ if extractor_id is not None:
3073
+ _path_params['extractor_id'] = extractor_id
3074
+ if username is not None:
3075
+ _path_params['username'] = username
3076
+ # process the query parameters
3077
+ # process the header parameters
3078
+ # process the form parameters
3079
+ # process the body parameter
3080
+
3081
+
3082
+ # set the HTTP header `Accept`
3083
+ if 'Accept' not in _header_params:
3084
+ _header_params['Accept'] = self.api_client.select_header_accept(
3085
+ [
3086
+ 'application/json'
3087
+ ]
3088
+ )
3089
+
3090
+
3091
+ # authentication setting
3092
+ _auth_settings: List[str] = [
3093
+ 'bearerAuth'
3094
+ ]
3095
+
3096
+ return self.api_client.param_serialize(
3097
+ method='DELETE',
3098
+ resource_path='/extractors/{extractor_id}/permissions/{username}',
3099
+ path_params=_path_params,
3100
+ query_params=_query_params,
3101
+ header_params=_header_params,
3102
+ body=_body_params,
3103
+ post_params=_form_params,
3104
+ files=_files,
3105
+ auth_settings=_auth_settings,
3106
+ collection_formats=_collection_formats,
3107
+ _host=_host,
3108
+ _request_auth=_request_auth
3109
+ )
3110
+
3111
+
3112
+
3113
+
3114
+ @validate_call
3115
+ async def unshare_extractor_for_all(
3116
+ self,
3117
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
3118
+ _request_timeout: Union[
3119
+ None,
3120
+ Annotated[StrictFloat, Field(gt=0)],
3121
+ Tuple[
3122
+ Annotated[StrictFloat, Field(gt=0)],
3123
+ Annotated[StrictFloat, Field(gt=0)]
3124
+ ]
3125
+ ] = None,
3126
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3127
+ _content_type: Optional[StrictStr] = None,
3128
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3129
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3130
+ ) -> None:
3131
+ """Removes sharing of an extractor to all other users except the original owner.
3132
+
3133
+ Removes sharing of an extractor to all other users except the original owner.
3134
+
3135
+ :param extractor_id: Id of the extractor. (required)
3136
+ :type extractor_id: str
3137
+ :param _request_timeout: timeout setting for this request. If one
3138
+ number provided, it will be total request
3139
+ timeout. It can also be a pair (tuple) of
3140
+ (connection, read) timeouts.
3141
+ :type _request_timeout: int, tuple(int, int), optional
3142
+ :param _request_auth: set to override the auth_settings for an a single
3143
+ request; this effectively ignores the
3144
+ authentication in the spec for a single request.
3145
+ :type _request_auth: dict, optional
3146
+ :param _content_type: force content-type for the request.
3147
+ :type _content_type: str, Optional
3148
+ :param _headers: set to override the headers for a single
3149
+ request; this effectively ignores the headers
3150
+ in the spec for a single request.
3151
+ :type _headers: dict, optional
3152
+ :param _host_index: set to override the host_index for a single
3153
+ request; this effectively ignores the host_index
3154
+ in the spec for a single request.
3155
+ :type _host_index: int, optional
3156
+ :return: Returns the result object.
3157
+ """ # noqa: E501
3158
+
3159
+ _param = self._unshare_extractor_for_all_serialize(
3160
+ extractor_id=extractor_id,
3161
+ _request_auth=_request_auth,
3162
+ _content_type=_content_type,
3163
+ _headers=_headers,
3164
+ _host_index=_host_index
3165
+ )
3166
+
3167
+ _response_types_map: Dict[str, Optional[str]] = {
3168
+ '204': None,
3169
+ '401': "EndpointError",
3170
+ '409': "EndpointError",
3171
+ }
3172
+ response_data = await self.api_client.call_api(
3173
+ *_param,
3174
+ _request_timeout=_request_timeout
3175
+ )
3176
+ await response_data.read()
3177
+ return self.api_client.response_deserialize(
3178
+ response_data=response_data,
3179
+ response_types_map=_response_types_map,
3180
+ ).data
3181
+
3182
+
3183
+ @validate_call
3184
+ async def unshare_extractor_for_all_with_http_info(
3185
+ self,
3186
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
3187
+ _request_timeout: Union[
3188
+ None,
3189
+ Annotated[StrictFloat, Field(gt=0)],
3190
+ Tuple[
3191
+ Annotated[StrictFloat, Field(gt=0)],
3192
+ Annotated[StrictFloat, Field(gt=0)]
3193
+ ]
3194
+ ] = None,
3195
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3196
+ _content_type: Optional[StrictStr] = None,
3197
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3198
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3199
+ ) -> ApiResponse[None]:
3200
+ """Removes sharing of an extractor to all other users except the original owner.
3201
+
3202
+ Removes sharing of an extractor to all other users except the original owner.
3203
+
3204
+ :param extractor_id: Id of the extractor. (required)
3205
+ :type extractor_id: str
3206
+ :param _request_timeout: timeout setting for this request. If one
3207
+ number provided, it will be total request
3208
+ timeout. It can also be a pair (tuple) of
3209
+ (connection, read) timeouts.
3210
+ :type _request_timeout: int, tuple(int, int), optional
3211
+ :param _request_auth: set to override the auth_settings for an a single
3212
+ request; this effectively ignores the
3213
+ authentication in the spec for a single request.
3214
+ :type _request_auth: dict, optional
3215
+ :param _content_type: force content-type for the request.
3216
+ :type _content_type: str, Optional
3217
+ :param _headers: set to override the headers for a single
3218
+ request; this effectively ignores the headers
3219
+ in the spec for a single request.
3220
+ :type _headers: dict, optional
3221
+ :param _host_index: set to override the host_index for a single
3222
+ request; this effectively ignores the host_index
3223
+ in the spec for a single request.
3224
+ :type _host_index: int, optional
3225
+ :return: Returns the result object.
3226
+ """ # noqa: E501
3227
+
3228
+ _param = self._unshare_extractor_for_all_serialize(
3229
+ extractor_id=extractor_id,
3230
+ _request_auth=_request_auth,
3231
+ _content_type=_content_type,
3232
+ _headers=_headers,
3233
+ _host_index=_host_index
3234
+ )
3235
+
3236
+ _response_types_map: Dict[str, Optional[str]] = {
3237
+ '204': None,
3238
+ '401': "EndpointError",
3239
+ '409': "EndpointError",
3240
+ }
3241
+ response_data = await self.api_client.call_api(
3242
+ *_param,
3243
+ _request_timeout=_request_timeout
3244
+ )
3245
+ await response_data.read()
3246
+ return self.api_client.response_deserialize(
3247
+ response_data=response_data,
3248
+ response_types_map=_response_types_map,
3249
+ )
3250
+
3251
+
3252
+ @validate_call
3253
+ async def unshare_extractor_for_all_without_preload_content(
3254
+ self,
3255
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
3256
+ _request_timeout: Union[
3257
+ None,
3258
+ Annotated[StrictFloat, Field(gt=0)],
3259
+ Tuple[
3260
+ Annotated[StrictFloat, Field(gt=0)],
3261
+ Annotated[StrictFloat, Field(gt=0)]
3262
+ ]
3263
+ ] = None,
3264
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3265
+ _content_type: Optional[StrictStr] = None,
3266
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3267
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3268
+ ) -> RESTResponseType:
3269
+ """Removes sharing of an extractor to all other users except the original owner.
3270
+
3271
+ Removes sharing of an extractor to all other users except the original owner.
3272
+
3273
+ :param extractor_id: Id of the extractor. (required)
3274
+ :type extractor_id: str
3275
+ :param _request_timeout: timeout setting for this request. If one
3276
+ number provided, it will be total request
3277
+ timeout. It can also be a pair (tuple) of
3278
+ (connection, read) timeouts.
3279
+ :type _request_timeout: int, tuple(int, int), optional
3280
+ :param _request_auth: set to override the auth_settings for an a single
3281
+ request; this effectively ignores the
3282
+ authentication in the spec for a single request.
3283
+ :type _request_auth: dict, optional
3284
+ :param _content_type: force content-type for the request.
3285
+ :type _content_type: str, Optional
3286
+ :param _headers: set to override the headers for a single
3287
+ request; this effectively ignores the headers
3288
+ in the spec for a single request.
3289
+ :type _headers: dict, optional
3290
+ :param _host_index: set to override the host_index for a single
3291
+ request; this effectively ignores the host_index
3292
+ in the spec for a single request.
3293
+ :type _host_index: int, optional
3294
+ :return: Returns the result object.
3295
+ """ # noqa: E501
3296
+
3297
+ _param = self._unshare_extractor_for_all_serialize(
3298
+ extractor_id=extractor_id,
3299
+ _request_auth=_request_auth,
3300
+ _content_type=_content_type,
3301
+ _headers=_headers,
3302
+ _host_index=_host_index
3303
+ )
3304
+
3305
+ _response_types_map: Dict[str, Optional[str]] = {
3306
+ '204': None,
3307
+ '401': "EndpointError",
3308
+ '409': "EndpointError",
3309
+ }
3310
+ response_data = await self.api_client.call_api(
3311
+ *_param,
3312
+ _request_timeout=_request_timeout
3313
+ )
3314
+ return response_data.response
3315
+
3316
+
3317
+ def _unshare_extractor_for_all_serialize(
3318
+ self,
3319
+ extractor_id,
3320
+ _request_auth,
3321
+ _content_type,
3322
+ _headers,
3323
+ _host_index,
3324
+ ) -> RequestSerialized:
3325
+
3326
+ _host = None
3327
+
3328
+ _collection_formats: Dict[str, str] = {
3329
+ }
3330
+
3331
+ _path_params: Dict[str, str] = {}
3332
+ _query_params: List[Tuple[str, str]] = []
3333
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3334
+ _form_params: List[Tuple[str, str]] = []
3335
+ _files: Dict[
3336
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3337
+ ] = {}
3338
+ _body_params: Optional[bytes] = None
3339
+
3340
+ # process the path parameters
3341
+ if extractor_id is not None:
3342
+ _path_params['extractor_id'] = extractor_id
3343
+ # process the query parameters
3344
+ # process the header parameters
3345
+ # process the form parameters
3346
+ # process the body parameter
3347
+
3348
+
3349
+ # set the HTTP header `Accept`
3350
+ if 'Accept' not in _header_params:
3351
+ _header_params['Accept'] = self.api_client.select_header_accept(
3352
+ [
3353
+ 'application/json'
3354
+ ]
3355
+ )
3356
+
3357
+
3358
+ # authentication setting
3359
+ _auth_settings: List[str] = [
3360
+ 'bearerAuth'
3361
+ ]
3362
+
3363
+ return self.api_client.param_serialize(
3364
+ method='DELETE',
3365
+ resource_path='/extractors/{extractor_id}/permissions',
3366
+ path_params=_path_params,
3367
+ query_params=_query_params,
3368
+ header_params=_header_params,
3369
+ body=_body_params,
3370
+ post_params=_form_params,
3371
+ files=_files,
3372
+ auth_settings=_auth_settings,
3373
+ collection_formats=_collection_formats,
3374
+ _host=_host,
3375
+ _request_auth=_request_auth
3376
+ )
3377
+
3378
+
3379
+
3380
+
3381
+ @validate_call
3382
+ async def unshare_extractor_from_group(
3383
+ self,
3384
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
3385
+ group_id: Annotated[StrictStr, Field(description="Id of a group that will lose access to the extractor.")],
3386
+ _request_timeout: Union[
3387
+ None,
3388
+ Annotated[StrictFloat, Field(gt=0)],
3389
+ Tuple[
3390
+ Annotated[StrictFloat, Field(gt=0)],
3391
+ Annotated[StrictFloat, Field(gt=0)]
3392
+ ]
3393
+ ] = None,
3394
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3395
+ _content_type: Optional[StrictStr] = None,
3396
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3397
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3398
+ ) -> None:
3399
+ """Removes sharing of an extractor from a group.
3400
+
3401
+ Removes sharing of an extractor from a group.
3402
+
3403
+ :param extractor_id: Id of the extractor. (required)
3404
+ :type extractor_id: str
3405
+ :param group_id: Id of a group that will lose access to the extractor. (required)
3406
+ :type group_id: str
3407
+ :param _request_timeout: timeout setting for this request. If one
3408
+ number provided, it will be total request
3409
+ timeout. It can also be a pair (tuple) of
3410
+ (connection, read) timeouts.
3411
+ :type _request_timeout: int, tuple(int, int), optional
3412
+ :param _request_auth: set to override the auth_settings for an a single
3413
+ request; this effectively ignores the
3414
+ authentication in the spec for a single request.
3415
+ :type _request_auth: dict, optional
3416
+ :param _content_type: force content-type for the request.
3417
+ :type _content_type: str, Optional
3418
+ :param _headers: set to override the headers for a single
3419
+ request; this effectively ignores the headers
3420
+ in the spec for a single request.
3421
+ :type _headers: dict, optional
3422
+ :param _host_index: set to override the host_index for a single
3423
+ request; this effectively ignores the host_index
3424
+ in the spec for a single request.
3425
+ :type _host_index: int, optional
3426
+ :return: Returns the result object.
3427
+ """ # noqa: E501
3428
+
3429
+ _param = self._unshare_extractor_from_group_serialize(
3430
+ extractor_id=extractor_id,
3431
+ group_id=group_id,
3432
+ _request_auth=_request_auth,
3433
+ _content_type=_content_type,
3434
+ _headers=_headers,
3435
+ _host_index=_host_index
3436
+ )
3437
+
3438
+ _response_types_map: Dict[str, Optional[str]] = {
3439
+ '204': None,
3440
+ '401': "EndpointError",
3441
+ '409': "EndpointError",
3442
+ }
3443
+ response_data = await self.api_client.call_api(
3444
+ *_param,
3445
+ _request_timeout=_request_timeout
3446
+ )
3447
+ await response_data.read()
3448
+ return self.api_client.response_deserialize(
3449
+ response_data=response_data,
3450
+ response_types_map=_response_types_map,
3451
+ ).data
3452
+
3453
+
3454
+ @validate_call
3455
+ async def unshare_extractor_from_group_with_http_info(
3456
+ self,
3457
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
3458
+ group_id: Annotated[StrictStr, Field(description="Id of a group that will lose access to the extractor.")],
3459
+ _request_timeout: Union[
3460
+ None,
3461
+ Annotated[StrictFloat, Field(gt=0)],
3462
+ Tuple[
3463
+ Annotated[StrictFloat, Field(gt=0)],
3464
+ Annotated[StrictFloat, Field(gt=0)]
3465
+ ]
3466
+ ] = None,
3467
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3468
+ _content_type: Optional[StrictStr] = None,
3469
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3470
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3471
+ ) -> ApiResponse[None]:
3472
+ """Removes sharing of an extractor from a group.
3473
+
3474
+ Removes sharing of an extractor from a group.
3475
+
3476
+ :param extractor_id: Id of the extractor. (required)
3477
+ :type extractor_id: str
3478
+ :param group_id: Id of a group that will lose access to the extractor. (required)
3479
+ :type group_id: str
3480
+ :param _request_timeout: timeout setting for this request. If one
3481
+ number provided, it will be total request
3482
+ timeout. It can also be a pair (tuple) of
3483
+ (connection, read) timeouts.
3484
+ :type _request_timeout: int, tuple(int, int), optional
3485
+ :param _request_auth: set to override the auth_settings for an a single
3486
+ request; this effectively ignores the
3487
+ authentication in the spec for a single request.
3488
+ :type _request_auth: dict, optional
3489
+ :param _content_type: force content-type for the request.
3490
+ :type _content_type: str, Optional
3491
+ :param _headers: set to override the headers for a single
3492
+ request; this effectively ignores the headers
3493
+ in the spec for a single request.
3494
+ :type _headers: dict, optional
3495
+ :param _host_index: set to override the host_index for a single
3496
+ request; this effectively ignores the host_index
3497
+ in the spec for a single request.
3498
+ :type _host_index: int, optional
3499
+ :return: Returns the result object.
3500
+ """ # noqa: E501
3501
+
3502
+ _param = self._unshare_extractor_from_group_serialize(
3503
+ extractor_id=extractor_id,
3504
+ group_id=group_id,
3505
+ _request_auth=_request_auth,
3506
+ _content_type=_content_type,
3507
+ _headers=_headers,
3508
+ _host_index=_host_index
3509
+ )
3510
+
3511
+ _response_types_map: Dict[str, Optional[str]] = {
3512
+ '204': None,
3513
+ '401': "EndpointError",
3514
+ '409': "EndpointError",
3515
+ }
3516
+ response_data = await self.api_client.call_api(
3517
+ *_param,
3518
+ _request_timeout=_request_timeout
3519
+ )
3520
+ await response_data.read()
3521
+ return self.api_client.response_deserialize(
3522
+ response_data=response_data,
3523
+ response_types_map=_response_types_map,
3524
+ )
3525
+
3526
+
3527
+ @validate_call
3528
+ async def unshare_extractor_from_group_without_preload_content(
3529
+ self,
3530
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
3531
+ group_id: Annotated[StrictStr, Field(description="Id of a group that will lose access to the extractor.")],
3532
+ _request_timeout: Union[
3533
+ None,
3534
+ Annotated[StrictFloat, Field(gt=0)],
3535
+ Tuple[
3536
+ Annotated[StrictFloat, Field(gt=0)],
3537
+ Annotated[StrictFloat, Field(gt=0)]
3538
+ ]
3539
+ ] = None,
3540
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3541
+ _content_type: Optional[StrictStr] = None,
3542
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3543
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3544
+ ) -> RESTResponseType:
3545
+ """Removes sharing of an extractor from a group.
3546
+
3547
+ Removes sharing of an extractor from a group.
3548
+
3549
+ :param extractor_id: Id of the extractor. (required)
3550
+ :type extractor_id: str
3551
+ :param group_id: Id of a group that will lose access to the extractor. (required)
3552
+ :type group_id: str
3553
+ :param _request_timeout: timeout setting for this request. If one
3554
+ number provided, it will be total request
3555
+ timeout. It can also be a pair (tuple) of
3556
+ (connection, read) timeouts.
3557
+ :type _request_timeout: int, tuple(int, int), optional
3558
+ :param _request_auth: set to override the auth_settings for an a single
3559
+ request; this effectively ignores the
3560
+ authentication in the spec for a single request.
3561
+ :type _request_auth: dict, optional
3562
+ :param _content_type: force content-type for the request.
3563
+ :type _content_type: str, Optional
3564
+ :param _headers: set to override the headers for a single
3565
+ request; this effectively ignores the headers
3566
+ in the spec for a single request.
3567
+ :type _headers: dict, optional
3568
+ :param _host_index: set to override the host_index for a single
3569
+ request; this effectively ignores the host_index
3570
+ in the spec for a single request.
3571
+ :type _host_index: int, optional
3572
+ :return: Returns the result object.
3573
+ """ # noqa: E501
3574
+
3575
+ _param = self._unshare_extractor_from_group_serialize(
3576
+ extractor_id=extractor_id,
3577
+ group_id=group_id,
3578
+ _request_auth=_request_auth,
3579
+ _content_type=_content_type,
3580
+ _headers=_headers,
3581
+ _host_index=_host_index
3582
+ )
3583
+
3584
+ _response_types_map: Dict[str, Optional[str]] = {
3585
+ '204': None,
3586
+ '401': "EndpointError",
3587
+ '409': "EndpointError",
3588
+ }
3589
+ response_data = await self.api_client.call_api(
3590
+ *_param,
3591
+ _request_timeout=_request_timeout
3592
+ )
3593
+ return response_data.response
3594
+
3595
+
3596
+ def _unshare_extractor_from_group_serialize(
3597
+ self,
3598
+ extractor_id,
3599
+ group_id,
3600
+ _request_auth,
3601
+ _content_type,
3602
+ _headers,
3603
+ _host_index,
3604
+ ) -> RequestSerialized:
3605
+
3606
+ _host = None
3607
+
3608
+ _collection_formats: Dict[str, str] = {
3609
+ }
3610
+
3611
+ _path_params: Dict[str, str] = {}
3612
+ _query_params: List[Tuple[str, str]] = []
3613
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3614
+ _form_params: List[Tuple[str, str]] = []
3615
+ _files: Dict[
3616
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3617
+ ] = {}
3618
+ _body_params: Optional[bytes] = None
3619
+
3620
+ # process the path parameters
3621
+ if extractor_id is not None:
3622
+ _path_params['extractor_id'] = extractor_id
3623
+ if group_id is not None:
3624
+ _path_params['group_id'] = group_id
3625
+ # process the query parameters
3626
+ # process the header parameters
3627
+ # process the form parameters
3628
+ # process the body parameter
3629
+
3630
+
3631
+ # set the HTTP header `Accept`
3632
+ if 'Accept' not in _header_params:
3633
+ _header_params['Accept'] = self.api_client.select_header_accept(
3634
+ [
3635
+ 'application/json'
3636
+ ]
3637
+ )
3638
+
3639
+
3640
+ # authentication setting
3641
+ _auth_settings: List[str] = [
3642
+ 'bearerAuth'
3643
+ ]
3644
+
3645
+ return self.api_client.param_serialize(
3646
+ method='DELETE',
3647
+ resource_path='/extractors/{extractor_id}/group_permissions/{group_id}',
3648
+ path_params=_path_params,
3649
+ query_params=_query_params,
3650
+ header_params=_header_params,
3651
+ body=_body_params,
3652
+ post_params=_form_params,
3653
+ files=_files,
3654
+ auth_settings=_auth_settings,
3655
+ collection_formats=_collection_formats,
3656
+ _host=_host,
3657
+ _request_auth=_request_auth
3658
+ )
3659
+
3660
+
3661
+
3662
+
3663
+ @validate_call
3664
+ async def update_extractor_privacy(
3665
+ self,
3666
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
3667
+ update_extractor_privacy_request: UpdateExtractorPrivacyRequest,
3668
+ _request_timeout: Union[
3669
+ None,
3670
+ Annotated[StrictFloat, Field(gt=0)],
3671
+ Tuple[
3672
+ Annotated[StrictFloat, Field(gt=0)],
3673
+ Annotated[StrictFloat, Field(gt=0)]
3674
+ ]
3675
+ ] = None,
3676
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3677
+ _content_type: Optional[StrictStr] = None,
3678
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3679
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3680
+ ) -> None:
3681
+ """Updates a flag specifying whether an extractor is private or public.
3682
+
3683
+ Updates a flag specifying whether an extractor is private or public.
3684
+
3685
+ :param extractor_id: Id of the extractor. (required)
3686
+ :type extractor_id: str
3687
+ :param update_extractor_privacy_request: (required)
3688
+ :type update_extractor_privacy_request: UpdateExtractorPrivacyRequest
3689
+ :param _request_timeout: timeout setting for this request. If one
3690
+ number provided, it will be total request
3691
+ timeout. It can also be a pair (tuple) of
3692
+ (connection, read) timeouts.
3693
+ :type _request_timeout: int, tuple(int, int), optional
3694
+ :param _request_auth: set to override the auth_settings for an a single
3695
+ request; this effectively ignores the
3696
+ authentication in the spec for a single request.
3697
+ :type _request_auth: dict, optional
3698
+ :param _content_type: force content-type for the request.
3699
+ :type _content_type: str, Optional
3700
+ :param _headers: set to override the headers for a single
3701
+ request; this effectively ignores the headers
3702
+ in the spec for a single request.
3703
+ :type _headers: dict, optional
3704
+ :param _host_index: set to override the host_index for a single
3705
+ request; this effectively ignores the host_index
3706
+ in the spec for a single request.
3707
+ :type _host_index: int, optional
3708
+ :return: Returns the result object.
3709
+ """ # noqa: E501
3710
+
3711
+ _param = self._update_extractor_privacy_serialize(
3712
+ extractor_id=extractor_id,
3713
+ update_extractor_privacy_request=update_extractor_privacy_request,
3714
+ _request_auth=_request_auth,
3715
+ _content_type=_content_type,
3716
+ _headers=_headers,
3717
+ _host_index=_host_index
3718
+ )
3719
+
3720
+ _response_types_map: Dict[str, Optional[str]] = {
3721
+ '204': None,
3722
+ '401': "EndpointError",
3723
+ }
3724
+ response_data = await self.api_client.call_api(
3725
+ *_param,
3726
+ _request_timeout=_request_timeout
3727
+ )
3728
+ await response_data.read()
3729
+ return self.api_client.response_deserialize(
3730
+ response_data=response_data,
3731
+ response_types_map=_response_types_map,
3732
+ ).data
3733
+
3734
+
3735
+ @validate_call
3736
+ async def update_extractor_privacy_with_http_info(
3737
+ self,
3738
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
3739
+ update_extractor_privacy_request: UpdateExtractorPrivacyRequest,
3740
+ _request_timeout: Union[
3741
+ None,
3742
+ Annotated[StrictFloat, Field(gt=0)],
3743
+ Tuple[
3744
+ Annotated[StrictFloat, Field(gt=0)],
3745
+ Annotated[StrictFloat, Field(gt=0)]
3746
+ ]
3747
+ ] = None,
3748
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3749
+ _content_type: Optional[StrictStr] = None,
3750
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3751
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3752
+ ) -> ApiResponse[None]:
3753
+ """Updates a flag specifying whether an extractor is private or public.
3754
+
3755
+ Updates a flag specifying whether an extractor is private or public.
3756
+
3757
+ :param extractor_id: Id of the extractor. (required)
3758
+ :type extractor_id: str
3759
+ :param update_extractor_privacy_request: (required)
3760
+ :type update_extractor_privacy_request: UpdateExtractorPrivacyRequest
3761
+ :param _request_timeout: timeout setting for this request. If one
3762
+ number provided, it will be total request
3763
+ timeout. It can also be a pair (tuple) of
3764
+ (connection, read) timeouts.
3765
+ :type _request_timeout: int, tuple(int, int), optional
3766
+ :param _request_auth: set to override the auth_settings for an a single
3767
+ request; this effectively ignores the
3768
+ authentication in the spec for a single request.
3769
+ :type _request_auth: dict, optional
3770
+ :param _content_type: force content-type for the request.
3771
+ :type _content_type: str, Optional
3772
+ :param _headers: set to override the headers for a single
3773
+ request; this effectively ignores the headers
3774
+ in the spec for a single request.
3775
+ :type _headers: dict, optional
3776
+ :param _host_index: set to override the host_index for a single
3777
+ request; this effectively ignores the host_index
3778
+ in the spec for a single request.
3779
+ :type _host_index: int, optional
3780
+ :return: Returns the result object.
3781
+ """ # noqa: E501
3782
+
3783
+ _param = self._update_extractor_privacy_serialize(
3784
+ extractor_id=extractor_id,
3785
+ update_extractor_privacy_request=update_extractor_privacy_request,
3786
+ _request_auth=_request_auth,
3787
+ _content_type=_content_type,
3788
+ _headers=_headers,
3789
+ _host_index=_host_index
3790
+ )
3791
+
3792
+ _response_types_map: Dict[str, Optional[str]] = {
3793
+ '204': None,
3794
+ '401': "EndpointError",
3795
+ }
3796
+ response_data = await self.api_client.call_api(
3797
+ *_param,
3798
+ _request_timeout=_request_timeout
3799
+ )
3800
+ await response_data.read()
3801
+ return self.api_client.response_deserialize(
3802
+ response_data=response_data,
3803
+ response_types_map=_response_types_map,
3804
+ )
3805
+
3806
+
3807
+ @validate_call
3808
+ async def update_extractor_privacy_without_preload_content(
3809
+ self,
3810
+ extractor_id: Annotated[StrictStr, Field(description="Id of the extractor.")],
3811
+ update_extractor_privacy_request: UpdateExtractorPrivacyRequest,
3812
+ _request_timeout: Union[
3813
+ None,
3814
+ Annotated[StrictFloat, Field(gt=0)],
3815
+ Tuple[
3816
+ Annotated[StrictFloat, Field(gt=0)],
3817
+ Annotated[StrictFloat, Field(gt=0)]
3818
+ ]
3819
+ ] = None,
3820
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3821
+ _content_type: Optional[StrictStr] = None,
3822
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3823
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3824
+ ) -> RESTResponseType:
3825
+ """Updates a flag specifying whether an extractor is private or public.
3826
+
3827
+ Updates a flag specifying whether an extractor is private or public.
3828
+
3829
+ :param extractor_id: Id of the extractor. (required)
3830
+ :type extractor_id: str
3831
+ :param update_extractor_privacy_request: (required)
3832
+ :type update_extractor_privacy_request: UpdateExtractorPrivacyRequest
3833
+ :param _request_timeout: timeout setting for this request. If one
3834
+ number provided, it will be total request
3835
+ timeout. It can also be a pair (tuple) of
3836
+ (connection, read) timeouts.
3837
+ :type _request_timeout: int, tuple(int, int), optional
3838
+ :param _request_auth: set to override the auth_settings for an a single
3839
+ request; this effectively ignores the
3840
+ authentication in the spec for a single request.
3841
+ :type _request_auth: dict, optional
3842
+ :param _content_type: force content-type for the request.
3843
+ :type _content_type: str, Optional
3844
+ :param _headers: set to override the headers for a single
3845
+ request; this effectively ignores the headers
3846
+ in the spec for a single request.
3847
+ :type _headers: dict, optional
3848
+ :param _host_index: set to override the host_index for a single
3849
+ request; this effectively ignores the host_index
3850
+ in the spec for a single request.
3851
+ :type _host_index: int, optional
3852
+ :return: Returns the result object.
3853
+ """ # noqa: E501
3854
+
3855
+ _param = self._update_extractor_privacy_serialize(
3856
+ extractor_id=extractor_id,
3857
+ update_extractor_privacy_request=update_extractor_privacy_request,
3858
+ _request_auth=_request_auth,
3859
+ _content_type=_content_type,
3860
+ _headers=_headers,
3861
+ _host_index=_host_index
3862
+ )
3863
+
3864
+ _response_types_map: Dict[str, Optional[str]] = {
3865
+ '204': None,
3866
+ '401': "EndpointError",
3867
+ }
3868
+ response_data = await self.api_client.call_api(
3869
+ *_param,
3870
+ _request_timeout=_request_timeout
3871
+ )
3872
+ return response_data.response
3873
+
3874
+
3875
+ def _update_extractor_privacy_serialize(
3876
+ self,
3877
+ extractor_id,
3878
+ update_extractor_privacy_request,
3879
+ _request_auth,
3880
+ _content_type,
3881
+ _headers,
3882
+ _host_index,
3883
+ ) -> RequestSerialized:
3884
+
3885
+ _host = None
3886
+
3887
+ _collection_formats: Dict[str, str] = {
3888
+ }
3889
+
3890
+ _path_params: Dict[str, str] = {}
3891
+ _query_params: List[Tuple[str, str]] = []
3892
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3893
+ _form_params: List[Tuple[str, str]] = []
3894
+ _files: Dict[
3895
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3896
+ ] = {}
3897
+ _body_params: Optional[bytes] = None
3898
+
3899
+ # process the path parameters
3900
+ if extractor_id is not None:
3901
+ _path_params['extractor_id'] = extractor_id
3902
+ # process the query parameters
3903
+ # process the header parameters
3904
+ # process the form parameters
3905
+ # process the body parameter
3906
+ if update_extractor_privacy_request is not None:
3907
+ _body_params = update_extractor_privacy_request
3908
+
3909
+
3910
+ # set the HTTP header `Accept`
3911
+ if 'Accept' not in _header_params:
3912
+ _header_params['Accept'] = self.api_client.select_header_accept(
3913
+ [
3914
+ 'application/json'
3915
+ ]
3916
+ )
3917
+
3918
+ # set the HTTP header `Content-Type`
3919
+ if _content_type:
3920
+ _header_params['Content-Type'] = _content_type
3921
+ else:
3922
+ _default_content_type = (
3923
+ self.api_client.select_header_content_type(
3924
+ [
3925
+ 'application/json'
3926
+ ]
3927
+ )
3928
+ )
3929
+ if _default_content_type is not None:
3930
+ _header_params['Content-Type'] = _default_content_type
3931
+
3932
+ # authentication setting
3933
+ _auth_settings: List[str] = [
3934
+ 'bearerAuth'
3935
+ ]
3936
+
3937
+ return self.api_client.param_serialize(
3938
+ method='POST',
3939
+ resource_path='/extractors/{extractor_id}/is_public',
1136
3940
  path_params=_path_params,
1137
3941
  query_params=_query_params,
1138
3942
  header_params=_header_params,