cribl-control-plane 0.0.13__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.

Potentially problematic release.


This version of cribl-control-plane might be problematic. Click here for more details.

Files changed (197) hide show
  1. cribl_control_plane/__init__.py +17 -0
  2. cribl_control_plane/_hooks/__init__.py +5 -0
  3. cribl_control_plane/_hooks/clientcredentials.py +211 -0
  4. cribl_control_plane/_hooks/registration.py +13 -0
  5. cribl_control_plane/_hooks/sdkhooks.py +81 -0
  6. cribl_control_plane/_hooks/types.py +112 -0
  7. cribl_control_plane/_version.py +15 -0
  8. cribl_control_plane/auth_sdk.py +184 -0
  9. cribl_control_plane/basesdk.py +358 -0
  10. cribl_control_plane/errors/__init__.py +60 -0
  11. cribl_control_plane/errors/apierror.py +38 -0
  12. cribl_control_plane/errors/criblcontrolplaneerror.py +26 -0
  13. cribl_control_plane/errors/error.py +24 -0
  14. cribl_control_plane/errors/healthstatus_error.py +38 -0
  15. cribl_control_plane/errors/no_response_error.py +13 -0
  16. cribl_control_plane/errors/responsevalidationerror.py +25 -0
  17. cribl_control_plane/health.py +166 -0
  18. cribl_control_plane/httpclient.py +126 -0
  19. cribl_control_plane/models/__init__.py +7305 -0
  20. cribl_control_plane/models/addhectokenrequest.py +34 -0
  21. cribl_control_plane/models/authtoken.py +13 -0
  22. cribl_control_plane/models/createinputhectokenbyidop.py +45 -0
  23. cribl_control_plane/models/createinputop.py +24 -0
  24. cribl_control_plane/models/createoutputop.py +24 -0
  25. cribl_control_plane/models/createoutputtestbyidop.py +46 -0
  26. cribl_control_plane/models/criblevent.py +14 -0
  27. cribl_control_plane/models/deleteinputbyidop.py +37 -0
  28. cribl_control_plane/models/deleteoutputbyidop.py +37 -0
  29. cribl_control_plane/models/deleteoutputpqbyidop.py +36 -0
  30. cribl_control_plane/models/getinputbyidop.py +37 -0
  31. cribl_control_plane/models/getoutputbyidop.py +37 -0
  32. cribl_control_plane/models/getoutputpqbyidop.py +36 -0
  33. cribl_control_plane/models/getoutputsamplesbyidop.py +37 -0
  34. cribl_control_plane/models/healthstatus.py +36 -0
  35. cribl_control_plane/models/input.py +199 -0
  36. cribl_control_plane/models/inputappscope.py +448 -0
  37. cribl_control_plane/models/inputazureblob.py +308 -0
  38. cribl_control_plane/models/inputcollection.py +208 -0
  39. cribl_control_plane/models/inputconfluentcloud.py +585 -0
  40. cribl_control_plane/models/inputcribl.py +165 -0
  41. cribl_control_plane/models/inputcriblhttp.py +341 -0
  42. cribl_control_plane/models/inputcribllakehttp.py +342 -0
  43. cribl_control_plane/models/inputcriblmetrics.py +175 -0
  44. cribl_control_plane/models/inputcribltcp.py +299 -0
  45. cribl_control_plane/models/inputcrowdstrike.py +410 -0
  46. cribl_control_plane/models/inputdatadogagent.py +364 -0
  47. cribl_control_plane/models/inputdatagen.py +180 -0
  48. cribl_control_plane/models/inputedgeprometheus.py +551 -0
  49. cribl_control_plane/models/inputelastic.py +494 -0
  50. cribl_control_plane/models/inputeventhub.py +360 -0
  51. cribl_control_plane/models/inputexec.py +213 -0
  52. cribl_control_plane/models/inputfile.py +259 -0
  53. cribl_control_plane/models/inputfirehose.py +341 -0
  54. cribl_control_plane/models/inputgooglepubsub.py +247 -0
  55. cribl_control_plane/models/inputgrafana_union.py +1247 -0
  56. cribl_control_plane/models/inputhttp.py +403 -0
  57. cribl_control_plane/models/inputhttpraw.py +407 -0
  58. cribl_control_plane/models/inputjournalfiles.py +208 -0
  59. cribl_control_plane/models/inputkafka.py +581 -0
  60. cribl_control_plane/models/inputkinesis.py +363 -0
  61. cribl_control_plane/models/inputkubeevents.py +182 -0
  62. cribl_control_plane/models/inputkubelogs.py +256 -0
  63. cribl_control_plane/models/inputkubemetrics.py +233 -0
  64. cribl_control_plane/models/inputloki.py +468 -0
  65. cribl_control_plane/models/inputmetrics.py +290 -0
  66. cribl_control_plane/models/inputmodeldriventelemetry.py +274 -0
  67. cribl_control_plane/models/inputmsk.py +654 -0
  68. cribl_control_plane/models/inputnetflow.py +224 -0
  69. cribl_control_plane/models/inputoffice365mgmt.py +384 -0
  70. cribl_control_plane/models/inputoffice365msgtrace.py +449 -0
  71. cribl_control_plane/models/inputoffice365service.py +377 -0
  72. cribl_control_plane/models/inputopentelemetry.py +516 -0
  73. cribl_control_plane/models/inputprometheus.py +464 -0
  74. cribl_control_plane/models/inputprometheusrw.py +470 -0
  75. cribl_control_plane/models/inputrawudp.py +207 -0
  76. cribl_control_plane/models/inputs3.py +416 -0
  77. cribl_control_plane/models/inputs3inventory.py +440 -0
  78. cribl_control_plane/models/inputsecuritylake.py +425 -0
  79. cribl_control_plane/models/inputsnmp.py +274 -0
  80. cribl_control_plane/models/inputsplunk.py +387 -0
  81. cribl_control_plane/models/inputsplunkhec.py +478 -0
  82. cribl_control_plane/models/inputsplunksearch.py +537 -0
  83. cribl_control_plane/models/inputsqs.py +320 -0
  84. cribl_control_plane/models/inputsyslog_union.py +759 -0
  85. cribl_control_plane/models/inputsystemmetrics.py +533 -0
  86. cribl_control_plane/models/inputsystemstate.py +417 -0
  87. cribl_control_plane/models/inputtcp.py +359 -0
  88. cribl_control_plane/models/inputtcpjson.py +334 -0
  89. cribl_control_plane/models/inputwef.py +498 -0
  90. cribl_control_plane/models/inputwindowsmetrics.py +457 -0
  91. cribl_control_plane/models/inputwineventlogs.py +222 -0
  92. cribl_control_plane/models/inputwiz.py +334 -0
  93. cribl_control_plane/models/inputzscalerhec.py +439 -0
  94. cribl_control_plane/models/listinputop.py +24 -0
  95. cribl_control_plane/models/listoutputop.py +24 -0
  96. cribl_control_plane/models/logininfo.py +16 -0
  97. cribl_control_plane/models/output.py +229 -0
  98. cribl_control_plane/models/outputazureblob.py +471 -0
  99. cribl_control_plane/models/outputazuredataexplorer.py +660 -0
  100. cribl_control_plane/models/outputazureeventhub.py +321 -0
  101. cribl_control_plane/models/outputazurelogs.py +386 -0
  102. cribl_control_plane/models/outputclickhouse.py +650 -0
  103. cribl_control_plane/models/outputcloudwatch.py +273 -0
  104. cribl_control_plane/models/outputconfluentcloud.py +591 -0
  105. cribl_control_plane/models/outputcriblhttp.py +494 -0
  106. cribl_control_plane/models/outputcribllake.py +396 -0
  107. cribl_control_plane/models/outputcribltcp.py +387 -0
  108. cribl_control_plane/models/outputcrowdstrikenextgensiem.py +410 -0
  109. cribl_control_plane/models/outputdatadog.py +472 -0
  110. cribl_control_plane/models/outputdataset.py +437 -0
  111. cribl_control_plane/models/outputdefault.py +55 -0
  112. cribl_control_plane/models/outputdevnull.py +50 -0
  113. cribl_control_plane/models/outputdiskspool.py +89 -0
  114. cribl_control_plane/models/outputdls3.py +560 -0
  115. cribl_control_plane/models/outputdynatracehttp.py +454 -0
  116. cribl_control_plane/models/outputdynatraceotlp.py +486 -0
  117. cribl_control_plane/models/outputelastic.py +494 -0
  118. cribl_control_plane/models/outputelasticcloud.py +407 -0
  119. cribl_control_plane/models/outputexabeam.py +297 -0
  120. cribl_control_plane/models/outputfilesystem.py +357 -0
  121. cribl_control_plane/models/outputgooglechronicle.py +486 -0
  122. cribl_control_plane/models/outputgooglecloudlogging.py +557 -0
  123. cribl_control_plane/models/outputgooglecloudstorage.py +499 -0
  124. cribl_control_plane/models/outputgooglepubsub.py +274 -0
  125. cribl_control_plane/models/outputgrafanacloud_union.py +1024 -0
  126. cribl_control_plane/models/outputgraphite.py +225 -0
  127. cribl_control_plane/models/outputhoneycomb.py +369 -0
  128. cribl_control_plane/models/outputhumiohec.py +389 -0
  129. cribl_control_plane/models/outputinfluxdb.py +523 -0
  130. cribl_control_plane/models/outputkafka.py +581 -0
  131. cribl_control_plane/models/outputkinesis.py +312 -0
  132. cribl_control_plane/models/outputloki.py +425 -0
  133. cribl_control_plane/models/outputminio.py +512 -0
  134. cribl_control_plane/models/outputmsk.py +654 -0
  135. cribl_control_plane/models/outputnetflow.py +80 -0
  136. cribl_control_plane/models/outputnewrelic.py +424 -0
  137. cribl_control_plane/models/outputnewrelicevents.py +401 -0
  138. cribl_control_plane/models/outputopentelemetry.py +669 -0
  139. cribl_control_plane/models/outputprometheus.py +485 -0
  140. cribl_control_plane/models/outputring.py +121 -0
  141. cribl_control_plane/models/outputrouter.py +83 -0
  142. cribl_control_plane/models/outputs3.py +556 -0
  143. cribl_control_plane/models/outputsamplesresponse.py +14 -0
  144. cribl_control_plane/models/outputsecuritylake.py +505 -0
  145. cribl_control_plane/models/outputsentinel.py +488 -0
  146. cribl_control_plane/models/outputsentineloneaisiem.py +505 -0
  147. cribl_control_plane/models/outputservicenow.py +543 -0
  148. cribl_control_plane/models/outputsignalfx.py +369 -0
  149. cribl_control_plane/models/outputsnmp.py +80 -0
  150. cribl_control_plane/models/outputsns.py +274 -0
  151. cribl_control_plane/models/outputsplunk.py +383 -0
  152. cribl_control_plane/models/outputsplunkhec.py +434 -0
  153. cribl_control_plane/models/outputsplunklb.py +558 -0
  154. cribl_control_plane/models/outputsqs.py +328 -0
  155. cribl_control_plane/models/outputstatsd.py +224 -0
  156. cribl_control_plane/models/outputstatsdext.py +225 -0
  157. cribl_control_plane/models/outputsumologic.py +378 -0
  158. cribl_control_plane/models/outputsyslog.py +415 -0
  159. cribl_control_plane/models/outputtcpjson.py +413 -0
  160. cribl_control_plane/models/outputtestrequest.py +15 -0
  161. cribl_control_plane/models/outputtestresponse.py +29 -0
  162. cribl_control_plane/models/outputwavefront.py +369 -0
  163. cribl_control_plane/models/outputwebhook.py +689 -0
  164. cribl_control_plane/models/outputxsiam.py +415 -0
  165. cribl_control_plane/models/schemeclientoauth.py +24 -0
  166. cribl_control_plane/models/security.py +36 -0
  167. cribl_control_plane/models/updatehectokenrequest.py +31 -0
  168. cribl_control_plane/models/updateinputbyidop.py +44 -0
  169. cribl_control_plane/models/updateinputhectokenbyidandtokenop.py +52 -0
  170. cribl_control_plane/models/updateoutputbyidop.py +44 -0
  171. cribl_control_plane/outputs.py +1615 -0
  172. cribl_control_plane/py.typed +1 -0
  173. cribl_control_plane/sdk.py +164 -0
  174. cribl_control_plane/sdkconfiguration.py +36 -0
  175. cribl_control_plane/sources.py +1355 -0
  176. cribl_control_plane/types/__init__.py +21 -0
  177. cribl_control_plane/types/basemodel.py +39 -0
  178. cribl_control_plane/utils/__init__.py +187 -0
  179. cribl_control_plane/utils/annotations.py +55 -0
  180. cribl_control_plane/utils/datetimes.py +23 -0
  181. cribl_control_plane/utils/enums.py +74 -0
  182. cribl_control_plane/utils/eventstreaming.py +238 -0
  183. cribl_control_plane/utils/forms.py +223 -0
  184. cribl_control_plane/utils/headers.py +136 -0
  185. cribl_control_plane/utils/logger.py +27 -0
  186. cribl_control_plane/utils/metadata.py +118 -0
  187. cribl_control_plane/utils/queryparams.py +205 -0
  188. cribl_control_plane/utils/requestbodies.py +66 -0
  189. cribl_control_plane/utils/retries.py +217 -0
  190. cribl_control_plane/utils/security.py +207 -0
  191. cribl_control_plane/utils/serializers.py +249 -0
  192. cribl_control_plane/utils/unmarshal_json_response.py +24 -0
  193. cribl_control_plane/utils/url.py +155 -0
  194. cribl_control_plane/utils/values.py +137 -0
  195. cribl_control_plane-0.0.13.dist-info/METADATA +489 -0
  196. cribl_control_plane-0.0.13.dist-info/RECORD +197 -0
  197. cribl_control_plane-0.0.13.dist-info/WHEEL +4 -0
@@ -0,0 +1,166 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .basesdk import BaseSDK
4
+ from cribl_control_plane import errors, models, utils
5
+ from cribl_control_plane._hooks import HookContext
6
+ from cribl_control_plane.types import OptionalNullable, UNSET
7
+ from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
8
+ from typing import Any, Mapping, Optional
9
+
10
+
11
+ class Health(BaseSDK):
12
+ r"""Actions related to REST server health"""
13
+
14
+ def get_health_info(
15
+ self,
16
+ *,
17
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
18
+ server_url: Optional[str] = None,
19
+ timeout_ms: Optional[int] = None,
20
+ http_headers: Optional[Mapping[str, str]] = None,
21
+ ) -> models.HealthStatus:
22
+ r"""Provides health info for REST server
23
+
24
+ :param retries: Override the default retry configuration for this method
25
+ :param server_url: Override the default server URL for this method
26
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
27
+ :param http_headers: Additional headers to set or replace on requests.
28
+ """
29
+ base_url = None
30
+ url_variables = None
31
+ if timeout_ms is None:
32
+ timeout_ms = self.sdk_configuration.timeout_ms
33
+
34
+ if server_url is not None:
35
+ base_url = server_url
36
+ else:
37
+ base_url = self._get_url(base_url, url_variables)
38
+ req = self._build_request(
39
+ method="GET",
40
+ path="/health",
41
+ base_url=base_url,
42
+ url_variables=url_variables,
43
+ request=None,
44
+ request_body_required=False,
45
+ request_has_path_params=False,
46
+ request_has_query_params=False,
47
+ user_agent_header="user-agent",
48
+ accept_header_value="application/json",
49
+ http_headers=http_headers,
50
+ timeout_ms=timeout_ms,
51
+ )
52
+
53
+ if retries == UNSET:
54
+ if self.sdk_configuration.retry_config is not UNSET:
55
+ retries = self.sdk_configuration.retry_config
56
+
57
+ retry_config = None
58
+ if isinstance(retries, utils.RetryConfig):
59
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
60
+
61
+ http_res = self.do_request(
62
+ hook_ctx=HookContext(
63
+ config=self.sdk_configuration,
64
+ base_url=base_url or "",
65
+ operation_id="getHealthInfo",
66
+ oauth2_scopes=[],
67
+ security_source=None,
68
+ ),
69
+ request=req,
70
+ error_status_codes=["420", "4XX", "5XX"],
71
+ retry_config=retry_config,
72
+ )
73
+
74
+ response_data: Any = None
75
+ if utils.match_response(http_res, "200", "application/json"):
76
+ return unmarshal_json_response(models.HealthStatus, http_res)
77
+ if utils.match_response(http_res, "420", "application/json"):
78
+ response_data = unmarshal_json_response(
79
+ errors.HealthStatusErrorData, http_res
80
+ )
81
+ raise errors.HealthStatusError(response_data, http_res)
82
+ if utils.match_response(http_res, "4XX", "*"):
83
+ http_res_text = utils.stream_to_text(http_res)
84
+ raise errors.APIError("API error occurred", http_res, http_res_text)
85
+ if utils.match_response(http_res, "5XX", "*"):
86
+ http_res_text = utils.stream_to_text(http_res)
87
+ raise errors.APIError("API error occurred", http_res, http_res_text)
88
+
89
+ raise errors.APIError("Unexpected response received", http_res)
90
+
91
+ async def get_health_info_async(
92
+ self,
93
+ *,
94
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
95
+ server_url: Optional[str] = None,
96
+ timeout_ms: Optional[int] = None,
97
+ http_headers: Optional[Mapping[str, str]] = None,
98
+ ) -> models.HealthStatus:
99
+ r"""Provides health info for REST server
100
+
101
+ :param retries: Override the default retry configuration for this method
102
+ :param server_url: Override the default server URL for this method
103
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
104
+ :param http_headers: Additional headers to set or replace on requests.
105
+ """
106
+ base_url = None
107
+ url_variables = None
108
+ if timeout_ms is None:
109
+ timeout_ms = self.sdk_configuration.timeout_ms
110
+
111
+ if server_url is not None:
112
+ base_url = server_url
113
+ else:
114
+ base_url = self._get_url(base_url, url_variables)
115
+ req = self._build_request_async(
116
+ method="GET",
117
+ path="/health",
118
+ base_url=base_url,
119
+ url_variables=url_variables,
120
+ request=None,
121
+ request_body_required=False,
122
+ request_has_path_params=False,
123
+ request_has_query_params=False,
124
+ user_agent_header="user-agent",
125
+ accept_header_value="application/json",
126
+ http_headers=http_headers,
127
+ timeout_ms=timeout_ms,
128
+ )
129
+
130
+ if retries == UNSET:
131
+ if self.sdk_configuration.retry_config is not UNSET:
132
+ retries = self.sdk_configuration.retry_config
133
+
134
+ retry_config = None
135
+ if isinstance(retries, utils.RetryConfig):
136
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
137
+
138
+ http_res = await self.do_request_async(
139
+ hook_ctx=HookContext(
140
+ config=self.sdk_configuration,
141
+ base_url=base_url or "",
142
+ operation_id="getHealthInfo",
143
+ oauth2_scopes=[],
144
+ security_source=None,
145
+ ),
146
+ request=req,
147
+ error_status_codes=["420", "4XX", "5XX"],
148
+ retry_config=retry_config,
149
+ )
150
+
151
+ response_data: Any = None
152
+ if utils.match_response(http_res, "200", "application/json"):
153
+ return unmarshal_json_response(models.HealthStatus, http_res)
154
+ if utils.match_response(http_res, "420", "application/json"):
155
+ response_data = unmarshal_json_response(
156
+ errors.HealthStatusErrorData, http_res
157
+ )
158
+ raise errors.HealthStatusError(response_data, http_res)
159
+ if utils.match_response(http_res, "4XX", "*"):
160
+ http_res_text = await utils.stream_to_text_async(http_res)
161
+ raise errors.APIError("API error occurred", http_res, http_res_text)
162
+ if utils.match_response(http_res, "5XX", "*"):
163
+ http_res_text = await utils.stream_to_text_async(http_res)
164
+ raise errors.APIError("API error occurred", http_res, http_res_text)
165
+
166
+ raise errors.APIError("Unexpected response received", http_res)
@@ -0,0 +1,126 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ # pyright: reportReturnType = false
4
+ import asyncio
5
+ from typing_extensions import Protocol, runtime_checkable
6
+ import httpx
7
+ from typing import Any, Optional, Union
8
+
9
+
10
+ @runtime_checkable
11
+ class HttpClient(Protocol):
12
+ def send(
13
+ self,
14
+ request: httpx.Request,
15
+ *,
16
+ stream: bool = False,
17
+ auth: Union[
18
+ httpx._types.AuthTypes, httpx._client.UseClientDefault, None
19
+ ] = httpx.USE_CLIENT_DEFAULT,
20
+ follow_redirects: Union[
21
+ bool, httpx._client.UseClientDefault
22
+ ] = httpx.USE_CLIENT_DEFAULT,
23
+ ) -> httpx.Response:
24
+ pass
25
+
26
+ def build_request(
27
+ self,
28
+ method: str,
29
+ url: httpx._types.URLTypes,
30
+ *,
31
+ content: Optional[httpx._types.RequestContent] = None,
32
+ data: Optional[httpx._types.RequestData] = None,
33
+ files: Optional[httpx._types.RequestFiles] = None,
34
+ json: Optional[Any] = None,
35
+ params: Optional[httpx._types.QueryParamTypes] = None,
36
+ headers: Optional[httpx._types.HeaderTypes] = None,
37
+ cookies: Optional[httpx._types.CookieTypes] = None,
38
+ timeout: Union[
39
+ httpx._types.TimeoutTypes, httpx._client.UseClientDefault
40
+ ] = httpx.USE_CLIENT_DEFAULT,
41
+ extensions: Optional[httpx._types.RequestExtensions] = None,
42
+ ) -> httpx.Request:
43
+ pass
44
+
45
+ def close(self) -> None:
46
+ pass
47
+
48
+
49
+ @runtime_checkable
50
+ class AsyncHttpClient(Protocol):
51
+ async def send(
52
+ self,
53
+ request: httpx.Request,
54
+ *,
55
+ stream: bool = False,
56
+ auth: Union[
57
+ httpx._types.AuthTypes, httpx._client.UseClientDefault, None
58
+ ] = httpx.USE_CLIENT_DEFAULT,
59
+ follow_redirects: Union[
60
+ bool, httpx._client.UseClientDefault
61
+ ] = httpx.USE_CLIENT_DEFAULT,
62
+ ) -> httpx.Response:
63
+ pass
64
+
65
+ def build_request(
66
+ self,
67
+ method: str,
68
+ url: httpx._types.URLTypes,
69
+ *,
70
+ content: Optional[httpx._types.RequestContent] = None,
71
+ data: Optional[httpx._types.RequestData] = None,
72
+ files: Optional[httpx._types.RequestFiles] = None,
73
+ json: Optional[Any] = None,
74
+ params: Optional[httpx._types.QueryParamTypes] = None,
75
+ headers: Optional[httpx._types.HeaderTypes] = None,
76
+ cookies: Optional[httpx._types.CookieTypes] = None,
77
+ timeout: Union[
78
+ httpx._types.TimeoutTypes, httpx._client.UseClientDefault
79
+ ] = httpx.USE_CLIENT_DEFAULT,
80
+ extensions: Optional[httpx._types.RequestExtensions] = None,
81
+ ) -> httpx.Request:
82
+ pass
83
+
84
+ async def aclose(self) -> None:
85
+ pass
86
+
87
+
88
+ class ClientOwner(Protocol):
89
+ client: Union[HttpClient, None]
90
+ async_client: Union[AsyncHttpClient, None]
91
+
92
+
93
+ def close_clients(
94
+ owner: ClientOwner,
95
+ sync_client: Union[HttpClient, None],
96
+ sync_client_supplied: bool,
97
+ async_client: Union[AsyncHttpClient, None],
98
+ async_client_supplied: bool,
99
+ ) -> None:
100
+ """
101
+ A finalizer function that is meant to be used with weakref.finalize to close
102
+ httpx clients used by an SDK so that underlying resources can be garbage
103
+ collected.
104
+ """
105
+
106
+ # Unset the client/async_client properties so there are no more references
107
+ # to them from the owning SDK instance and they can be reaped.
108
+ owner.client = None
109
+ owner.async_client = None
110
+
111
+ if sync_client is not None and not sync_client_supplied:
112
+ try:
113
+ sync_client.close()
114
+ except Exception:
115
+ pass
116
+
117
+ if async_client is not None and not async_client_supplied:
118
+ try:
119
+ loop = asyncio.get_running_loop()
120
+ asyncio.run_coroutine_threadsafe(async_client.aclose(), loop)
121
+ except RuntimeError:
122
+ try:
123
+ asyncio.run(async_client.aclose())
124
+ except RuntimeError:
125
+ # best effort
126
+ pass