This commit is contained in:
Ruben Fiszel
2024-01-16 23:46:36 +01:00
parent 640ebcb146
commit f782e009cd
1696 changed files with 160145 additions and 0 deletions

View File

@@ -0,0 +1,184 @@
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.archive_script_by_hash_response_200 import ArchiveScriptByHashResponse200
from typing import Dict
def _get_kwargs(
workspace: str,
hash_: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "post",
"url": "/w/{workspace}/scripts/archive/h/{hash}".format(workspace=workspace,hash=hash_,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ArchiveScriptByHashResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = ArchiveScriptByHashResponse200.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[ArchiveScriptByHashResponse200]:
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,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[ArchiveScriptByHashResponse200]:
""" archive script by hash
Args:
workspace (str):
hash_ (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[ArchiveScriptByHashResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
hash_=hash_,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[ArchiveScriptByHashResponse200]:
""" archive script by hash
Args:
workspace (str):
hash_ (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:
ArchiveScriptByHashResponse200
"""
return sync_detailed(
workspace=workspace,
hash_=hash_,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[ArchiveScriptByHashResponse200]:
""" archive script by hash
Args:
workspace (str):
hash_ (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[ArchiveScriptByHashResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
hash_=hash_,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[ArchiveScriptByHashResponse200]:
""" archive script by hash
Args:
workspace (str):
hash_ (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:
ArchiveScriptByHashResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
hash_=hash_,
client=client,
)).parsed

View File

@@ -0,0 +1,119 @@
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,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "post",
"url": "/w/{workspace}/scripts/archive/p/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
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,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" archive script by path
Args:
workspace (str):
path (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,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" archive script by path
Args:
workspace (str):
path (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,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)

View File

@@ -0,0 +1,126 @@
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.create_script_json_body import CreateScriptJsonBody
def _get_kwargs(
workspace: str,
*,
json_body: CreateScriptJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/scripts/create".format(workspace=workspace,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
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],
json_body: CreateScriptJsonBody,
) -> Response[Any]:
""" create script
Args:
workspace (str):
json_body (CreateScriptJsonBody):
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,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: CreateScriptJsonBody,
) -> Response[Any]:
""" create script
Args:
workspace (str):
json_body (CreateScriptJsonBody):
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,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)

View File

@@ -0,0 +1,184 @@
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.delete_script_by_hash_response_200 import DeleteScriptByHashResponse200
def _get_kwargs(
workspace: str,
hash_: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "post",
"url": "/w/{workspace}/scripts/delete/h/{hash}".format(workspace=workspace,hash=hash_,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DeleteScriptByHashResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = DeleteScriptByHashResponse200.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[DeleteScriptByHashResponse200]:
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,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[DeleteScriptByHashResponse200]:
""" delete script by hash (erase content but keep hash, require admin)
Args:
workspace (str):
hash_ (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[DeleteScriptByHashResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
hash_=hash_,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[DeleteScriptByHashResponse200]:
""" delete script by hash (erase content but keep hash, require admin)
Args:
workspace (str):
hash_ (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:
DeleteScriptByHashResponse200
"""
return sync_detailed(
workspace=workspace,
hash_=hash_,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[DeleteScriptByHashResponse200]:
""" delete script by hash (erase content but keep hash, require admin)
Args:
workspace (str):
hash_ (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[DeleteScriptByHashResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
hash_=hash_,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[DeleteScriptByHashResponse200]:
""" delete script by hash (erase content but keep hash, require admin)
Args:
workspace (str):
hash_ (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:
DeleteScriptByHashResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
hash_=hash_,
client=client,
)).parsed

View File

@@ -0,0 +1,178 @@
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,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "post",
"url": "/w/{workspace}/scripts/delete/p/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[str]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(str, 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[str]:
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,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[str]:
""" delete all scripts at a given path (require admin)
Args:
workspace (str):
path (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[str]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[str]:
""" delete all scripts at a given path (require admin)
Args:
workspace (str):
path (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:
str
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[str]:
""" delete all scripts at a given path (require admin)
Args:
workspace (str):
path (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[str]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[str]:
""" delete all scripts at a given path (require admin)
Args:
workspace (str):
path (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:
str
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed

View File

@@ -0,0 +1,178 @@
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,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/scripts/exists/p/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[bool]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(bool, 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[bool]:
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,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[bool]:
""" exists script by path
Args:
workspace (str):
path (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[bool]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[bool]:
""" exists script by path
Args:
workspace (str):
path (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:
bool
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[bool]:
""" exists script by path
Args:
workspace (str):
path (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[bool]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[bool]:
""" exists script by path
Args:
workspace (str):
path (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:
bool
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed

View File

@@ -0,0 +1,171 @@
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.get_hub_script_by_path_response_200 import GetHubScriptByPathResponse200
from typing import Dict
def _get_kwargs(
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/scripts/hub/get_full/{path}".format(path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetHubScriptByPathResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetHubScriptByPathResponse200.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[GetHubScriptByPathResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetHubScriptByPathResponse200]:
""" get full hub script by path
Args:
path (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[GetHubScriptByPathResponse200]
"""
kwargs = _get_kwargs(
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetHubScriptByPathResponse200]:
""" get full hub script by path
Args:
path (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:
GetHubScriptByPathResponse200
"""
return sync_detailed(
path=path,
client=client,
).parsed
async def asyncio_detailed(
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetHubScriptByPathResponse200]:
""" get full hub script by path
Args:
path (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[GetHubScriptByPathResponse200]
"""
kwargs = _get_kwargs(
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetHubScriptByPathResponse200]:
""" get full hub script by path
Args:
path (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:
GetHubScriptByPathResponse200
"""
return (await asyncio_detailed(
path=path,
client=client,
)).parsed

View File

@@ -0,0 +1,112 @@
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(
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/scripts/hub/get/{path}".format(path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
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(
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" get hub script content by path
Args:
path (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(
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" get hub script content by path
Args:
path (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(
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)

View File

@@ -0,0 +1,184 @@
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.get_script_by_hash_response_200 import GetScriptByHashResponse200
from typing import Dict
def _get_kwargs(
workspace: str,
hash_: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/scripts/get/h/{hash}".format(workspace=workspace,hash=hash_,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetScriptByHashResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetScriptByHashResponse200.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[GetScriptByHashResponse200]:
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,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetScriptByHashResponse200]:
""" get script by hash
Args:
workspace (str):
hash_ (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[GetScriptByHashResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
hash_=hash_,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetScriptByHashResponse200]:
""" get script by hash
Args:
workspace (str):
hash_ (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:
GetScriptByHashResponse200
"""
return sync_detailed(
workspace=workspace,
hash_=hash_,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetScriptByHashResponse200]:
""" get script by hash
Args:
workspace (str):
hash_ (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[GetScriptByHashResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
hash_=hash_,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetScriptByHashResponse200]:
""" get script by hash
Args:
workspace (str):
hash_ (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:
GetScriptByHashResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
hash_=hash_,
client=client,
)).parsed

View File

@@ -0,0 +1,184 @@
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.get_script_by_path_response_200 import GetScriptByPathResponse200
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/scripts/get/p/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetScriptByPathResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetScriptByPathResponse200.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[GetScriptByPathResponse200]:
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,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetScriptByPathResponse200]:
""" get script by path
Args:
workspace (str):
path (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[GetScriptByPathResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetScriptByPathResponse200]:
""" get script by path
Args:
workspace (str):
path (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:
GetScriptByPathResponse200
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetScriptByPathResponse200]:
""" get script by path
Args:
workspace (str):
path (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[GetScriptByPathResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetScriptByPathResponse200]:
""" get script by path
Args:
workspace (str):
path (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:
GetScriptByPathResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed

View File

@@ -0,0 +1,184 @@
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.get_script_by_path_with_draft_response_200 import GetScriptByPathWithDraftResponse200
from typing import Dict
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/scripts/get/draft/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetScriptByPathWithDraftResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetScriptByPathWithDraftResponse200.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[GetScriptByPathWithDraftResponse200]:
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,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetScriptByPathWithDraftResponse200]:
""" get script by path with draft
Args:
workspace (str):
path (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[GetScriptByPathWithDraftResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetScriptByPathWithDraftResponse200]:
""" get script by path with draft
Args:
workspace (str):
path (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:
GetScriptByPathWithDraftResponse200
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetScriptByPathWithDraftResponse200]:
""" get script by path with draft
Args:
workspace (str):
path (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[GetScriptByPathWithDraftResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetScriptByPathWithDraftResponse200]:
""" get script by path with draft
Args:
workspace (str):
path (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:
GetScriptByPathWithDraftResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed

View File

@@ -0,0 +1,184 @@
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.get_script_deployment_status_response_200 import GetScriptDeploymentStatusResponse200
def _get_kwargs(
workspace: str,
hash_: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/scripts/deployment_status/h/{hash}".format(workspace=workspace,hash=hash_,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetScriptDeploymentStatusResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetScriptDeploymentStatusResponse200.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[GetScriptDeploymentStatusResponse200]:
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,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetScriptDeploymentStatusResponse200]:
""" get script deployment status
Args:
workspace (str):
hash_ (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[GetScriptDeploymentStatusResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
hash_=hash_,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetScriptDeploymentStatusResponse200]:
""" get script deployment status
Args:
workspace (str):
hash_ (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:
GetScriptDeploymentStatusResponse200
"""
return sync_detailed(
workspace=workspace,
hash_=hash_,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[GetScriptDeploymentStatusResponse200]:
""" get script deployment status
Args:
workspace (str):
hash_ (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[GetScriptDeploymentStatusResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
hash_=hash_,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
hash_: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[GetScriptDeploymentStatusResponse200]:
""" get script deployment status
Args:
workspace (str):
hash_ (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:
GetScriptDeploymentStatusResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
hash_=hash_,
client=client,
)).parsed

View File

@@ -0,0 +1,190 @@
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 ...models.get_script_history_by_path_response_200_item import GetScriptHistoryByPathResponse200Item
from typing import cast
from typing import Dict
from typing import cast, List
def _get_kwargs(
workspace: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/scripts/history/p/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['GetScriptHistoryByPathResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = GetScriptHistoryByPathResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
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[List['GetScriptHistoryByPathResponse200Item']]:
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,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['GetScriptHistoryByPathResponse200Item']]:
""" get history of a script by path
Args:
workspace (str):
path (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[List['GetScriptHistoryByPathResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['GetScriptHistoryByPathResponse200Item']]:
""" get history of a script by path
Args:
workspace (str):
path (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:
List['GetScriptHistoryByPathResponse200Item']
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['GetScriptHistoryByPathResponse200Item']]:
""" get history of a script by path
Args:
workspace (str):
path (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[List['GetScriptHistoryByPathResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['GetScriptHistoryByPathResponse200Item']]:
""" get history of a script by path
Args:
workspace (str):
path (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:
List['GetScriptHistoryByPathResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
)).parsed

View File

@@ -0,0 +1,214 @@
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.get_top_hub_scripts_response_200 import GetTopHubScriptsResponse200
from typing import Dict
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
*,
limit: Union[Unset, None, float] = UNSET,
app: Union[Unset, None, str] = UNSET,
kind: Union[Unset, None, str] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["limit"] = limit
params["app"] = app
params["kind"] = kind
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/scripts/hub/top",
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetTopHubScriptsResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetTopHubScriptsResponse200.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[GetTopHubScriptsResponse200]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
*,
client: Union[AuthenticatedClient, Client],
limit: Union[Unset, None, float] = UNSET,
app: Union[Unset, None, str] = UNSET,
kind: Union[Unset, None, str] = UNSET,
) -> Response[GetTopHubScriptsResponse200]:
""" get top hub scripts
Args:
limit (Union[Unset, None, float]):
app (Union[Unset, None, str]):
kind (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[GetTopHubScriptsResponse200]
"""
kwargs = _get_kwargs(
limit=limit,
app=app,
kind=kind,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: Union[AuthenticatedClient, Client],
limit: Union[Unset, None, float] = UNSET,
app: Union[Unset, None, str] = UNSET,
kind: Union[Unset, None, str] = UNSET,
) -> Optional[GetTopHubScriptsResponse200]:
""" get top hub scripts
Args:
limit (Union[Unset, None, float]):
app (Union[Unset, None, str]):
kind (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:
GetTopHubScriptsResponse200
"""
return sync_detailed(
client=client,
limit=limit,
app=app,
kind=kind,
).parsed
async def asyncio_detailed(
*,
client: Union[AuthenticatedClient, Client],
limit: Union[Unset, None, float] = UNSET,
app: Union[Unset, None, str] = UNSET,
kind: Union[Unset, None, str] = UNSET,
) -> Response[GetTopHubScriptsResponse200]:
""" get top hub scripts
Args:
limit (Union[Unset, None, float]):
app (Union[Unset, None, str]):
kind (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[GetTopHubScriptsResponse200]
"""
kwargs = _get_kwargs(
limit=limit,
app=app,
kind=kind,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: Union[AuthenticatedClient, Client],
limit: Union[Unset, None, float] = UNSET,
app: Union[Unset, None, str] = UNSET,
kind: Union[Unset, None, str] = UNSET,
) -> Optional[GetTopHubScriptsResponse200]:
""" get top hub scripts
Args:
limit (Union[Unset, None, float]):
app (Union[Unset, None, str]):
kind (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:
GetTopHubScriptsResponse200
"""
return (await asyncio_detailed(
client=client,
limit=limit,
app=app,
kind=kind,
)).parsed

View File

@@ -0,0 +1,112 @@
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}/scripts/list_paths".format(workspace=workspace,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
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]:
""" list all scripts paths
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]:
""" list all scripts paths
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)

View File

@@ -0,0 +1,393 @@
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 cast, List
from ...models.list_scripts_response_200_item import ListScriptsResponse200Item
from typing import Dict
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
*,
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
first_parent_hash: Union[Unset, None, str] = UNSET,
last_parent_hash: Union[Unset, None, str] = UNSET,
parent_hash: Union[Unset, None, str] = UNSET,
show_archived: Union[Unset, None, bool] = UNSET,
is_template: Union[Unset, None, bool] = UNSET,
kinds: Union[Unset, None, str] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["page"] = page
params["per_page"] = per_page
params["order_desc"] = order_desc
params["created_by"] = created_by
params["path_start"] = path_start
params["path_exact"] = path_exact
params["first_parent_hash"] = first_parent_hash
params["last_parent_hash"] = last_parent_hash
params["parent_hash"] = parent_hash
params["show_archived"] = show_archived
params["is_template"] = is_template
params["kinds"] = kinds
params["starred_only"] = starred_only
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}/scripts/list".format(workspace=workspace,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListScriptsResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListScriptsResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
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[List['ListScriptsResponse200Item']]:
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],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
first_parent_hash: Union[Unset, None, str] = UNSET,
last_parent_hash: Union[Unset, None, str] = UNSET,
parent_hash: Union[Unset, None, str] = UNSET,
show_archived: Union[Unset, None, bool] = UNSET,
is_template: Union[Unset, None, bool] = UNSET,
kinds: Union[Unset, None, str] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Response[List['ListScriptsResponse200Item']]:
""" list all scripts
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
first_parent_hash (Union[Unset, None, str]):
last_parent_hash (Union[Unset, None, str]):
parent_hash (Union[Unset, None, str]):
show_archived (Union[Unset, None, bool]):
is_template (Union[Unset, None, bool]):
kinds (Union[Unset, None, str]):
starred_only (Union[Unset, None, bool]):
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[List['ListScriptsResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
first_parent_hash=first_parent_hash,
last_parent_hash=last_parent_hash,
parent_hash=parent_hash,
show_archived=show_archived,
is_template=is_template,
kinds=kinds,
starred_only=starred_only,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
first_parent_hash: Union[Unset, None, str] = UNSET,
last_parent_hash: Union[Unset, None, str] = UNSET,
parent_hash: Union[Unset, None, str] = UNSET,
show_archived: Union[Unset, None, bool] = UNSET,
is_template: Union[Unset, None, bool] = UNSET,
kinds: Union[Unset, None, str] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Optional[List['ListScriptsResponse200Item']]:
""" list all scripts
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
first_parent_hash (Union[Unset, None, str]):
last_parent_hash (Union[Unset, None, str]):
parent_hash (Union[Unset, None, str]):
show_archived (Union[Unset, None, bool]):
is_template (Union[Unset, None, bool]):
kinds (Union[Unset, None, str]):
starred_only (Union[Unset, None, bool]):
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:
List['ListScriptsResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
first_parent_hash=first_parent_hash,
last_parent_hash=last_parent_hash,
parent_hash=parent_hash,
show_archived=show_archived,
is_template=is_template,
kinds=kinds,
starred_only=starred_only,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
first_parent_hash: Union[Unset, None, str] = UNSET,
last_parent_hash: Union[Unset, None, str] = UNSET,
parent_hash: Union[Unset, None, str] = UNSET,
show_archived: Union[Unset, None, bool] = UNSET,
is_template: Union[Unset, None, bool] = UNSET,
kinds: Union[Unset, None, str] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Response[List['ListScriptsResponse200Item']]:
""" list all scripts
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
first_parent_hash (Union[Unset, None, str]):
last_parent_hash (Union[Unset, None, str]):
parent_hash (Union[Unset, None, str]):
show_archived (Union[Unset, None, bool]):
is_template (Union[Unset, None, bool]):
kinds (Union[Unset, None, str]):
starred_only (Union[Unset, None, bool]):
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[List['ListScriptsResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
first_parent_hash=first_parent_hash,
last_parent_hash=last_parent_hash,
parent_hash=parent_hash,
show_archived=show_archived,
is_template=is_template,
kinds=kinds,
starred_only=starred_only,
)
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],
page: Union[Unset, None, int] = UNSET,
per_page: Union[Unset, None, int] = UNSET,
order_desc: Union[Unset, None, bool] = UNSET,
created_by: Union[Unset, None, str] = UNSET,
path_start: Union[Unset, None, str] = UNSET,
path_exact: Union[Unset, None, str] = UNSET,
first_parent_hash: Union[Unset, None, str] = UNSET,
last_parent_hash: Union[Unset, None, str] = UNSET,
parent_hash: Union[Unset, None, str] = UNSET,
show_archived: Union[Unset, None, bool] = UNSET,
is_template: Union[Unset, None, bool] = UNSET,
kinds: Union[Unset, None, str] = UNSET,
starred_only: Union[Unset, None, bool] = UNSET,
) -> Optional[List['ListScriptsResponse200Item']]:
""" list all scripts
Args:
workspace (str):
page (Union[Unset, None, int]):
per_page (Union[Unset, None, int]):
order_desc (Union[Unset, None, bool]):
created_by (Union[Unset, None, str]):
path_start (Union[Unset, None, str]):
path_exact (Union[Unset, None, str]):
first_parent_hash (Union[Unset, None, str]):
last_parent_hash (Union[Unset, None, str]):
parent_hash (Union[Unset, None, str]):
show_archived (Union[Unset, None, bool]):
is_template (Union[Unset, None, bool]):
kinds (Union[Unset, None, str]):
starred_only (Union[Unset, None, bool]):
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:
List['ListScriptsResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
page=page,
per_page=per_page,
order_desc=order_desc,
created_by=created_by,
path_start=path_start,
path_exact=path_exact,
first_parent_hash=first_parent_hash,
last_parent_hash=last_parent_hash,
parent_hash=parent_hash,
show_archived=show_archived,
is_template=is_template,
kinds=kinds,
starred_only=starred_only,
)).parsed

View File

@@ -0,0 +1,177 @@
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.list_search_script_response_200_item import ListSearchScriptResponse200Item
from typing import Dict
from typing import cast, List
def _get_kwargs(
workspace: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/scripts/list_search".format(workspace=workspace,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListSearchScriptResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = ListSearchScriptResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
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[List['ListSearchScriptResponse200Item']]:
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[List['ListSearchScriptResponse200Item']]:
""" list scripts for search
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[List['ListSearchScriptResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[List['ListSearchScriptResponse200Item']]:
""" list scripts for search
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:
List['ListSearchScriptResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListSearchScriptResponse200Item']]:
""" list scripts for search
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[List['ListSearchScriptResponse200Item']]
"""
kwargs = _get_kwargs(
workspace=workspace,
)
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],
) -> Optional[List['ListSearchScriptResponse200Item']]:
""" list scripts for search
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:
List['ListSearchScriptResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
)).parsed

View File

@@ -0,0 +1,236 @@
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 cast, List
from typing import Dict
from ...models.query_hub_scripts_response_200_item import QueryHubScriptsResponse200Item
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
*,
text: str,
kind: Union[Unset, None, str] = UNSET,
limit: Union[Unset, None, float] = UNSET,
app: Union[Unset, None, str] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["text"] = text
params["kind"] = kind
params["limit"] = limit
params["app"] = app
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"url": "/embeddings/query_hub_scripts",
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['QueryHubScriptsResponse200Item']]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in (_response_200):
response_200_item = QueryHubScriptsResponse200Item.from_dict(response_200_item_data)
response_200.append(response_200_item)
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[List['QueryHubScriptsResponse200Item']]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
*,
client: Union[AuthenticatedClient, Client],
text: str,
kind: Union[Unset, None, str] = UNSET,
limit: Union[Unset, None, float] = UNSET,
app: Union[Unset, None, str] = UNSET,
) -> Response[List['QueryHubScriptsResponse200Item']]:
""" query hub scripts by similarity
Args:
text (str):
kind (Union[Unset, None, str]):
limit (Union[Unset, None, float]):
app (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[List['QueryHubScriptsResponse200Item']]
"""
kwargs = _get_kwargs(
text=text,
kind=kind,
limit=limit,
app=app,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: Union[AuthenticatedClient, Client],
text: str,
kind: Union[Unset, None, str] = UNSET,
limit: Union[Unset, None, float] = UNSET,
app: Union[Unset, None, str] = UNSET,
) -> Optional[List['QueryHubScriptsResponse200Item']]:
""" query hub scripts by similarity
Args:
text (str):
kind (Union[Unset, None, str]):
limit (Union[Unset, None, float]):
app (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:
List['QueryHubScriptsResponse200Item']
"""
return sync_detailed(
client=client,
text=text,
kind=kind,
limit=limit,
app=app,
).parsed
async def asyncio_detailed(
*,
client: Union[AuthenticatedClient, Client],
text: str,
kind: Union[Unset, None, str] = UNSET,
limit: Union[Unset, None, float] = UNSET,
app: Union[Unset, None, str] = UNSET,
) -> Response[List['QueryHubScriptsResponse200Item']]:
""" query hub scripts by similarity
Args:
text (str):
kind (Union[Unset, None, str]):
limit (Union[Unset, None, float]):
app (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[List['QueryHubScriptsResponse200Item']]
"""
kwargs = _get_kwargs(
text=text,
kind=kind,
limit=limit,
app=app,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: Union[AuthenticatedClient, Client],
text: str,
kind: Union[Unset, None, str] = UNSET,
limit: Union[Unset, None, float] = UNSET,
app: Union[Unset, None, str] = UNSET,
) -> Optional[List['QueryHubScriptsResponse200Item']]:
""" query hub scripts by similarity
Args:
text (str):
kind (Union[Unset, None, str]):
limit (Union[Unset, None, float]):
app (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:
List['QueryHubScriptsResponse200Item']
"""
return (await asyncio_detailed(
client=client,
text=text,
kind=kind,
limit=limit,
app=app,
)).parsed

View File

@@ -0,0 +1,119 @@
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,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/scripts/raw/h/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
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,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" raw script by hash
Args:
workspace (str):
path (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,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" raw script by hash
Args:
workspace (str):
path (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,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)

View File

@@ -0,0 +1,119 @@
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,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/scripts/raw/p/{path}".format(workspace=workspace,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
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,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" raw script by path
Args:
workspace (str):
path (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,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" raw script by path
Args:
workspace (str):
path (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,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)

View File

@@ -0,0 +1,126 @@
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,
token: str,
path: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/scripts_u/tokened_raw/{workspace}/{token}/{path}".format(workspace=workspace,token=token,path=path,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
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,
token: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts)
Args:
workspace (str):
token (str):
path (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,
token=token,
path=path,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
token: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
""" raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts)
Args:
workspace (str):
token (str):
path (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,
token=token,
path=path,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)

View File

@@ -0,0 +1,133 @@
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.toggle_workspace_error_handler_for_script_json_body import ToggleWorkspaceErrorHandlerForScriptJsonBody
def _get_kwargs(
workspace: str,
path: str,
*,
json_body: ToggleWorkspaceErrorHandlerForScriptJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/scripts/toggle_workspace_error_handler/p/{path}".format(workspace=workspace,path=path,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
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,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: ToggleWorkspaceErrorHandlerForScriptJsonBody,
) -> Response[Any]:
""" Toggle ON and OFF the workspace error handler for a given script
Args:
workspace (str):
path (str):
json_body (ToggleWorkspaceErrorHandlerForScriptJsonBody):
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,
path=path,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: ToggleWorkspaceErrorHandlerForScriptJsonBody,
) -> Response[Any]:
""" Toggle ON and OFF the workspace error handler for a given script
Args:
workspace (str):
path (str):
json_body (ToggleWorkspaceErrorHandlerForScriptJsonBody):
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,
path=path,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)

View File

@@ -0,0 +1,140 @@
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.update_script_history_json_body import UpdateScriptHistoryJsonBody
from typing import Dict
def _get_kwargs(
workspace: str,
hash_: str,
path: str,
*,
json_body: UpdateScriptHistoryJsonBody,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/scripts/history_update/h/{hash}/p/{path}".format(workspace=workspace,hash=hash_,path=path,),
"json": json_json_body,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
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,
hash_: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateScriptHistoryJsonBody,
) -> Response[Any]:
""" update history of a script
Args:
workspace (str):
hash_ (str):
path (str):
json_body (UpdateScriptHistoryJsonBody):
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,
hash_=hash_,
path=path,
json_body=json_body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
async def asyncio_detailed(
workspace: str,
hash_: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
json_body: UpdateScriptHistoryJsonBody,
) -> Response[Any]:
""" update history of a script
Args:
workspace (str):
hash_ (str):
path (str):
json_body (UpdateScriptHistoryJsonBody):
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,
hash_=hash_,
path=path,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)