Skip to content

Commit 331852a

Browse files
authored
Update to v0.10.3
2 parents b6f190b + 032ea95 commit 331852a

File tree

68 files changed

+2768
-4460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2768
-4460
lines changed

src/tuneinsight/api/sdk/api/api_datasource/get_data_source_config.py renamed to src/tuneinsight/api/sdk/api/api_datasource/get_data_source_command.py

+50-23
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,52 @@
55

66
from ... import errors
77
from ...client import Client
8-
from ...models.data_source_config import DataSourceConfig
8+
from ...models.data_source_command_result import DataSourceCommandResult
99
from ...models.error import Error
10-
from ...types import Response
10+
from ...types import UNSET, Response
1111

1212

1313
def _get_kwargs(
1414
data_source_id: str,
1515
*,
1616
client: Client,
17+
command: str,
1718
) -> Dict[str, Any]:
18-
url = "{}/datasources/{dataSourceId}/config".format(client.base_url, dataSourceId=data_source_id)
19+
url = "{}/datasources/{dataSourceId}/command".format(client.base_url, dataSourceId=data_source_id)
1920

2021
headers: Dict[str, str] = client.get_headers()
2122
cookies: Dict[str, Any] = client.get_cookies()
2223

24+
params: Dict[str, Any] = {}
25+
params["command"] = command
26+
27+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
28+
29+
# Set the proxies if the client has proxies set.
30+
proxies = None
31+
if hasattr(client, "proxies") and client.proxies is not None:
32+
https_proxy = client.proxies.get("https")
33+
if https_proxy:
34+
proxies = https_proxy
35+
else:
36+
http_proxy = client.proxies.get("http")
37+
if http_proxy:
38+
proxies = http_proxy
39+
2340
return {
2441
"method": "get",
2542
"url": url,
2643
"headers": headers,
2744
"cookies": cookies,
2845
"timeout": client.get_timeout(),
46+
"proxies": proxies,
47+
"params": params,
2948
}
3049

3150

32-
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[DataSourceConfig, Error]]:
51+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[DataSourceCommandResult, Error]]:
3352
if response.status_code == HTTPStatus.OK:
34-
response_200 = DataSourceConfig.from_dict(response.json())
53+
response_200 = DataSourceCommandResult.from_dict(response.json())
3554

3655
return response_200
3756
if response.status_code == HTTPStatus.BAD_REQUEST:
@@ -50,17 +69,13 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
5069
response_500 = Error.from_dict(response.json())
5170

5271
return response_500
53-
if response.status_code == HTTPStatus.NOT_IMPLEMENTED:
54-
response_501 = Error.from_dict(response.json())
55-
56-
return response_501
5772
if client.raise_on_unexpected_status:
58-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
73+
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code} ({response})")
5974
else:
6075
return None
6176

6277

63-
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[DataSourceConfig, Error]]:
78+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[DataSourceCommandResult, Error]]:
6479
return Response(
6580
status_code=HTTPStatus(response.status_code),
6681
content=response.content,
@@ -73,23 +88,26 @@ def sync_detailed(
7388
data_source_id: str,
7489
*,
7590
client: Client,
76-
) -> Response[Union[DataSourceConfig, Error]]:
77-
"""retrieve the data source config
91+
command: str,
92+
) -> Response[Union[DataSourceCommandResult, Error]]:
93+
"""Execute a data source's command (e.g. to fetch metadata).
7894
7995
Args:
8096
data_source_id (str):
97+
command (str):
8198
8299
Raises:
83100
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
84101
httpx.TimeoutException: If the request takes longer than Client.timeout.
85102
86103
Returns:
87-
Response[Union[DataSourceConfig, Error]]
104+
Response[Union[DataSourceCommandResult, Error]]
88105
"""
89106

90107
kwargs = _get_kwargs(
91108
data_source_id=data_source_id,
92109
client=client,
110+
command=command,
93111
)
94112

95113
response = httpx.request(
@@ -104,47 +122,53 @@ def sync(
104122
data_source_id: str,
105123
*,
106124
client: Client,
107-
) -> Optional[Union[DataSourceConfig, Error]]:
108-
"""retrieve the data source config
125+
command: str,
126+
) -> Optional[Union[DataSourceCommandResult, Error]]:
127+
"""Execute a data source's command (e.g. to fetch metadata).
109128
110129
Args:
111130
data_source_id (str):
131+
command (str):
112132
113133
Raises:
114134
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
115135
httpx.TimeoutException: If the request takes longer than Client.timeout.
116136
117137
Returns:
118-
Response[Union[DataSourceConfig, Error]]
138+
Response[Union[DataSourceCommandResult, Error]]
119139
"""
120140

121141
return sync_detailed(
122142
data_source_id=data_source_id,
123143
client=client,
144+
command=command,
124145
).parsed
125146

126147

127148
async def asyncio_detailed(
128149
data_source_id: str,
129150
*,
130151
client: Client,
131-
) -> Response[Union[DataSourceConfig, Error]]:
132-
"""retrieve the data source config
152+
command: str,
153+
) -> Response[Union[DataSourceCommandResult, Error]]:
154+
"""Execute a data source's command (e.g. to fetch metadata).
133155
134156
Args:
135157
data_source_id (str):
158+
command (str):
136159
137160
Raises:
138161
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
139162
httpx.TimeoutException: If the request takes longer than Client.timeout.
140163
141164
Returns:
142-
Response[Union[DataSourceConfig, Error]]
165+
Response[Union[DataSourceCommandResult, Error]]
143166
"""
144167

145168
kwargs = _get_kwargs(
146169
data_source_id=data_source_id,
147170
client=client,
171+
command=command,
148172
)
149173

150174
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
@@ -157,23 +181,26 @@ async def asyncio(
157181
data_source_id: str,
158182
*,
159183
client: Client,
160-
) -> Optional[Union[DataSourceConfig, Error]]:
161-
"""retrieve the data source config
184+
command: str,
185+
) -> Optional[Union[DataSourceCommandResult, Error]]:
186+
"""Execute a data source's command (e.g. to fetch metadata).
162187
163188
Args:
164189
data_source_id (str):
190+
command (str):
165191
166192
Raises:
167193
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
168194
httpx.TimeoutException: If the request takes longer than Client.timeout.
169195
170196
Returns:
171-
Response[Union[DataSourceConfig, Error]]
197+
Response[Union[DataSourceCommandResult, Error]]
172198
"""
173199

174200
return (
175201
await asyncio_detailed(
176202
data_source_id=data_source_id,
177203
client=client,
204+
command=command,
178205
)
179206
).parsed

0 commit comments

Comments
 (0)