sqlx
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/job_helpers/test_connection".format(workspace=workspace,),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" Test connection to the workspace datasets storage
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
|
||||
) -> Response[Any]:
|
||||
""" Test connection to the workspace datasets storage
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
file_key: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["file_key"] = file_key
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/w/{workspace}/job_helpers/delete_s3_file".format(workspace=workspace,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
file_key: str,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" Permanently delete file from S3
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
file_key (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
file_key=file_key,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
file_key: str,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" Permanently delete file from S3
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
file_key (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
file_key=file_key,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.duckdb_connection_settings_json_body import DuckdbConnectionSettingsJsonBody
|
||||
from ...models.duckdb_connection_settings_response_200 import DuckdbConnectionSettingsResponse200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
json_body: DuckdbConnectionSettingsJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/job_helpers/duckdb_connection_settings".format(workspace=workspace,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DuckdbConnectionSettingsResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = DuckdbConnectionSettingsResponse200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[DuckdbConnectionSettingsResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: DuckdbConnectionSettingsJsonBody,
|
||||
|
||||
) -> Response[DuckdbConnectionSettingsResponse200]:
|
||||
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (DuckdbConnectionSettingsJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[DuckdbConnectionSettingsResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: DuckdbConnectionSettingsJsonBody,
|
||||
|
||||
) -> Optional[DuckdbConnectionSettingsResponse200]:
|
||||
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (DuckdbConnectionSettingsJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
DuckdbConnectionSettingsResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: DuckdbConnectionSettingsJsonBody,
|
||||
|
||||
) -> Response[DuckdbConnectionSettingsResponse200]:
|
||||
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (DuckdbConnectionSettingsJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[DuckdbConnectionSettingsResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: DuckdbConnectionSettingsJsonBody,
|
||||
|
||||
) -> Optional[DuckdbConnectionSettingsResponse200]:
|
||||
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (DuckdbConnectionSettingsJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
DuckdbConnectionSettingsResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,189 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from ...models.duckdb_connection_settings_v2_json_body import DuckdbConnectionSettingsV2JsonBody
|
||||
from typing import Dict
|
||||
from ...models.duckdb_connection_settings_v2_response_200 import DuckdbConnectionSettingsV2Response200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
json_body: DuckdbConnectionSettingsV2JsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/job_helpers/v2/duckdb_connection_settings".format(workspace=workspace,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DuckdbConnectionSettingsV2Response200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = DuckdbConnectionSettingsV2Response200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[DuckdbConnectionSettingsV2Response200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: DuckdbConnectionSettingsV2JsonBody,
|
||||
|
||||
) -> Response[DuckdbConnectionSettingsV2Response200]:
|
||||
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (DuckdbConnectionSettingsV2JsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[DuckdbConnectionSettingsV2Response200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: DuckdbConnectionSettingsV2JsonBody,
|
||||
|
||||
) -> Optional[DuckdbConnectionSettingsV2Response200]:
|
||||
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (DuckdbConnectionSettingsV2JsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
DuckdbConnectionSettingsV2Response200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: DuckdbConnectionSettingsV2JsonBody,
|
||||
|
||||
) -> Response[DuckdbConnectionSettingsV2Response200]:
|
||||
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (DuckdbConnectionSettingsV2JsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[DuckdbConnectionSettingsV2Response200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: DuckdbConnectionSettingsV2JsonBody,
|
||||
|
||||
) -> Optional[DuckdbConnectionSettingsV2Response200]:
|
||||
""" Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (DuckdbConnectionSettingsV2JsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
DuckdbConnectionSettingsV2Response200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,211 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.list_stored_files_response_200 import ListStoredFilesResponse200
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
max_keys: int,
|
||||
marker: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["max_keys"] = max_keys
|
||||
|
||||
|
||||
params["marker"] = marker
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/job_helpers/list_stored_files".format(workspace=workspace,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ListStoredFilesResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = ListStoredFilesResponse200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ListStoredFilesResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
max_keys: int,
|
||||
marker: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[ListStoredFilesResponse200]:
|
||||
""" List the file keys available in the workspace files storage (S3)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
max_keys (int):
|
||||
marker (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ListStoredFilesResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
max_keys=max_keys,
|
||||
marker=marker,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
max_keys: int,
|
||||
marker: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Optional[ListStoredFilesResponse200]:
|
||||
""" List the file keys available in the workspace files storage (S3)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
max_keys (int):
|
||||
marker (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ListStoredFilesResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
max_keys=max_keys,
|
||||
marker=marker,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
max_keys: int,
|
||||
marker: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Response[ListStoredFilesResponse200]:
|
||||
""" List the file keys available in the workspace files storage (S3)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
max_keys (int):
|
||||
marker (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ListStoredFilesResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
max_keys=max_keys,
|
||||
marker=marker,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
max_keys: int,
|
||||
marker: Union[Unset, None, str] = UNSET,
|
||||
|
||||
) -> Optional[ListStoredFilesResponse200]:
|
||||
""" List the file keys available in the workspace files storage (S3)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
max_keys (int):
|
||||
marker (Union[Unset, None, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ListStoredFilesResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
max_keys=max_keys,
|
||||
marker=marker,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,192 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.load_file_metadata_response_200 import LoadFileMetadataResponse200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
file_key: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["file_key"] = file_key
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/job_helpers/load_file_metadata".format(workspace=workspace,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[LoadFileMetadataResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = LoadFileMetadataResponse200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[LoadFileMetadataResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
file_key: str,
|
||||
|
||||
) -> Response[LoadFileMetadataResponse200]:
|
||||
""" Load metadata of the file
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
file_key (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[LoadFileMetadataResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
file_key=file_key,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
file_key: str,
|
||||
|
||||
) -> Optional[LoadFileMetadataResponse200]:
|
||||
""" Load metadata of the file
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
file_key (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
LoadFileMetadataResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
file_key=file_key,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
file_key: str,
|
||||
|
||||
) -> Response[LoadFileMetadataResponse200]:
|
||||
""" Load metadata of the file
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
file_key (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[LoadFileMetadataResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
file_key=file_key,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
file_key: str,
|
||||
|
||||
) -> Optional[LoadFileMetadataResponse200]:
|
||||
""" Load metadata of the file
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
file_key (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
LoadFileMetadataResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
file_key=file_key,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,291 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import Union
|
||||
from typing import cast
|
||||
from ...models.load_file_preview_response_200 import LoadFilePreviewResponse200
|
||||
from typing import Dict
|
||||
from typing import Optional
|
||||
from ...types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
file_key: str,
|
||||
file_size_in_bytes: Union[Unset, None, int] = UNSET,
|
||||
file_mime_type: Union[Unset, None, str] = UNSET,
|
||||
csv_separator: Union[Unset, None, str] = UNSET,
|
||||
csv_has_header: Union[Unset, None, bool] = UNSET,
|
||||
read_bytes_from: Union[Unset, None, int] = UNSET,
|
||||
read_bytes_length: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["file_key"] = file_key
|
||||
|
||||
|
||||
params["file_size_in_bytes"] = file_size_in_bytes
|
||||
|
||||
|
||||
params["file_mime_type"] = file_mime_type
|
||||
|
||||
|
||||
params["csv_separator"] = csv_separator
|
||||
|
||||
|
||||
params["csv_has_header"] = csv_has_header
|
||||
|
||||
|
||||
params["read_bytes_from"] = read_bytes_from
|
||||
|
||||
|
||||
params["read_bytes_length"] = read_bytes_length
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/job_helpers/load_file_preview".format(workspace=workspace,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[LoadFilePreviewResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = LoadFilePreviewResponse200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[LoadFilePreviewResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
file_key: str,
|
||||
file_size_in_bytes: Union[Unset, None, int] = UNSET,
|
||||
file_mime_type: Union[Unset, None, str] = UNSET,
|
||||
csv_separator: Union[Unset, None, str] = UNSET,
|
||||
csv_has_header: Union[Unset, None, bool] = UNSET,
|
||||
read_bytes_from: Union[Unset, None, int] = UNSET,
|
||||
read_bytes_length: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Response[LoadFilePreviewResponse200]:
|
||||
""" Load a preview of the file
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
file_key (str):
|
||||
file_size_in_bytes (Union[Unset, None, int]):
|
||||
file_mime_type (Union[Unset, None, str]):
|
||||
csv_separator (Union[Unset, None, str]):
|
||||
csv_has_header (Union[Unset, None, bool]):
|
||||
read_bytes_from (Union[Unset, None, int]):
|
||||
read_bytes_length (Union[Unset, None, int]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[LoadFilePreviewResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
file_key=file_key,
|
||||
file_size_in_bytes=file_size_in_bytes,
|
||||
file_mime_type=file_mime_type,
|
||||
csv_separator=csv_separator,
|
||||
csv_has_header=csv_has_header,
|
||||
read_bytes_from=read_bytes_from,
|
||||
read_bytes_length=read_bytes_length,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
file_key: str,
|
||||
file_size_in_bytes: Union[Unset, None, int] = UNSET,
|
||||
file_mime_type: Union[Unset, None, str] = UNSET,
|
||||
csv_separator: Union[Unset, None, str] = UNSET,
|
||||
csv_has_header: Union[Unset, None, bool] = UNSET,
|
||||
read_bytes_from: Union[Unset, None, int] = UNSET,
|
||||
read_bytes_length: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Optional[LoadFilePreviewResponse200]:
|
||||
""" Load a preview of the file
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
file_key (str):
|
||||
file_size_in_bytes (Union[Unset, None, int]):
|
||||
file_mime_type (Union[Unset, None, str]):
|
||||
csv_separator (Union[Unset, None, str]):
|
||||
csv_has_header (Union[Unset, None, bool]):
|
||||
read_bytes_from (Union[Unset, None, int]):
|
||||
read_bytes_length (Union[Unset, None, int]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
LoadFilePreviewResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
file_key=file_key,
|
||||
file_size_in_bytes=file_size_in_bytes,
|
||||
file_mime_type=file_mime_type,
|
||||
csv_separator=csv_separator,
|
||||
csv_has_header=csv_has_header,
|
||||
read_bytes_from=read_bytes_from,
|
||||
read_bytes_length=read_bytes_length,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
file_key: str,
|
||||
file_size_in_bytes: Union[Unset, None, int] = UNSET,
|
||||
file_mime_type: Union[Unset, None, str] = UNSET,
|
||||
csv_separator: Union[Unset, None, str] = UNSET,
|
||||
csv_has_header: Union[Unset, None, bool] = UNSET,
|
||||
read_bytes_from: Union[Unset, None, int] = UNSET,
|
||||
read_bytes_length: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Response[LoadFilePreviewResponse200]:
|
||||
""" Load a preview of the file
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
file_key (str):
|
||||
file_size_in_bytes (Union[Unset, None, int]):
|
||||
file_mime_type (Union[Unset, None, str]):
|
||||
csv_separator (Union[Unset, None, str]):
|
||||
csv_has_header (Union[Unset, None, bool]):
|
||||
read_bytes_from (Union[Unset, None, int]):
|
||||
read_bytes_length (Union[Unset, None, int]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[LoadFilePreviewResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
file_key=file_key,
|
||||
file_size_in_bytes=file_size_in_bytes,
|
||||
file_mime_type=file_mime_type,
|
||||
csv_separator=csv_separator,
|
||||
csv_has_header=csv_has_header,
|
||||
read_bytes_from=read_bytes_from,
|
||||
read_bytes_length=read_bytes_length,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
file_key: str,
|
||||
file_size_in_bytes: Union[Unset, None, int] = UNSET,
|
||||
file_mime_type: Union[Unset, None, str] = UNSET,
|
||||
csv_separator: Union[Unset, None, str] = UNSET,
|
||||
csv_has_header: Union[Unset, None, bool] = UNSET,
|
||||
read_bytes_from: Union[Unset, None, int] = UNSET,
|
||||
read_bytes_length: Union[Unset, None, int] = UNSET,
|
||||
|
||||
) -> Optional[LoadFilePreviewResponse200]:
|
||||
""" Load a preview of the file
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
file_key (str):
|
||||
file_size_in_bytes (Union[Unset, None, int]):
|
||||
file_mime_type (Union[Unset, None, str]):
|
||||
csv_separator (Union[Unset, None, str]):
|
||||
csv_has_header (Union[Unset, None, bool]):
|
||||
read_bytes_from (Union[Unset, None, int]):
|
||||
read_bytes_length (Union[Unset, None, int]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
LoadFilePreviewResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
file_key=file_key,
|
||||
file_size_in_bytes=file_size_in_bytes,
|
||||
file_mime_type=file_mime_type,
|
||||
csv_separator=csv_separator,
|
||||
csv_has_header=csv_has_header,
|
||||
read_bytes_from=read_bytes_from,
|
||||
read_bytes_length=read_bytes_length,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,139 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
src_file_key: str,
|
||||
dest_file_key: str,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["src_file_key"] = src_file_key
|
||||
|
||||
|
||||
params["dest_file_key"] = dest_file_key
|
||||
|
||||
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/w/{workspace}/job_helpers/move_s3_file".format(workspace=workspace,),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
src_file_key: str,
|
||||
dest_file_key: str,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" Move a S3 file from one path to the other within the same bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
src_file_key (str):
|
||||
dest_file_key (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
src_file_key=src_file_key,
|
||||
dest_file_key=dest_file_key,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
src_file_key: str,
|
||||
dest_file_key: str,
|
||||
|
||||
) -> Response[Any]:
|
||||
""" Move a S3 file from one path to the other within the same bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
src_file_key (str):
|
||||
dest_file_key (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
src_file_key=src_file_key,
|
||||
dest_file_key=dest_file_key,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from ...models.multipart_file_upload_response_200 import MultipartFileUploadResponse200
|
||||
from typing import Dict
|
||||
from ...models.multipart_file_upload_json_body import MultipartFileUploadJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
json_body: MultipartFileUploadJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/job_helpers/multipart_upload_s3_file".format(workspace=workspace,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[MultipartFileUploadResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = MultipartFileUploadResponse200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[MultipartFileUploadResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: MultipartFileUploadJsonBody,
|
||||
|
||||
) -> Response[MultipartFileUploadResponse200]:
|
||||
""" Upload file to S3 bucket using multipart upload
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (MultipartFileUploadJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[MultipartFileUploadResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: MultipartFileUploadJsonBody,
|
||||
|
||||
) -> Optional[MultipartFileUploadResponse200]:
|
||||
""" Upload file to S3 bucket using multipart upload
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (MultipartFileUploadJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
MultipartFileUploadResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: MultipartFileUploadJsonBody,
|
||||
|
||||
) -> Response[MultipartFileUploadResponse200]:
|
||||
""" Upload file to S3 bucket using multipart upload
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (MultipartFileUploadJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[MultipartFileUploadResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: MultipartFileUploadJsonBody,
|
||||
|
||||
) -> Optional[MultipartFileUploadResponse200]:
|
||||
""" Upload file to S3 bucket using multipart upload
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (MultipartFileUploadJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
MultipartFileUploadResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,189 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.polars_connection_settings_json_body import PolarsConnectionSettingsJsonBody
|
||||
from ...models.polars_connection_settings_response_200 import PolarsConnectionSettingsResponse200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
json_body: PolarsConnectionSettingsJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/job_helpers/polars_connection_settings".format(workspace=workspace,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PolarsConnectionSettingsResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = PolarsConnectionSettingsResponse200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PolarsConnectionSettingsResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: PolarsConnectionSettingsJsonBody,
|
||||
|
||||
) -> Response[PolarsConnectionSettingsResponse200]:
|
||||
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (PolarsConnectionSettingsJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PolarsConnectionSettingsResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: PolarsConnectionSettingsJsonBody,
|
||||
|
||||
) -> Optional[PolarsConnectionSettingsResponse200]:
|
||||
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (PolarsConnectionSettingsJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PolarsConnectionSettingsResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: PolarsConnectionSettingsJsonBody,
|
||||
|
||||
) -> Response[PolarsConnectionSettingsResponse200]:
|
||||
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (PolarsConnectionSettingsJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PolarsConnectionSettingsResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: PolarsConnectionSettingsJsonBody,
|
||||
|
||||
) -> Optional[PolarsConnectionSettingsResponse200]:
|
||||
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (PolarsConnectionSettingsJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PolarsConnectionSettingsResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,189 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from typing import Dict
|
||||
from ...models.polars_connection_settings_v2_json_body import PolarsConnectionSettingsV2JsonBody
|
||||
from ...models.polars_connection_settings_v2_response_200 import PolarsConnectionSettingsV2Response200
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
json_body: PolarsConnectionSettingsV2JsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/job_helpers/v2/polars_connection_settings".format(workspace=workspace,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PolarsConnectionSettingsV2Response200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = PolarsConnectionSettingsV2Response200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PolarsConnectionSettingsV2Response200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: PolarsConnectionSettingsV2JsonBody,
|
||||
|
||||
) -> Response[PolarsConnectionSettingsV2Response200]:
|
||||
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (PolarsConnectionSettingsV2JsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PolarsConnectionSettingsV2Response200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: PolarsConnectionSettingsV2JsonBody,
|
||||
|
||||
) -> Optional[PolarsConnectionSettingsV2Response200]:
|
||||
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (PolarsConnectionSettingsV2JsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PolarsConnectionSettingsV2Response200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: PolarsConnectionSettingsV2JsonBody,
|
||||
|
||||
) -> Response[PolarsConnectionSettingsV2Response200]:
|
||||
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (PolarsConnectionSettingsV2JsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PolarsConnectionSettingsV2Response200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: PolarsConnectionSettingsV2JsonBody,
|
||||
|
||||
) -> Optional[PolarsConnectionSettingsV2Response200]:
|
||||
""" Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (PolarsConnectionSettingsV2JsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PolarsConnectionSettingsV2Response200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
)).parsed
|
||||
@@ -0,0 +1,189 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response, UNSET
|
||||
from ... import errors
|
||||
|
||||
from typing import cast
|
||||
from ...models.s3_resource_info_response_200 import S3ResourceInfoResponse200
|
||||
from typing import Dict
|
||||
from ...models.s3_resource_info_json_body import S3ResourceInfoJsonBody
|
||||
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
json_body: S3ResourceInfoJsonBody,
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
|
||||
cookies = {}
|
||||
|
||||
|
||||
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/w/{workspace}/job_helpers/v2/s3_resource_info".format(workspace=workspace,),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[S3ResourceInfoResponse200]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = S3ResourceInfoResponse200.from_dict(response.json())
|
||||
|
||||
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[S3ResourceInfoResponse200]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: S3ResourceInfoJsonBody,
|
||||
|
||||
) -> Response[S3ResourceInfoResponse200]:
|
||||
""" Returns the s3 resource associated to the provided path, or the workspace default S3 resource
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (S3ResourceInfoJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[S3ResourceInfoResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: S3ResourceInfoJsonBody,
|
||||
|
||||
) -> Optional[S3ResourceInfoResponse200]:
|
||||
""" Returns the s3 resource associated to the provided path, or the workspace default S3 resource
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (S3ResourceInfoJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
S3ResourceInfoResponse200
|
||||
"""
|
||||
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
).parsed
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: S3ResourceInfoJsonBody,
|
||||
|
||||
) -> Response[S3ResourceInfoResponse200]:
|
||||
""" Returns the s3 resource associated to the provided path, or the workspace default S3 resource
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (S3ResourceInfoJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[S3ResourceInfoResponse200]
|
||||
"""
|
||||
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
json_body=json_body,
|
||||
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: S3ResourceInfoJsonBody,
|
||||
|
||||
) -> Optional[S3ResourceInfoResponse200]:
|
||||
""" Returns the s3 resource associated to the provided path, or the workspace default S3 resource
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (S3ResourceInfoJsonBody):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
S3ResourceInfoResponse200
|
||||
"""
|
||||
|
||||
|
||||
return (await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
|
||||
)).parsed
|
||||
Reference in New Issue
Block a user