lsp
This commit is contained in:
@@ -0,0 +1,150 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.archive_script_by_hash_response_200 import ArchiveScriptByHashResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/archive/h/{hash}".format(client.base_url, workspace=workspace, hash=hash_)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[ArchiveScriptByHashResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ArchiveScriptByHashResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[ArchiveScriptByHashResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[ArchiveScriptByHashResponse200]:
|
||||
"""archive script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[ArchiveScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[ArchiveScriptByHashResponse200]:
|
||||
"""archive script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[ArchiveScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[ArchiveScriptByHashResponse200]:
|
||||
"""archive script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[ArchiveScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[ArchiveScriptByHashResponse200]:
|
||||
"""archive script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[ArchiveScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,93 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/archive/p/{path}".format(client.base_url, workspace=workspace, path=path)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=None,
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""archive script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""archive script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
@@ -0,0 +1,97 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.create_script_json_body import CreateScriptJsonBody
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: CreateScriptJsonBody,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/create".format(client.base_url, workspace=workspace)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=None,
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: CreateScriptJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""create script
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (CreateScriptJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: CreateScriptJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""create script
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (CreateScriptJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
@@ -0,0 +1,150 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.delete_script_by_hash_response_200 import DeleteScriptByHashResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/delete/h/{hash}".format(client.base_url, workspace=workspace, hash=hash_)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[DeleteScriptByHashResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = DeleteScriptByHashResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[DeleteScriptByHashResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[DeleteScriptByHashResponse200]:
|
||||
"""delete script by hash (erase content but keep hash)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[DeleteScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[DeleteScriptByHashResponse200]:
|
||||
"""delete script by hash (erase content but keep hash)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[DeleteScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[DeleteScriptByHashResponse200]:
|
||||
"""delete script by hash (erase content but keep hash)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[DeleteScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[DeleteScriptByHashResponse200]:
|
||||
"""delete script by hash (erase content but keep hash)
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[DeleteScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,140 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.deno_to_jsonschema_response_200 import DenoToJsonschemaResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/scripts/deno/tojsonschema".format(client.base_url)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
json_json_body = json_body
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[DenoToJsonschemaResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = DenoToJsonschemaResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[DenoToJsonschemaResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Response[DenoToJsonschemaResponse200]:
|
||||
"""inspect deno code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[DenoToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Optional[DenoToJsonschemaResponse200]:
|
||||
"""inspect deno code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[DenoToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Response[DenoToJsonschemaResponse200]:
|
||||
"""inspect deno code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[DenoToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Optional[DenoToJsonschemaResponse200]:
|
||||
"""inspect deno code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[DenoToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,148 @@
|
||||
from typing import Any, Dict, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/exists/p/{path}".format(client.base_url, workspace=workspace, path=path)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[bool]:
|
||||
if response.status_code == 200:
|
||||
response_200 = cast(bool, response.json())
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[bool]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[bool]:
|
||||
"""exists script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[bool]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[bool]:
|
||||
"""exists script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[bool]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[bool]:
|
||||
"""exists script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[bool]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[bool]:
|
||||
"""exists script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[bool]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,86 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/scripts/hub/get/{path}".format(client.base_url, path=path)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=None,
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""get hub script content by path
|
||||
|
||||
Args:
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""get hub script content by path
|
||||
|
||||
Args:
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
@@ -0,0 +1,150 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.get_script_by_hash_response_200 import GetScriptByHashResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/get/h/{hash}".format(client.base_url, workspace=workspace, hash=hash_)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[GetScriptByHashResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = GetScriptByHashResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[GetScriptByHashResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[GetScriptByHashResponse200]:
|
||||
"""get script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[GetScriptByHashResponse200]:
|
||||
"""get script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[GetScriptByHashResponse200]:
|
||||
"""get script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[GetScriptByHashResponse200]:
|
||||
"""get script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptByHashResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,150 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.get_script_by_path_response_200 import GetScriptByPathResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/get/p/{path}".format(client.base_url, workspace=workspace, path=path)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[GetScriptByPathResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = GetScriptByPathResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[GetScriptByPathResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[GetScriptByPathResponse200]:
|
||||
"""get script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptByPathResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[GetScriptByPathResponse200]:
|
||||
"""get script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptByPathResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[GetScriptByPathResponse200]:
|
||||
"""get script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptByPathResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[GetScriptByPathResponse200]:
|
||||
"""get script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptByPathResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,150 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.get_script_deployment_status_response_200 import GetScriptDeploymentStatusResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/deployment_status/h/{hash}".format(client.base_url, workspace=workspace, hash=hash_)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[GetScriptDeploymentStatusResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = GetScriptDeploymentStatusResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[GetScriptDeploymentStatusResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[GetScriptDeploymentStatusResponse200]:
|
||||
"""get script deployment status
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptDeploymentStatusResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[GetScriptDeploymentStatusResponse200]:
|
||||
"""get script deployment status
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptDeploymentStatusResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[GetScriptDeploymentStatusResponse200]:
|
||||
"""get script deployment status
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptDeploymentStatusResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
hash_: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[GetScriptDeploymentStatusResponse200]:
|
||||
"""get script deployment status
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
hash_ (str):
|
||||
|
||||
Returns:
|
||||
Response[GetScriptDeploymentStatusResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
hash_=hash_,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,140 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.go_to_jsonschema_response_200 import GoToJsonschemaResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/scripts/go/tojsonschema".format(client.base_url)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
json_json_body = json_body
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[GoToJsonschemaResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = GoToJsonschemaResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[GoToJsonschemaResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Response[GoToJsonschemaResponse200]:
|
||||
"""inspect go code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[GoToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Optional[GoToJsonschemaResponse200]:
|
||||
"""inspect go code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[GoToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Response[GoToJsonschemaResponse200]:
|
||||
"""inspect go code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[GoToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Optional[GoToJsonschemaResponse200]:
|
||||
"""inspect go code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[GoToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,116 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.list_hub_scripts_response_200 import ListHubScriptsResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/scripts/hub/list".format(client.base_url)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[ListHubScriptsResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ListHubScriptsResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[ListHubScriptsResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[ListHubScriptsResponse200]:
|
||||
"""list all available hub scripts
|
||||
|
||||
Returns:
|
||||
Response[ListHubScriptsResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[ListHubScriptsResponse200]:
|
||||
"""list all available hub scripts
|
||||
|
||||
Returns:
|
||||
Response[ListHubScriptsResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[ListHubScriptsResponse200]:
|
||||
"""list all available hub scripts
|
||||
|
||||
Returns:
|
||||
Response[ListHubScriptsResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[ListHubScriptsResponse200]:
|
||||
"""list all available hub scripts
|
||||
|
||||
Returns:
|
||||
Response[ListHubScriptsResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,326 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.list_scripts_response_200_item import ListScriptsResponse200Item
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
client: 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,
|
||||
kind: Union[Unset, None, str] = UNSET,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/list".format(client.base_url, workspace=workspace)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_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["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": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[List[ListScriptsResponse200Item]]:
|
||||
if response.status_code == 200:
|
||||
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
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[List[ListScriptsResponse200Item]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: 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,
|
||||
kind: Union[Unset, None, str] = UNSET,
|
||||
) -> Response[List[ListScriptsResponse200Item]]:
|
||||
"""list all available 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]):
|
||||
kind (Union[Unset, None, str]):
|
||||
|
||||
Returns:
|
||||
Response[List[ListScriptsResponse200Item]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
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,
|
||||
kind=kind,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: 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,
|
||||
kind: Union[Unset, None, str] = UNSET,
|
||||
) -> Optional[List[ListScriptsResponse200Item]]:
|
||||
"""list all available 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]):
|
||||
kind (Union[Unset, None, str]):
|
||||
|
||||
Returns:
|
||||
Response[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,
|
||||
kind=kind,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: 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,
|
||||
kind: Union[Unset, None, str] = UNSET,
|
||||
) -> Response[List[ListScriptsResponse200Item]]:
|
||||
"""list all available 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]):
|
||||
kind (Union[Unset, None, str]):
|
||||
|
||||
Returns:
|
||||
Response[List[ListScriptsResponse200Item]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
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,
|
||||
kind=kind,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
workspace: str,
|
||||
*,
|
||||
client: 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,
|
||||
kind: Union[Unset, None, str] = UNSET,
|
||||
) -> Optional[List[ListScriptsResponse200Item]]:
|
||||
"""list all available 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]):
|
||||
kind (Union[Unset, None, str]):
|
||||
|
||||
Returns:
|
||||
Response[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,
|
||||
kind=kind,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,140 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.python_to_jsonschema_response_200 import PythonToJsonschemaResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/scripts/python/tojsonschema".format(client.base_url)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
json_json_body = json_body
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[PythonToJsonschemaResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PythonToJsonschemaResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[PythonToJsonschemaResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Response[PythonToJsonschemaResponse200]:
|
||||
"""inspect python code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[PythonToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Optional[PythonToJsonschemaResponse200]:
|
||||
"""inspect python code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[PythonToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Response[PythonToJsonschemaResponse200]:
|
||||
"""inspect python code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[PythonToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: str,
|
||||
) -> Optional[PythonToJsonschemaResponse200]:
|
||||
"""inspect python code to infer jsonschema of arguments
|
||||
|
||||
Args:
|
||||
json_body (str):
|
||||
|
||||
Returns:
|
||||
Response[PythonToJsonschemaResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,93 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/raw/h/{path}".format(client.base_url, workspace=workspace, path=path)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=None,
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""raw script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""raw script by hash
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
@@ -0,0 +1,93 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/scripts/raw/p/{path}".format(client.base_url, workspace=workspace, path=path)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=None,
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""raw script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""raw script by path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.request(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
Reference in New Issue
Block a user