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.
- cribl_control_plane/__init__.py +17 -0
- cribl_control_plane/_hooks/__init__.py +5 -0
- cribl_control_plane/_hooks/clientcredentials.py +211 -0
- cribl_control_plane/_hooks/registration.py +13 -0
- cribl_control_plane/_hooks/sdkhooks.py +81 -0
- cribl_control_plane/_hooks/types.py +112 -0
- cribl_control_plane/_version.py +15 -0
- cribl_control_plane/auth_sdk.py +184 -0
- cribl_control_plane/basesdk.py +358 -0
- cribl_control_plane/errors/__init__.py +60 -0
- cribl_control_plane/errors/apierror.py +38 -0
- cribl_control_plane/errors/criblcontrolplaneerror.py +26 -0
- cribl_control_plane/errors/error.py +24 -0
- cribl_control_plane/errors/healthstatus_error.py +38 -0
- cribl_control_plane/errors/no_response_error.py +13 -0
- cribl_control_plane/errors/responsevalidationerror.py +25 -0
- cribl_control_plane/health.py +166 -0
- cribl_control_plane/httpclient.py +126 -0
- cribl_control_plane/models/__init__.py +7305 -0
- cribl_control_plane/models/addhectokenrequest.py +34 -0
- cribl_control_plane/models/authtoken.py +13 -0
- cribl_control_plane/models/createinputhectokenbyidop.py +45 -0
- cribl_control_plane/models/createinputop.py +24 -0
- cribl_control_plane/models/createoutputop.py +24 -0
- cribl_control_plane/models/createoutputtestbyidop.py +46 -0
- cribl_control_plane/models/criblevent.py +14 -0
- cribl_control_plane/models/deleteinputbyidop.py +37 -0
- cribl_control_plane/models/deleteoutputbyidop.py +37 -0
- cribl_control_plane/models/deleteoutputpqbyidop.py +36 -0
- cribl_control_plane/models/getinputbyidop.py +37 -0
- cribl_control_plane/models/getoutputbyidop.py +37 -0
- cribl_control_plane/models/getoutputpqbyidop.py +36 -0
- cribl_control_plane/models/getoutputsamplesbyidop.py +37 -0
- cribl_control_plane/models/healthstatus.py +36 -0
- cribl_control_plane/models/input.py +199 -0
- cribl_control_plane/models/inputappscope.py +448 -0
- cribl_control_plane/models/inputazureblob.py +308 -0
- cribl_control_plane/models/inputcollection.py +208 -0
- cribl_control_plane/models/inputconfluentcloud.py +585 -0
- cribl_control_plane/models/inputcribl.py +165 -0
- cribl_control_plane/models/inputcriblhttp.py +341 -0
- cribl_control_plane/models/inputcribllakehttp.py +342 -0
- cribl_control_plane/models/inputcriblmetrics.py +175 -0
- cribl_control_plane/models/inputcribltcp.py +299 -0
- cribl_control_plane/models/inputcrowdstrike.py +410 -0
- cribl_control_plane/models/inputdatadogagent.py +364 -0
- cribl_control_plane/models/inputdatagen.py +180 -0
- cribl_control_plane/models/inputedgeprometheus.py +551 -0
- cribl_control_plane/models/inputelastic.py +494 -0
- cribl_control_plane/models/inputeventhub.py +360 -0
- cribl_control_plane/models/inputexec.py +213 -0
- cribl_control_plane/models/inputfile.py +259 -0
- cribl_control_plane/models/inputfirehose.py +341 -0
- cribl_control_plane/models/inputgooglepubsub.py +247 -0
- cribl_control_plane/models/inputgrafana_union.py +1247 -0
- cribl_control_plane/models/inputhttp.py +403 -0
- cribl_control_plane/models/inputhttpraw.py +407 -0
- cribl_control_plane/models/inputjournalfiles.py +208 -0
- cribl_control_plane/models/inputkafka.py +581 -0
- cribl_control_plane/models/inputkinesis.py +363 -0
- cribl_control_plane/models/inputkubeevents.py +182 -0
- cribl_control_plane/models/inputkubelogs.py +256 -0
- cribl_control_plane/models/inputkubemetrics.py +233 -0
- cribl_control_plane/models/inputloki.py +468 -0
- cribl_control_plane/models/inputmetrics.py +290 -0
- cribl_control_plane/models/inputmodeldriventelemetry.py +274 -0
- cribl_control_plane/models/inputmsk.py +654 -0
- cribl_control_plane/models/inputnetflow.py +224 -0
- cribl_control_plane/models/inputoffice365mgmt.py +384 -0
- cribl_control_plane/models/inputoffice365msgtrace.py +449 -0
- cribl_control_plane/models/inputoffice365service.py +377 -0
- cribl_control_plane/models/inputopentelemetry.py +516 -0
- cribl_control_plane/models/inputprometheus.py +464 -0
- cribl_control_plane/models/inputprometheusrw.py +470 -0
- cribl_control_plane/models/inputrawudp.py +207 -0
- cribl_control_plane/models/inputs3.py +416 -0
- cribl_control_plane/models/inputs3inventory.py +440 -0
- cribl_control_plane/models/inputsecuritylake.py +425 -0
- cribl_control_plane/models/inputsnmp.py +274 -0
- cribl_control_plane/models/inputsplunk.py +387 -0
- cribl_control_plane/models/inputsplunkhec.py +478 -0
- cribl_control_plane/models/inputsplunksearch.py +537 -0
- cribl_control_plane/models/inputsqs.py +320 -0
- cribl_control_plane/models/inputsyslog_union.py +759 -0
- cribl_control_plane/models/inputsystemmetrics.py +533 -0
- cribl_control_plane/models/inputsystemstate.py +417 -0
- cribl_control_plane/models/inputtcp.py +359 -0
- cribl_control_plane/models/inputtcpjson.py +334 -0
- cribl_control_plane/models/inputwef.py +498 -0
- cribl_control_plane/models/inputwindowsmetrics.py +457 -0
- cribl_control_plane/models/inputwineventlogs.py +222 -0
- cribl_control_plane/models/inputwiz.py +334 -0
- cribl_control_plane/models/inputzscalerhec.py +439 -0
- cribl_control_plane/models/listinputop.py +24 -0
- cribl_control_plane/models/listoutputop.py +24 -0
- cribl_control_plane/models/logininfo.py +16 -0
- cribl_control_plane/models/output.py +229 -0
- cribl_control_plane/models/outputazureblob.py +471 -0
- cribl_control_plane/models/outputazuredataexplorer.py +660 -0
- cribl_control_plane/models/outputazureeventhub.py +321 -0
- cribl_control_plane/models/outputazurelogs.py +386 -0
- cribl_control_plane/models/outputclickhouse.py +650 -0
- cribl_control_plane/models/outputcloudwatch.py +273 -0
- cribl_control_plane/models/outputconfluentcloud.py +591 -0
- cribl_control_plane/models/outputcriblhttp.py +494 -0
- cribl_control_plane/models/outputcribllake.py +396 -0
- cribl_control_plane/models/outputcribltcp.py +387 -0
- cribl_control_plane/models/outputcrowdstrikenextgensiem.py +410 -0
- cribl_control_plane/models/outputdatadog.py +472 -0
- cribl_control_plane/models/outputdataset.py +437 -0
- cribl_control_plane/models/outputdefault.py +55 -0
- cribl_control_plane/models/outputdevnull.py +50 -0
- cribl_control_plane/models/outputdiskspool.py +89 -0
- cribl_control_plane/models/outputdls3.py +560 -0
- cribl_control_plane/models/outputdynatracehttp.py +454 -0
- cribl_control_plane/models/outputdynatraceotlp.py +486 -0
- cribl_control_plane/models/outputelastic.py +494 -0
- cribl_control_plane/models/outputelasticcloud.py +407 -0
- cribl_control_plane/models/outputexabeam.py +297 -0
- cribl_control_plane/models/outputfilesystem.py +357 -0
- cribl_control_plane/models/outputgooglechronicle.py +486 -0
- cribl_control_plane/models/outputgooglecloudlogging.py +557 -0
- cribl_control_plane/models/outputgooglecloudstorage.py +499 -0
- cribl_control_plane/models/outputgooglepubsub.py +274 -0
- cribl_control_plane/models/outputgrafanacloud_union.py +1024 -0
- cribl_control_plane/models/outputgraphite.py +225 -0
- cribl_control_plane/models/outputhoneycomb.py +369 -0
- cribl_control_plane/models/outputhumiohec.py +389 -0
- cribl_control_plane/models/outputinfluxdb.py +523 -0
- cribl_control_plane/models/outputkafka.py +581 -0
- cribl_control_plane/models/outputkinesis.py +312 -0
- cribl_control_plane/models/outputloki.py +425 -0
- cribl_control_plane/models/outputminio.py +512 -0
- cribl_control_plane/models/outputmsk.py +654 -0
- cribl_control_plane/models/outputnetflow.py +80 -0
- cribl_control_plane/models/outputnewrelic.py +424 -0
- cribl_control_plane/models/outputnewrelicevents.py +401 -0
- cribl_control_plane/models/outputopentelemetry.py +669 -0
- cribl_control_plane/models/outputprometheus.py +485 -0
- cribl_control_plane/models/outputring.py +121 -0
- cribl_control_plane/models/outputrouter.py +83 -0
- cribl_control_plane/models/outputs3.py +556 -0
- cribl_control_plane/models/outputsamplesresponse.py +14 -0
- cribl_control_plane/models/outputsecuritylake.py +505 -0
- cribl_control_plane/models/outputsentinel.py +488 -0
- cribl_control_plane/models/outputsentineloneaisiem.py +505 -0
- cribl_control_plane/models/outputservicenow.py +543 -0
- cribl_control_plane/models/outputsignalfx.py +369 -0
- cribl_control_plane/models/outputsnmp.py +80 -0
- cribl_control_plane/models/outputsns.py +274 -0
- cribl_control_plane/models/outputsplunk.py +383 -0
- cribl_control_plane/models/outputsplunkhec.py +434 -0
- cribl_control_plane/models/outputsplunklb.py +558 -0
- cribl_control_plane/models/outputsqs.py +328 -0
- cribl_control_plane/models/outputstatsd.py +224 -0
- cribl_control_plane/models/outputstatsdext.py +225 -0
- cribl_control_plane/models/outputsumologic.py +378 -0
- cribl_control_plane/models/outputsyslog.py +415 -0
- cribl_control_plane/models/outputtcpjson.py +413 -0
- cribl_control_plane/models/outputtestrequest.py +15 -0
- cribl_control_plane/models/outputtestresponse.py +29 -0
- cribl_control_plane/models/outputwavefront.py +369 -0
- cribl_control_plane/models/outputwebhook.py +689 -0
- cribl_control_plane/models/outputxsiam.py +415 -0
- cribl_control_plane/models/schemeclientoauth.py +24 -0
- cribl_control_plane/models/security.py +36 -0
- cribl_control_plane/models/updatehectokenrequest.py +31 -0
- cribl_control_plane/models/updateinputbyidop.py +44 -0
- cribl_control_plane/models/updateinputhectokenbyidandtokenop.py +52 -0
- cribl_control_plane/models/updateoutputbyidop.py +44 -0
- cribl_control_plane/outputs.py +1615 -0
- cribl_control_plane/py.typed +1 -0
- cribl_control_plane/sdk.py +164 -0
- cribl_control_plane/sdkconfiguration.py +36 -0
- cribl_control_plane/sources.py +1355 -0
- cribl_control_plane/types/__init__.py +21 -0
- cribl_control_plane/types/basemodel.py +39 -0
- cribl_control_plane/utils/__init__.py +187 -0
- cribl_control_plane/utils/annotations.py +55 -0
- cribl_control_plane/utils/datetimes.py +23 -0
- cribl_control_plane/utils/enums.py +74 -0
- cribl_control_plane/utils/eventstreaming.py +238 -0
- cribl_control_plane/utils/forms.py +223 -0
- cribl_control_plane/utils/headers.py +136 -0
- cribl_control_plane/utils/logger.py +27 -0
- cribl_control_plane/utils/metadata.py +118 -0
- cribl_control_plane/utils/queryparams.py +205 -0
- cribl_control_plane/utils/requestbodies.py +66 -0
- cribl_control_plane/utils/retries.py +217 -0
- cribl_control_plane/utils/security.py +207 -0
- cribl_control_plane/utils/serializers.py +249 -0
- cribl_control_plane/utils/unmarshal_json_response.py +24 -0
- cribl_control_plane/utils/url.py +155 -0
- cribl_control_plane/utils/values.py +137 -0
- cribl_control_plane-0.0.13.dist-info/METADATA +489 -0
- cribl_control_plane-0.0.13.dist-info/RECORD +197 -0
- cribl_control_plane-0.0.13.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,1355 @@
|
|
|
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 BaseModel, OptionalNullable, UNSET
|
|
7
|
+
from cribl_control_plane.utils import get_security_from_env
|
|
8
|
+
from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Any, List, Mapping, Optional, Union, cast
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Sources(BaseSDK):
|
|
13
|
+
r"""Actions related to Sources"""
|
|
14
|
+
|
|
15
|
+
def list_source(
|
|
16
|
+
self,
|
|
17
|
+
*,
|
|
18
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
19
|
+
server_url: Optional[str] = None,
|
|
20
|
+
timeout_ms: Optional[int] = None,
|
|
21
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
22
|
+
) -> models.ListInputResponse:
|
|
23
|
+
r"""Get a list of Source objects
|
|
24
|
+
|
|
25
|
+
Get a list of Source objects
|
|
26
|
+
|
|
27
|
+
:param retries: Override the default retry configuration for this method
|
|
28
|
+
:param server_url: Override the default server URL for this method
|
|
29
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
30
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
31
|
+
"""
|
|
32
|
+
base_url = None
|
|
33
|
+
url_variables = None
|
|
34
|
+
if timeout_ms is None:
|
|
35
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
36
|
+
|
|
37
|
+
if server_url is not None:
|
|
38
|
+
base_url = server_url
|
|
39
|
+
else:
|
|
40
|
+
base_url = self._get_url(base_url, url_variables)
|
|
41
|
+
req = self._build_request(
|
|
42
|
+
method="GET",
|
|
43
|
+
path="/system/inputs",
|
|
44
|
+
base_url=base_url,
|
|
45
|
+
url_variables=url_variables,
|
|
46
|
+
request=None,
|
|
47
|
+
request_body_required=False,
|
|
48
|
+
request_has_path_params=False,
|
|
49
|
+
request_has_query_params=True,
|
|
50
|
+
user_agent_header="user-agent",
|
|
51
|
+
accept_header_value="application/json",
|
|
52
|
+
http_headers=http_headers,
|
|
53
|
+
security=self.sdk_configuration.security,
|
|
54
|
+
timeout_ms=timeout_ms,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
if retries == UNSET:
|
|
58
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
59
|
+
retries = self.sdk_configuration.retry_config
|
|
60
|
+
|
|
61
|
+
retry_config = None
|
|
62
|
+
if isinstance(retries, utils.RetryConfig):
|
|
63
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
64
|
+
|
|
65
|
+
http_res = self.do_request(
|
|
66
|
+
hook_ctx=HookContext(
|
|
67
|
+
config=self.sdk_configuration,
|
|
68
|
+
base_url=base_url or "",
|
|
69
|
+
operation_id="listInput",
|
|
70
|
+
oauth2_scopes=[],
|
|
71
|
+
security_source=get_security_from_env(
|
|
72
|
+
self.sdk_configuration.security, models.Security
|
|
73
|
+
),
|
|
74
|
+
),
|
|
75
|
+
request=req,
|
|
76
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
77
|
+
retry_config=retry_config,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
response_data: Any = None
|
|
81
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
82
|
+
return unmarshal_json_response(models.ListInputResponse, http_res)
|
|
83
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
84
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
85
|
+
raise errors.Error(response_data, http_res)
|
|
86
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
87
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
88
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
89
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
90
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
91
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
92
|
+
|
|
93
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
94
|
+
|
|
95
|
+
async def list_source_async(
|
|
96
|
+
self,
|
|
97
|
+
*,
|
|
98
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
99
|
+
server_url: Optional[str] = None,
|
|
100
|
+
timeout_ms: Optional[int] = None,
|
|
101
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
102
|
+
) -> models.ListInputResponse:
|
|
103
|
+
r"""Get a list of Source objects
|
|
104
|
+
|
|
105
|
+
Get a list of Source objects
|
|
106
|
+
|
|
107
|
+
:param retries: Override the default retry configuration for this method
|
|
108
|
+
:param server_url: Override the default server URL for this method
|
|
109
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
110
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
111
|
+
"""
|
|
112
|
+
base_url = None
|
|
113
|
+
url_variables = None
|
|
114
|
+
if timeout_ms is None:
|
|
115
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
116
|
+
|
|
117
|
+
if server_url is not None:
|
|
118
|
+
base_url = server_url
|
|
119
|
+
else:
|
|
120
|
+
base_url = self._get_url(base_url, url_variables)
|
|
121
|
+
req = self._build_request_async(
|
|
122
|
+
method="GET",
|
|
123
|
+
path="/system/inputs",
|
|
124
|
+
base_url=base_url,
|
|
125
|
+
url_variables=url_variables,
|
|
126
|
+
request=None,
|
|
127
|
+
request_body_required=False,
|
|
128
|
+
request_has_path_params=False,
|
|
129
|
+
request_has_query_params=True,
|
|
130
|
+
user_agent_header="user-agent",
|
|
131
|
+
accept_header_value="application/json",
|
|
132
|
+
http_headers=http_headers,
|
|
133
|
+
security=self.sdk_configuration.security,
|
|
134
|
+
timeout_ms=timeout_ms,
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
if retries == UNSET:
|
|
138
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
139
|
+
retries = self.sdk_configuration.retry_config
|
|
140
|
+
|
|
141
|
+
retry_config = None
|
|
142
|
+
if isinstance(retries, utils.RetryConfig):
|
|
143
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
144
|
+
|
|
145
|
+
http_res = await self.do_request_async(
|
|
146
|
+
hook_ctx=HookContext(
|
|
147
|
+
config=self.sdk_configuration,
|
|
148
|
+
base_url=base_url or "",
|
|
149
|
+
operation_id="listInput",
|
|
150
|
+
oauth2_scopes=[],
|
|
151
|
+
security_source=get_security_from_env(
|
|
152
|
+
self.sdk_configuration.security, models.Security
|
|
153
|
+
),
|
|
154
|
+
),
|
|
155
|
+
request=req,
|
|
156
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
157
|
+
retry_config=retry_config,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
response_data: Any = None
|
|
161
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
162
|
+
return unmarshal_json_response(models.ListInputResponse, http_res)
|
|
163
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
164
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
165
|
+
raise errors.Error(response_data, http_res)
|
|
166
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
167
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
168
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
169
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
170
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
171
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
172
|
+
|
|
173
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
174
|
+
|
|
175
|
+
def create_source(
|
|
176
|
+
self,
|
|
177
|
+
*,
|
|
178
|
+
request: Union[models.Input, models.InputTypedDict],
|
|
179
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
180
|
+
server_url: Optional[str] = None,
|
|
181
|
+
timeout_ms: Optional[int] = None,
|
|
182
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
183
|
+
) -> models.CreateInputResponse:
|
|
184
|
+
r"""Create Source
|
|
185
|
+
|
|
186
|
+
Create Source
|
|
187
|
+
|
|
188
|
+
:param request: The request object to send.
|
|
189
|
+
:param retries: Override the default retry configuration for this method
|
|
190
|
+
:param server_url: Override the default server URL for this method
|
|
191
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
192
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
193
|
+
"""
|
|
194
|
+
base_url = None
|
|
195
|
+
url_variables = None
|
|
196
|
+
if timeout_ms is None:
|
|
197
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
198
|
+
|
|
199
|
+
if server_url is not None:
|
|
200
|
+
base_url = server_url
|
|
201
|
+
else:
|
|
202
|
+
base_url = self._get_url(base_url, url_variables)
|
|
203
|
+
|
|
204
|
+
if not isinstance(request, BaseModel):
|
|
205
|
+
request = utils.unmarshal(request, models.Input)
|
|
206
|
+
request = cast(models.Input, request)
|
|
207
|
+
|
|
208
|
+
req = self._build_request(
|
|
209
|
+
method="POST",
|
|
210
|
+
path="/system/inputs",
|
|
211
|
+
base_url=base_url,
|
|
212
|
+
url_variables=url_variables,
|
|
213
|
+
request=request,
|
|
214
|
+
request_body_required=True,
|
|
215
|
+
request_has_path_params=False,
|
|
216
|
+
request_has_query_params=True,
|
|
217
|
+
user_agent_header="user-agent",
|
|
218
|
+
accept_header_value="application/json",
|
|
219
|
+
http_headers=http_headers,
|
|
220
|
+
security=self.sdk_configuration.security,
|
|
221
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
222
|
+
request, False, False, "json", models.Input
|
|
223
|
+
),
|
|
224
|
+
timeout_ms=timeout_ms,
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
if retries == UNSET:
|
|
228
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
229
|
+
retries = self.sdk_configuration.retry_config
|
|
230
|
+
|
|
231
|
+
retry_config = None
|
|
232
|
+
if isinstance(retries, utils.RetryConfig):
|
|
233
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
234
|
+
|
|
235
|
+
http_res = self.do_request(
|
|
236
|
+
hook_ctx=HookContext(
|
|
237
|
+
config=self.sdk_configuration,
|
|
238
|
+
base_url=base_url or "",
|
|
239
|
+
operation_id="createInput",
|
|
240
|
+
oauth2_scopes=[],
|
|
241
|
+
security_source=get_security_from_env(
|
|
242
|
+
self.sdk_configuration.security, models.Security
|
|
243
|
+
),
|
|
244
|
+
),
|
|
245
|
+
request=req,
|
|
246
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
247
|
+
retry_config=retry_config,
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
response_data: Any = None
|
|
251
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
252
|
+
return unmarshal_json_response(models.CreateInputResponse, http_res)
|
|
253
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
254
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
255
|
+
raise errors.Error(response_data, http_res)
|
|
256
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
257
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
258
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
259
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
260
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
261
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
262
|
+
|
|
263
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
264
|
+
|
|
265
|
+
async def create_source_async(
|
|
266
|
+
self,
|
|
267
|
+
*,
|
|
268
|
+
request: Union[models.Input, models.InputTypedDict],
|
|
269
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
270
|
+
server_url: Optional[str] = None,
|
|
271
|
+
timeout_ms: Optional[int] = None,
|
|
272
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
273
|
+
) -> models.CreateInputResponse:
|
|
274
|
+
r"""Create Source
|
|
275
|
+
|
|
276
|
+
Create Source
|
|
277
|
+
|
|
278
|
+
:param request: The request object to send.
|
|
279
|
+
:param retries: Override the default retry configuration for this method
|
|
280
|
+
:param server_url: Override the default server URL for this method
|
|
281
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
282
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
283
|
+
"""
|
|
284
|
+
base_url = None
|
|
285
|
+
url_variables = None
|
|
286
|
+
if timeout_ms is None:
|
|
287
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
288
|
+
|
|
289
|
+
if server_url is not None:
|
|
290
|
+
base_url = server_url
|
|
291
|
+
else:
|
|
292
|
+
base_url = self._get_url(base_url, url_variables)
|
|
293
|
+
|
|
294
|
+
if not isinstance(request, BaseModel):
|
|
295
|
+
request = utils.unmarshal(request, models.Input)
|
|
296
|
+
request = cast(models.Input, request)
|
|
297
|
+
|
|
298
|
+
req = self._build_request_async(
|
|
299
|
+
method="POST",
|
|
300
|
+
path="/system/inputs",
|
|
301
|
+
base_url=base_url,
|
|
302
|
+
url_variables=url_variables,
|
|
303
|
+
request=request,
|
|
304
|
+
request_body_required=True,
|
|
305
|
+
request_has_path_params=False,
|
|
306
|
+
request_has_query_params=True,
|
|
307
|
+
user_agent_header="user-agent",
|
|
308
|
+
accept_header_value="application/json",
|
|
309
|
+
http_headers=http_headers,
|
|
310
|
+
security=self.sdk_configuration.security,
|
|
311
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
312
|
+
request, False, False, "json", models.Input
|
|
313
|
+
),
|
|
314
|
+
timeout_ms=timeout_ms,
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
if retries == UNSET:
|
|
318
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
319
|
+
retries = self.sdk_configuration.retry_config
|
|
320
|
+
|
|
321
|
+
retry_config = None
|
|
322
|
+
if isinstance(retries, utils.RetryConfig):
|
|
323
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
324
|
+
|
|
325
|
+
http_res = await self.do_request_async(
|
|
326
|
+
hook_ctx=HookContext(
|
|
327
|
+
config=self.sdk_configuration,
|
|
328
|
+
base_url=base_url or "",
|
|
329
|
+
operation_id="createInput",
|
|
330
|
+
oauth2_scopes=[],
|
|
331
|
+
security_source=get_security_from_env(
|
|
332
|
+
self.sdk_configuration.security, models.Security
|
|
333
|
+
),
|
|
334
|
+
),
|
|
335
|
+
request=req,
|
|
336
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
337
|
+
retry_config=retry_config,
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
response_data: Any = None
|
|
341
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
342
|
+
return unmarshal_json_response(models.CreateInputResponse, http_res)
|
|
343
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
344
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
345
|
+
raise errors.Error(response_data, http_res)
|
|
346
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
347
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
348
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
349
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
350
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
351
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
352
|
+
|
|
353
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
354
|
+
|
|
355
|
+
def get_source_by_id(
|
|
356
|
+
self,
|
|
357
|
+
*,
|
|
358
|
+
id: str,
|
|
359
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
360
|
+
server_url: Optional[str] = None,
|
|
361
|
+
timeout_ms: Optional[int] = None,
|
|
362
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
363
|
+
) -> models.GetInputByIDResponse:
|
|
364
|
+
r"""Get Source by ID
|
|
365
|
+
|
|
366
|
+
Get Source by ID
|
|
367
|
+
|
|
368
|
+
:param id: Unique ID to GET
|
|
369
|
+
:param retries: Override the default retry configuration for this method
|
|
370
|
+
:param server_url: Override the default server URL for this method
|
|
371
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
372
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
373
|
+
"""
|
|
374
|
+
base_url = None
|
|
375
|
+
url_variables = None
|
|
376
|
+
if timeout_ms is None:
|
|
377
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
378
|
+
|
|
379
|
+
if server_url is not None:
|
|
380
|
+
base_url = server_url
|
|
381
|
+
else:
|
|
382
|
+
base_url = self._get_url(base_url, url_variables)
|
|
383
|
+
|
|
384
|
+
request = models.GetInputByIDRequest(
|
|
385
|
+
id=id,
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
req = self._build_request(
|
|
389
|
+
method="GET",
|
|
390
|
+
path="/system/inputs/{id}",
|
|
391
|
+
base_url=base_url,
|
|
392
|
+
url_variables=url_variables,
|
|
393
|
+
request=request,
|
|
394
|
+
request_body_required=False,
|
|
395
|
+
request_has_path_params=True,
|
|
396
|
+
request_has_query_params=True,
|
|
397
|
+
user_agent_header="user-agent",
|
|
398
|
+
accept_header_value="application/json",
|
|
399
|
+
http_headers=http_headers,
|
|
400
|
+
security=self.sdk_configuration.security,
|
|
401
|
+
timeout_ms=timeout_ms,
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
if retries == UNSET:
|
|
405
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
406
|
+
retries = self.sdk_configuration.retry_config
|
|
407
|
+
|
|
408
|
+
retry_config = None
|
|
409
|
+
if isinstance(retries, utils.RetryConfig):
|
|
410
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
411
|
+
|
|
412
|
+
http_res = self.do_request(
|
|
413
|
+
hook_ctx=HookContext(
|
|
414
|
+
config=self.sdk_configuration,
|
|
415
|
+
base_url=base_url or "",
|
|
416
|
+
operation_id="getInputById",
|
|
417
|
+
oauth2_scopes=[],
|
|
418
|
+
security_source=get_security_from_env(
|
|
419
|
+
self.sdk_configuration.security, models.Security
|
|
420
|
+
),
|
|
421
|
+
),
|
|
422
|
+
request=req,
|
|
423
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
424
|
+
retry_config=retry_config,
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
response_data: Any = None
|
|
428
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
429
|
+
return unmarshal_json_response(models.GetInputByIDResponse, http_res)
|
|
430
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
431
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
432
|
+
raise errors.Error(response_data, http_res)
|
|
433
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
434
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
435
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
436
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
437
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
438
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
439
|
+
|
|
440
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
441
|
+
|
|
442
|
+
async def get_source_by_id_async(
|
|
443
|
+
self,
|
|
444
|
+
*,
|
|
445
|
+
id: str,
|
|
446
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
447
|
+
server_url: Optional[str] = None,
|
|
448
|
+
timeout_ms: Optional[int] = None,
|
|
449
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
450
|
+
) -> models.GetInputByIDResponse:
|
|
451
|
+
r"""Get Source by ID
|
|
452
|
+
|
|
453
|
+
Get Source by ID
|
|
454
|
+
|
|
455
|
+
:param id: Unique ID to GET
|
|
456
|
+
:param retries: Override the default retry configuration for this method
|
|
457
|
+
:param server_url: Override the default server URL for this method
|
|
458
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
459
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
460
|
+
"""
|
|
461
|
+
base_url = None
|
|
462
|
+
url_variables = None
|
|
463
|
+
if timeout_ms is None:
|
|
464
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
465
|
+
|
|
466
|
+
if server_url is not None:
|
|
467
|
+
base_url = server_url
|
|
468
|
+
else:
|
|
469
|
+
base_url = self._get_url(base_url, url_variables)
|
|
470
|
+
|
|
471
|
+
request = models.GetInputByIDRequest(
|
|
472
|
+
id=id,
|
|
473
|
+
)
|
|
474
|
+
|
|
475
|
+
req = self._build_request_async(
|
|
476
|
+
method="GET",
|
|
477
|
+
path="/system/inputs/{id}",
|
|
478
|
+
base_url=base_url,
|
|
479
|
+
url_variables=url_variables,
|
|
480
|
+
request=request,
|
|
481
|
+
request_body_required=False,
|
|
482
|
+
request_has_path_params=True,
|
|
483
|
+
request_has_query_params=True,
|
|
484
|
+
user_agent_header="user-agent",
|
|
485
|
+
accept_header_value="application/json",
|
|
486
|
+
http_headers=http_headers,
|
|
487
|
+
security=self.sdk_configuration.security,
|
|
488
|
+
timeout_ms=timeout_ms,
|
|
489
|
+
)
|
|
490
|
+
|
|
491
|
+
if retries == UNSET:
|
|
492
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
493
|
+
retries = self.sdk_configuration.retry_config
|
|
494
|
+
|
|
495
|
+
retry_config = None
|
|
496
|
+
if isinstance(retries, utils.RetryConfig):
|
|
497
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
498
|
+
|
|
499
|
+
http_res = await self.do_request_async(
|
|
500
|
+
hook_ctx=HookContext(
|
|
501
|
+
config=self.sdk_configuration,
|
|
502
|
+
base_url=base_url or "",
|
|
503
|
+
operation_id="getInputById",
|
|
504
|
+
oauth2_scopes=[],
|
|
505
|
+
security_source=get_security_from_env(
|
|
506
|
+
self.sdk_configuration.security, models.Security
|
|
507
|
+
),
|
|
508
|
+
),
|
|
509
|
+
request=req,
|
|
510
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
511
|
+
retry_config=retry_config,
|
|
512
|
+
)
|
|
513
|
+
|
|
514
|
+
response_data: Any = None
|
|
515
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
516
|
+
return unmarshal_json_response(models.GetInputByIDResponse, http_res)
|
|
517
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
518
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
519
|
+
raise errors.Error(response_data, http_res)
|
|
520
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
521
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
522
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
523
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
524
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
525
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
526
|
+
|
|
527
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
528
|
+
|
|
529
|
+
def update_source_by_id(
|
|
530
|
+
self,
|
|
531
|
+
*,
|
|
532
|
+
id: str,
|
|
533
|
+
input_: Union[models.Input, models.InputTypedDict],
|
|
534
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
535
|
+
server_url: Optional[str] = None,
|
|
536
|
+
timeout_ms: Optional[int] = None,
|
|
537
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
538
|
+
) -> models.UpdateInputByIDResponse:
|
|
539
|
+
r"""Update Source
|
|
540
|
+
|
|
541
|
+
Update Source
|
|
542
|
+
|
|
543
|
+
:param id: Unique ID to PATCH
|
|
544
|
+
:param input: Source object to be updated
|
|
545
|
+
:param retries: Override the default retry configuration for this method
|
|
546
|
+
:param server_url: Override the default server URL for this method
|
|
547
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
548
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
549
|
+
"""
|
|
550
|
+
base_url = None
|
|
551
|
+
url_variables = None
|
|
552
|
+
if timeout_ms is None:
|
|
553
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
554
|
+
|
|
555
|
+
if server_url is not None:
|
|
556
|
+
base_url = server_url
|
|
557
|
+
else:
|
|
558
|
+
base_url = self._get_url(base_url, url_variables)
|
|
559
|
+
|
|
560
|
+
request = models.UpdateInputByIDRequest(
|
|
561
|
+
id=id,
|
|
562
|
+
input=utils.get_pydantic_model(input_, models.Input),
|
|
563
|
+
)
|
|
564
|
+
|
|
565
|
+
req = self._build_request(
|
|
566
|
+
method="PATCH",
|
|
567
|
+
path="/system/inputs/{id}",
|
|
568
|
+
base_url=base_url,
|
|
569
|
+
url_variables=url_variables,
|
|
570
|
+
request=request,
|
|
571
|
+
request_body_required=True,
|
|
572
|
+
request_has_path_params=True,
|
|
573
|
+
request_has_query_params=True,
|
|
574
|
+
user_agent_header="user-agent",
|
|
575
|
+
accept_header_value="application/json",
|
|
576
|
+
http_headers=http_headers,
|
|
577
|
+
security=self.sdk_configuration.security,
|
|
578
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
579
|
+
request.input, False, False, "json", models.Input
|
|
580
|
+
),
|
|
581
|
+
timeout_ms=timeout_ms,
|
|
582
|
+
)
|
|
583
|
+
|
|
584
|
+
if retries == UNSET:
|
|
585
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
586
|
+
retries = self.sdk_configuration.retry_config
|
|
587
|
+
|
|
588
|
+
retry_config = None
|
|
589
|
+
if isinstance(retries, utils.RetryConfig):
|
|
590
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
591
|
+
|
|
592
|
+
http_res = self.do_request(
|
|
593
|
+
hook_ctx=HookContext(
|
|
594
|
+
config=self.sdk_configuration,
|
|
595
|
+
base_url=base_url or "",
|
|
596
|
+
operation_id="updateInputById",
|
|
597
|
+
oauth2_scopes=[],
|
|
598
|
+
security_source=get_security_from_env(
|
|
599
|
+
self.sdk_configuration.security, models.Security
|
|
600
|
+
),
|
|
601
|
+
),
|
|
602
|
+
request=req,
|
|
603
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
604
|
+
retry_config=retry_config,
|
|
605
|
+
)
|
|
606
|
+
|
|
607
|
+
response_data: Any = None
|
|
608
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
609
|
+
return unmarshal_json_response(models.UpdateInputByIDResponse, http_res)
|
|
610
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
611
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
612
|
+
raise errors.Error(response_data, http_res)
|
|
613
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
614
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
615
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
616
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
617
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
618
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
619
|
+
|
|
620
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
621
|
+
|
|
622
|
+
async def update_source_by_id_async(
|
|
623
|
+
self,
|
|
624
|
+
*,
|
|
625
|
+
id: str,
|
|
626
|
+
input_: Union[models.Input, models.InputTypedDict],
|
|
627
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
628
|
+
server_url: Optional[str] = None,
|
|
629
|
+
timeout_ms: Optional[int] = None,
|
|
630
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
631
|
+
) -> models.UpdateInputByIDResponse:
|
|
632
|
+
r"""Update Source
|
|
633
|
+
|
|
634
|
+
Update Source
|
|
635
|
+
|
|
636
|
+
:param id: Unique ID to PATCH
|
|
637
|
+
:param input: Source object to be updated
|
|
638
|
+
:param retries: Override the default retry configuration for this method
|
|
639
|
+
:param server_url: Override the default server URL for this method
|
|
640
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
641
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
642
|
+
"""
|
|
643
|
+
base_url = None
|
|
644
|
+
url_variables = None
|
|
645
|
+
if timeout_ms is None:
|
|
646
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
647
|
+
|
|
648
|
+
if server_url is not None:
|
|
649
|
+
base_url = server_url
|
|
650
|
+
else:
|
|
651
|
+
base_url = self._get_url(base_url, url_variables)
|
|
652
|
+
|
|
653
|
+
request = models.UpdateInputByIDRequest(
|
|
654
|
+
id=id,
|
|
655
|
+
input=utils.get_pydantic_model(input_, models.Input),
|
|
656
|
+
)
|
|
657
|
+
|
|
658
|
+
req = self._build_request_async(
|
|
659
|
+
method="PATCH",
|
|
660
|
+
path="/system/inputs/{id}",
|
|
661
|
+
base_url=base_url,
|
|
662
|
+
url_variables=url_variables,
|
|
663
|
+
request=request,
|
|
664
|
+
request_body_required=True,
|
|
665
|
+
request_has_path_params=True,
|
|
666
|
+
request_has_query_params=True,
|
|
667
|
+
user_agent_header="user-agent",
|
|
668
|
+
accept_header_value="application/json",
|
|
669
|
+
http_headers=http_headers,
|
|
670
|
+
security=self.sdk_configuration.security,
|
|
671
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
672
|
+
request.input, False, False, "json", models.Input
|
|
673
|
+
),
|
|
674
|
+
timeout_ms=timeout_ms,
|
|
675
|
+
)
|
|
676
|
+
|
|
677
|
+
if retries == UNSET:
|
|
678
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
679
|
+
retries = self.sdk_configuration.retry_config
|
|
680
|
+
|
|
681
|
+
retry_config = None
|
|
682
|
+
if isinstance(retries, utils.RetryConfig):
|
|
683
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
684
|
+
|
|
685
|
+
http_res = await self.do_request_async(
|
|
686
|
+
hook_ctx=HookContext(
|
|
687
|
+
config=self.sdk_configuration,
|
|
688
|
+
base_url=base_url or "",
|
|
689
|
+
operation_id="updateInputById",
|
|
690
|
+
oauth2_scopes=[],
|
|
691
|
+
security_source=get_security_from_env(
|
|
692
|
+
self.sdk_configuration.security, models.Security
|
|
693
|
+
),
|
|
694
|
+
),
|
|
695
|
+
request=req,
|
|
696
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
697
|
+
retry_config=retry_config,
|
|
698
|
+
)
|
|
699
|
+
|
|
700
|
+
response_data: Any = None
|
|
701
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
702
|
+
return unmarshal_json_response(models.UpdateInputByIDResponse, http_res)
|
|
703
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
704
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
705
|
+
raise errors.Error(response_data, http_res)
|
|
706
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
707
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
708
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
709
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
710
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
711
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
712
|
+
|
|
713
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
714
|
+
|
|
715
|
+
def delete_source_by_id(
|
|
716
|
+
self,
|
|
717
|
+
*,
|
|
718
|
+
id: str,
|
|
719
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
720
|
+
server_url: Optional[str] = None,
|
|
721
|
+
timeout_ms: Optional[int] = None,
|
|
722
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
723
|
+
) -> models.DeleteInputByIDResponse:
|
|
724
|
+
r"""Delete Source
|
|
725
|
+
|
|
726
|
+
Delete Source
|
|
727
|
+
|
|
728
|
+
:param id: Unique ID to DELETE
|
|
729
|
+
:param retries: Override the default retry configuration for this method
|
|
730
|
+
:param server_url: Override the default server URL for this method
|
|
731
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
732
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
733
|
+
"""
|
|
734
|
+
base_url = None
|
|
735
|
+
url_variables = None
|
|
736
|
+
if timeout_ms is None:
|
|
737
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
738
|
+
|
|
739
|
+
if server_url is not None:
|
|
740
|
+
base_url = server_url
|
|
741
|
+
else:
|
|
742
|
+
base_url = self._get_url(base_url, url_variables)
|
|
743
|
+
|
|
744
|
+
request = models.DeleteInputByIDRequest(
|
|
745
|
+
id=id,
|
|
746
|
+
)
|
|
747
|
+
|
|
748
|
+
req = self._build_request(
|
|
749
|
+
method="DELETE",
|
|
750
|
+
path="/system/inputs/{id}",
|
|
751
|
+
base_url=base_url,
|
|
752
|
+
url_variables=url_variables,
|
|
753
|
+
request=request,
|
|
754
|
+
request_body_required=False,
|
|
755
|
+
request_has_path_params=True,
|
|
756
|
+
request_has_query_params=True,
|
|
757
|
+
user_agent_header="user-agent",
|
|
758
|
+
accept_header_value="application/json",
|
|
759
|
+
http_headers=http_headers,
|
|
760
|
+
security=self.sdk_configuration.security,
|
|
761
|
+
timeout_ms=timeout_ms,
|
|
762
|
+
)
|
|
763
|
+
|
|
764
|
+
if retries == UNSET:
|
|
765
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
766
|
+
retries = self.sdk_configuration.retry_config
|
|
767
|
+
|
|
768
|
+
retry_config = None
|
|
769
|
+
if isinstance(retries, utils.RetryConfig):
|
|
770
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
771
|
+
|
|
772
|
+
http_res = self.do_request(
|
|
773
|
+
hook_ctx=HookContext(
|
|
774
|
+
config=self.sdk_configuration,
|
|
775
|
+
base_url=base_url or "",
|
|
776
|
+
operation_id="deleteInputById",
|
|
777
|
+
oauth2_scopes=[],
|
|
778
|
+
security_source=get_security_from_env(
|
|
779
|
+
self.sdk_configuration.security, models.Security
|
|
780
|
+
),
|
|
781
|
+
),
|
|
782
|
+
request=req,
|
|
783
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
784
|
+
retry_config=retry_config,
|
|
785
|
+
)
|
|
786
|
+
|
|
787
|
+
response_data: Any = None
|
|
788
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
789
|
+
return unmarshal_json_response(models.DeleteInputByIDResponse, http_res)
|
|
790
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
791
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
792
|
+
raise errors.Error(response_data, http_res)
|
|
793
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
794
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
795
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
796
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
797
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
798
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
799
|
+
|
|
800
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
801
|
+
|
|
802
|
+
async def delete_source_by_id_async(
|
|
803
|
+
self,
|
|
804
|
+
*,
|
|
805
|
+
id: str,
|
|
806
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
807
|
+
server_url: Optional[str] = None,
|
|
808
|
+
timeout_ms: Optional[int] = None,
|
|
809
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
810
|
+
) -> models.DeleteInputByIDResponse:
|
|
811
|
+
r"""Delete Source
|
|
812
|
+
|
|
813
|
+
Delete Source
|
|
814
|
+
|
|
815
|
+
:param id: Unique ID to DELETE
|
|
816
|
+
:param retries: Override the default retry configuration for this method
|
|
817
|
+
:param server_url: Override the default server URL for this method
|
|
818
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
819
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
820
|
+
"""
|
|
821
|
+
base_url = None
|
|
822
|
+
url_variables = None
|
|
823
|
+
if timeout_ms is None:
|
|
824
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
825
|
+
|
|
826
|
+
if server_url is not None:
|
|
827
|
+
base_url = server_url
|
|
828
|
+
else:
|
|
829
|
+
base_url = self._get_url(base_url, url_variables)
|
|
830
|
+
|
|
831
|
+
request = models.DeleteInputByIDRequest(
|
|
832
|
+
id=id,
|
|
833
|
+
)
|
|
834
|
+
|
|
835
|
+
req = self._build_request_async(
|
|
836
|
+
method="DELETE",
|
|
837
|
+
path="/system/inputs/{id}",
|
|
838
|
+
base_url=base_url,
|
|
839
|
+
url_variables=url_variables,
|
|
840
|
+
request=request,
|
|
841
|
+
request_body_required=False,
|
|
842
|
+
request_has_path_params=True,
|
|
843
|
+
request_has_query_params=True,
|
|
844
|
+
user_agent_header="user-agent",
|
|
845
|
+
accept_header_value="application/json",
|
|
846
|
+
http_headers=http_headers,
|
|
847
|
+
security=self.sdk_configuration.security,
|
|
848
|
+
timeout_ms=timeout_ms,
|
|
849
|
+
)
|
|
850
|
+
|
|
851
|
+
if retries == UNSET:
|
|
852
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
853
|
+
retries = self.sdk_configuration.retry_config
|
|
854
|
+
|
|
855
|
+
retry_config = None
|
|
856
|
+
if isinstance(retries, utils.RetryConfig):
|
|
857
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
858
|
+
|
|
859
|
+
http_res = await self.do_request_async(
|
|
860
|
+
hook_ctx=HookContext(
|
|
861
|
+
config=self.sdk_configuration,
|
|
862
|
+
base_url=base_url or "",
|
|
863
|
+
operation_id="deleteInputById",
|
|
864
|
+
oauth2_scopes=[],
|
|
865
|
+
security_source=get_security_from_env(
|
|
866
|
+
self.sdk_configuration.security, models.Security
|
|
867
|
+
),
|
|
868
|
+
),
|
|
869
|
+
request=req,
|
|
870
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
871
|
+
retry_config=retry_config,
|
|
872
|
+
)
|
|
873
|
+
|
|
874
|
+
response_data: Any = None
|
|
875
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
876
|
+
return unmarshal_json_response(models.DeleteInputByIDResponse, http_res)
|
|
877
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
878
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
879
|
+
raise errors.Error(response_data, http_res)
|
|
880
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
881
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
882
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
883
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
884
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
885
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
886
|
+
|
|
887
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
888
|
+
|
|
889
|
+
def create_source_hec_token_by_id(
|
|
890
|
+
self,
|
|
891
|
+
*,
|
|
892
|
+
id: str,
|
|
893
|
+
token: str,
|
|
894
|
+
description: Optional[str] = None,
|
|
895
|
+
enabled: Optional[bool] = None,
|
|
896
|
+
metadata: Optional[
|
|
897
|
+
Union[
|
|
898
|
+
List[models.AddHecTokenRequestMetadatum],
|
|
899
|
+
List[models.AddHecTokenRequestMetadatumTypedDict],
|
|
900
|
+
]
|
|
901
|
+
] = None,
|
|
902
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
903
|
+
server_url: Optional[str] = None,
|
|
904
|
+
timeout_ms: Optional[int] = None,
|
|
905
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
906
|
+
) -> models.CreateInputHecTokenByIDResponse:
|
|
907
|
+
r"""Add token and optional metadata to an existing HEC Source
|
|
908
|
+
|
|
909
|
+
Add token and optional metadata to an existing HEC Source
|
|
910
|
+
|
|
911
|
+
:param id: HEC Source id
|
|
912
|
+
:param token:
|
|
913
|
+
:param description:
|
|
914
|
+
:param enabled:
|
|
915
|
+
:param metadata:
|
|
916
|
+
:param retries: Override the default retry configuration for this method
|
|
917
|
+
:param server_url: Override the default server URL for this method
|
|
918
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
919
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
920
|
+
"""
|
|
921
|
+
base_url = None
|
|
922
|
+
url_variables = None
|
|
923
|
+
if timeout_ms is None:
|
|
924
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
925
|
+
|
|
926
|
+
if server_url is not None:
|
|
927
|
+
base_url = server_url
|
|
928
|
+
else:
|
|
929
|
+
base_url = self._get_url(base_url, url_variables)
|
|
930
|
+
|
|
931
|
+
request = models.CreateInputHecTokenByIDRequest(
|
|
932
|
+
id=id,
|
|
933
|
+
add_hec_token_request=models.AddHecTokenRequest(
|
|
934
|
+
description=description,
|
|
935
|
+
enabled=enabled,
|
|
936
|
+
metadata=utils.get_pydantic_model(
|
|
937
|
+
metadata, Optional[List[models.AddHecTokenRequestMetadatum]]
|
|
938
|
+
),
|
|
939
|
+
token=token,
|
|
940
|
+
),
|
|
941
|
+
)
|
|
942
|
+
|
|
943
|
+
req = self._build_request(
|
|
944
|
+
method="POST",
|
|
945
|
+
path="/system/inputs/{id}/hectoken",
|
|
946
|
+
base_url=base_url,
|
|
947
|
+
url_variables=url_variables,
|
|
948
|
+
request=request,
|
|
949
|
+
request_body_required=True,
|
|
950
|
+
request_has_path_params=True,
|
|
951
|
+
request_has_query_params=True,
|
|
952
|
+
user_agent_header="user-agent",
|
|
953
|
+
accept_header_value="application/json",
|
|
954
|
+
http_headers=http_headers,
|
|
955
|
+
security=self.sdk_configuration.security,
|
|
956
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
957
|
+
request.add_hec_token_request,
|
|
958
|
+
False,
|
|
959
|
+
False,
|
|
960
|
+
"json",
|
|
961
|
+
models.AddHecTokenRequest,
|
|
962
|
+
),
|
|
963
|
+
timeout_ms=timeout_ms,
|
|
964
|
+
)
|
|
965
|
+
|
|
966
|
+
if retries == UNSET:
|
|
967
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
968
|
+
retries = self.sdk_configuration.retry_config
|
|
969
|
+
|
|
970
|
+
retry_config = None
|
|
971
|
+
if isinstance(retries, utils.RetryConfig):
|
|
972
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
973
|
+
|
|
974
|
+
http_res = self.do_request(
|
|
975
|
+
hook_ctx=HookContext(
|
|
976
|
+
config=self.sdk_configuration,
|
|
977
|
+
base_url=base_url or "",
|
|
978
|
+
operation_id="createInputHecTokenById",
|
|
979
|
+
oauth2_scopes=[],
|
|
980
|
+
security_source=get_security_from_env(
|
|
981
|
+
self.sdk_configuration.security, models.Security
|
|
982
|
+
),
|
|
983
|
+
),
|
|
984
|
+
request=req,
|
|
985
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
986
|
+
retry_config=retry_config,
|
|
987
|
+
)
|
|
988
|
+
|
|
989
|
+
response_data: Any = None
|
|
990
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
991
|
+
return unmarshal_json_response(
|
|
992
|
+
models.CreateInputHecTokenByIDResponse, http_res
|
|
993
|
+
)
|
|
994
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
995
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
996
|
+
raise errors.Error(response_data, http_res)
|
|
997
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
998
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
999
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1000
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1001
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1002
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1003
|
+
|
|
1004
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1005
|
+
|
|
1006
|
+
async def create_source_hec_token_by_id_async(
|
|
1007
|
+
self,
|
|
1008
|
+
*,
|
|
1009
|
+
id: str,
|
|
1010
|
+
token: str,
|
|
1011
|
+
description: Optional[str] = None,
|
|
1012
|
+
enabled: Optional[bool] = None,
|
|
1013
|
+
metadata: Optional[
|
|
1014
|
+
Union[
|
|
1015
|
+
List[models.AddHecTokenRequestMetadatum],
|
|
1016
|
+
List[models.AddHecTokenRequestMetadatumTypedDict],
|
|
1017
|
+
]
|
|
1018
|
+
] = None,
|
|
1019
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1020
|
+
server_url: Optional[str] = None,
|
|
1021
|
+
timeout_ms: Optional[int] = None,
|
|
1022
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1023
|
+
) -> models.CreateInputHecTokenByIDResponse:
|
|
1024
|
+
r"""Add token and optional metadata to an existing HEC Source
|
|
1025
|
+
|
|
1026
|
+
Add token and optional metadata to an existing HEC Source
|
|
1027
|
+
|
|
1028
|
+
:param id: HEC Source id
|
|
1029
|
+
:param token:
|
|
1030
|
+
:param description:
|
|
1031
|
+
:param enabled:
|
|
1032
|
+
:param metadata:
|
|
1033
|
+
:param retries: Override the default retry configuration for this method
|
|
1034
|
+
:param server_url: Override the default server URL for this method
|
|
1035
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1036
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1037
|
+
"""
|
|
1038
|
+
base_url = None
|
|
1039
|
+
url_variables = None
|
|
1040
|
+
if timeout_ms is None:
|
|
1041
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1042
|
+
|
|
1043
|
+
if server_url is not None:
|
|
1044
|
+
base_url = server_url
|
|
1045
|
+
else:
|
|
1046
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1047
|
+
|
|
1048
|
+
request = models.CreateInputHecTokenByIDRequest(
|
|
1049
|
+
id=id,
|
|
1050
|
+
add_hec_token_request=models.AddHecTokenRequest(
|
|
1051
|
+
description=description,
|
|
1052
|
+
enabled=enabled,
|
|
1053
|
+
metadata=utils.get_pydantic_model(
|
|
1054
|
+
metadata, Optional[List[models.AddHecTokenRequestMetadatum]]
|
|
1055
|
+
),
|
|
1056
|
+
token=token,
|
|
1057
|
+
),
|
|
1058
|
+
)
|
|
1059
|
+
|
|
1060
|
+
req = self._build_request_async(
|
|
1061
|
+
method="POST",
|
|
1062
|
+
path="/system/inputs/{id}/hectoken",
|
|
1063
|
+
base_url=base_url,
|
|
1064
|
+
url_variables=url_variables,
|
|
1065
|
+
request=request,
|
|
1066
|
+
request_body_required=True,
|
|
1067
|
+
request_has_path_params=True,
|
|
1068
|
+
request_has_query_params=True,
|
|
1069
|
+
user_agent_header="user-agent",
|
|
1070
|
+
accept_header_value="application/json",
|
|
1071
|
+
http_headers=http_headers,
|
|
1072
|
+
security=self.sdk_configuration.security,
|
|
1073
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1074
|
+
request.add_hec_token_request,
|
|
1075
|
+
False,
|
|
1076
|
+
False,
|
|
1077
|
+
"json",
|
|
1078
|
+
models.AddHecTokenRequest,
|
|
1079
|
+
),
|
|
1080
|
+
timeout_ms=timeout_ms,
|
|
1081
|
+
)
|
|
1082
|
+
|
|
1083
|
+
if retries == UNSET:
|
|
1084
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1085
|
+
retries = self.sdk_configuration.retry_config
|
|
1086
|
+
|
|
1087
|
+
retry_config = None
|
|
1088
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1089
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1090
|
+
|
|
1091
|
+
http_res = await self.do_request_async(
|
|
1092
|
+
hook_ctx=HookContext(
|
|
1093
|
+
config=self.sdk_configuration,
|
|
1094
|
+
base_url=base_url or "",
|
|
1095
|
+
operation_id="createInputHecTokenById",
|
|
1096
|
+
oauth2_scopes=[],
|
|
1097
|
+
security_source=get_security_from_env(
|
|
1098
|
+
self.sdk_configuration.security, models.Security
|
|
1099
|
+
),
|
|
1100
|
+
),
|
|
1101
|
+
request=req,
|
|
1102
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
1103
|
+
retry_config=retry_config,
|
|
1104
|
+
)
|
|
1105
|
+
|
|
1106
|
+
response_data: Any = None
|
|
1107
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1108
|
+
return unmarshal_json_response(
|
|
1109
|
+
models.CreateInputHecTokenByIDResponse, http_res
|
|
1110
|
+
)
|
|
1111
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1112
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
1113
|
+
raise errors.Error(response_data, http_res)
|
|
1114
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
1115
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1116
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1117
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1118
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1119
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1120
|
+
|
|
1121
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1122
|
+
|
|
1123
|
+
def update_source_hec_token_by_id_and_token(
|
|
1124
|
+
self,
|
|
1125
|
+
*,
|
|
1126
|
+
id: str,
|
|
1127
|
+
token: str,
|
|
1128
|
+
description: Optional[str] = None,
|
|
1129
|
+
enabled: Optional[bool] = None,
|
|
1130
|
+
metadata: Optional[
|
|
1131
|
+
Union[
|
|
1132
|
+
List[models.UpdateHecTokenRequestMetadatum],
|
|
1133
|
+
List[models.UpdateHecTokenRequestMetadatumTypedDict],
|
|
1134
|
+
]
|
|
1135
|
+
] = None,
|
|
1136
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1137
|
+
server_url: Optional[str] = None,
|
|
1138
|
+
timeout_ms: Optional[int] = None,
|
|
1139
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1140
|
+
) -> models.UpdateInputHecTokenByIDAndTokenResponse:
|
|
1141
|
+
r"""Update token metadata on existing HEC Source
|
|
1142
|
+
|
|
1143
|
+
Update token metadata on existing HEC Source
|
|
1144
|
+
|
|
1145
|
+
:param id: HEC Source id
|
|
1146
|
+
:param token: token to update
|
|
1147
|
+
:param description:
|
|
1148
|
+
:param enabled:
|
|
1149
|
+
:param metadata:
|
|
1150
|
+
:param retries: Override the default retry configuration for this method
|
|
1151
|
+
:param server_url: Override the default server URL for this method
|
|
1152
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1153
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1154
|
+
"""
|
|
1155
|
+
base_url = None
|
|
1156
|
+
url_variables = None
|
|
1157
|
+
if timeout_ms is None:
|
|
1158
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1159
|
+
|
|
1160
|
+
if server_url is not None:
|
|
1161
|
+
base_url = server_url
|
|
1162
|
+
else:
|
|
1163
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1164
|
+
|
|
1165
|
+
request = models.UpdateInputHecTokenByIDAndTokenRequest(
|
|
1166
|
+
id=id,
|
|
1167
|
+
token=token,
|
|
1168
|
+
update_hec_token_request=models.UpdateHecTokenRequest(
|
|
1169
|
+
description=description,
|
|
1170
|
+
enabled=enabled,
|
|
1171
|
+
metadata=utils.get_pydantic_model(
|
|
1172
|
+
metadata, Optional[List[models.UpdateHecTokenRequestMetadatum]]
|
|
1173
|
+
),
|
|
1174
|
+
),
|
|
1175
|
+
)
|
|
1176
|
+
|
|
1177
|
+
req = self._build_request(
|
|
1178
|
+
method="PATCH",
|
|
1179
|
+
path="/system/inputs/{id}/hectoken/{token}",
|
|
1180
|
+
base_url=base_url,
|
|
1181
|
+
url_variables=url_variables,
|
|
1182
|
+
request=request,
|
|
1183
|
+
request_body_required=True,
|
|
1184
|
+
request_has_path_params=True,
|
|
1185
|
+
request_has_query_params=True,
|
|
1186
|
+
user_agent_header="user-agent",
|
|
1187
|
+
accept_header_value="application/json",
|
|
1188
|
+
http_headers=http_headers,
|
|
1189
|
+
security=self.sdk_configuration.security,
|
|
1190
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1191
|
+
request.update_hec_token_request,
|
|
1192
|
+
False,
|
|
1193
|
+
False,
|
|
1194
|
+
"json",
|
|
1195
|
+
models.UpdateHecTokenRequest,
|
|
1196
|
+
),
|
|
1197
|
+
timeout_ms=timeout_ms,
|
|
1198
|
+
)
|
|
1199
|
+
|
|
1200
|
+
if retries == UNSET:
|
|
1201
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1202
|
+
retries = self.sdk_configuration.retry_config
|
|
1203
|
+
|
|
1204
|
+
retry_config = None
|
|
1205
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1206
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1207
|
+
|
|
1208
|
+
http_res = self.do_request(
|
|
1209
|
+
hook_ctx=HookContext(
|
|
1210
|
+
config=self.sdk_configuration,
|
|
1211
|
+
base_url=base_url or "",
|
|
1212
|
+
operation_id="updateInputHecTokenByIdAndToken",
|
|
1213
|
+
oauth2_scopes=[],
|
|
1214
|
+
security_source=get_security_from_env(
|
|
1215
|
+
self.sdk_configuration.security, models.Security
|
|
1216
|
+
),
|
|
1217
|
+
),
|
|
1218
|
+
request=req,
|
|
1219
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
1220
|
+
retry_config=retry_config,
|
|
1221
|
+
)
|
|
1222
|
+
|
|
1223
|
+
response_data: Any = None
|
|
1224
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1225
|
+
return unmarshal_json_response(
|
|
1226
|
+
models.UpdateInputHecTokenByIDAndTokenResponse, http_res
|
|
1227
|
+
)
|
|
1228
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1229
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
1230
|
+
raise errors.Error(response_data, http_res)
|
|
1231
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
1232
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1233
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1234
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1235
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1236
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1237
|
+
|
|
1238
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1239
|
+
|
|
1240
|
+
async def update_source_hec_token_by_id_and_token_async(
|
|
1241
|
+
self,
|
|
1242
|
+
*,
|
|
1243
|
+
id: str,
|
|
1244
|
+
token: str,
|
|
1245
|
+
description: Optional[str] = None,
|
|
1246
|
+
enabled: Optional[bool] = None,
|
|
1247
|
+
metadata: Optional[
|
|
1248
|
+
Union[
|
|
1249
|
+
List[models.UpdateHecTokenRequestMetadatum],
|
|
1250
|
+
List[models.UpdateHecTokenRequestMetadatumTypedDict],
|
|
1251
|
+
]
|
|
1252
|
+
] = None,
|
|
1253
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1254
|
+
server_url: Optional[str] = None,
|
|
1255
|
+
timeout_ms: Optional[int] = None,
|
|
1256
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1257
|
+
) -> models.UpdateInputHecTokenByIDAndTokenResponse:
|
|
1258
|
+
r"""Update token metadata on existing HEC Source
|
|
1259
|
+
|
|
1260
|
+
Update token metadata on existing HEC Source
|
|
1261
|
+
|
|
1262
|
+
:param id: HEC Source id
|
|
1263
|
+
:param token: token to update
|
|
1264
|
+
:param description:
|
|
1265
|
+
:param enabled:
|
|
1266
|
+
:param metadata:
|
|
1267
|
+
:param retries: Override the default retry configuration for this method
|
|
1268
|
+
:param server_url: Override the default server URL for this method
|
|
1269
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1270
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1271
|
+
"""
|
|
1272
|
+
base_url = None
|
|
1273
|
+
url_variables = None
|
|
1274
|
+
if timeout_ms is None:
|
|
1275
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1276
|
+
|
|
1277
|
+
if server_url is not None:
|
|
1278
|
+
base_url = server_url
|
|
1279
|
+
else:
|
|
1280
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1281
|
+
|
|
1282
|
+
request = models.UpdateInputHecTokenByIDAndTokenRequest(
|
|
1283
|
+
id=id,
|
|
1284
|
+
token=token,
|
|
1285
|
+
update_hec_token_request=models.UpdateHecTokenRequest(
|
|
1286
|
+
description=description,
|
|
1287
|
+
enabled=enabled,
|
|
1288
|
+
metadata=utils.get_pydantic_model(
|
|
1289
|
+
metadata, Optional[List[models.UpdateHecTokenRequestMetadatum]]
|
|
1290
|
+
),
|
|
1291
|
+
),
|
|
1292
|
+
)
|
|
1293
|
+
|
|
1294
|
+
req = self._build_request_async(
|
|
1295
|
+
method="PATCH",
|
|
1296
|
+
path="/system/inputs/{id}/hectoken/{token}",
|
|
1297
|
+
base_url=base_url,
|
|
1298
|
+
url_variables=url_variables,
|
|
1299
|
+
request=request,
|
|
1300
|
+
request_body_required=True,
|
|
1301
|
+
request_has_path_params=True,
|
|
1302
|
+
request_has_query_params=True,
|
|
1303
|
+
user_agent_header="user-agent",
|
|
1304
|
+
accept_header_value="application/json",
|
|
1305
|
+
http_headers=http_headers,
|
|
1306
|
+
security=self.sdk_configuration.security,
|
|
1307
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1308
|
+
request.update_hec_token_request,
|
|
1309
|
+
False,
|
|
1310
|
+
False,
|
|
1311
|
+
"json",
|
|
1312
|
+
models.UpdateHecTokenRequest,
|
|
1313
|
+
),
|
|
1314
|
+
timeout_ms=timeout_ms,
|
|
1315
|
+
)
|
|
1316
|
+
|
|
1317
|
+
if retries == UNSET:
|
|
1318
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1319
|
+
retries = self.sdk_configuration.retry_config
|
|
1320
|
+
|
|
1321
|
+
retry_config = None
|
|
1322
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1323
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1324
|
+
|
|
1325
|
+
http_res = await self.do_request_async(
|
|
1326
|
+
hook_ctx=HookContext(
|
|
1327
|
+
config=self.sdk_configuration,
|
|
1328
|
+
base_url=base_url or "",
|
|
1329
|
+
operation_id="updateInputHecTokenByIdAndToken",
|
|
1330
|
+
oauth2_scopes=[],
|
|
1331
|
+
security_source=get_security_from_env(
|
|
1332
|
+
self.sdk_configuration.security, models.Security
|
|
1333
|
+
),
|
|
1334
|
+
),
|
|
1335
|
+
request=req,
|
|
1336
|
+
error_status_codes=["401", "4XX", "500", "5XX"],
|
|
1337
|
+
retry_config=retry_config,
|
|
1338
|
+
)
|
|
1339
|
+
|
|
1340
|
+
response_data: Any = None
|
|
1341
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1342
|
+
return unmarshal_json_response(
|
|
1343
|
+
models.UpdateInputHecTokenByIDAndTokenResponse, http_res
|
|
1344
|
+
)
|
|
1345
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1346
|
+
response_data = unmarshal_json_response(errors.ErrorData, http_res)
|
|
1347
|
+
raise errors.Error(response_data, http_res)
|
|
1348
|
+
if utils.match_response(http_res, ["401", "4XX"], "*"):
|
|
1349
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1350
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1351
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1352
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1353
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1354
|
+
|
|
1355
|
+
raise errors.APIError("Unexpected response received", http_res)
|