mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 08:01:35 +00:00
lsp
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.create_variable_json_body import CreateVariableJsonBody
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: CreateVariableJsonBody,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/variables/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: CreateVariableJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""create variable
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (CreateVariableJsonBody):
|
||||
|
||||
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: CreateVariableJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""create variable
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (CreateVariableJsonBody):
|
||||
|
||||
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,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}/variables/delete/{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": "delete",
|
||||
"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]:
|
||||
"""delete variable
|
||||
|
||||
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]:
|
||||
"""delete variable
|
||||
|
||||
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,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}/variables/exists/{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]:
|
||||
"""does variable exists at 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]:
|
||||
"""does variable exists at 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]:
|
||||
"""does variable exists at 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]:
|
||||
"""does variable exists at path
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[bool]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,169 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.get_variable_response_200 import GetVariableResponse200
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
decrypt_secret: Union[Unset, None, bool] = UNSET,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/variables/get/{path}".format(client.base_url, workspace=workspace, path=path)
|
||||
|
||||
headers: Dict[str, str] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
params["decrypt_secret"] = decrypt_secret
|
||||
|
||||
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[GetVariableResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = GetVariableResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[GetVariableResponse200]:
|
||||
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,
|
||||
decrypt_secret: Union[Unset, None, bool] = UNSET,
|
||||
) -> Response[GetVariableResponse200]:
|
||||
"""get variable
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
decrypt_secret (Union[Unset, None, bool]):
|
||||
|
||||
Returns:
|
||||
Response[GetVariableResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
decrypt_secret=decrypt_secret,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
decrypt_secret: Union[Unset, None, bool] = UNSET,
|
||||
) -> Optional[GetVariableResponse200]:
|
||||
"""get variable
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
decrypt_secret (Union[Unset, None, bool]):
|
||||
|
||||
Returns:
|
||||
Response[GetVariableResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
decrypt_secret=decrypt_secret,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
decrypt_secret: Union[Unset, None, bool] = UNSET,
|
||||
) -> Response[GetVariableResponse200]:
|
||||
"""get variable
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
decrypt_secret (Union[Unset, None, bool]):
|
||||
|
||||
Returns:
|
||||
Response[GetVariableResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
decrypt_secret=decrypt_secret,
|
||||
)
|
||||
|
||||
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,
|
||||
decrypt_secret: Union[Unset, None, bool] = UNSET,
|
||||
) -> Optional[GetVariableResponse200]:
|
||||
"""get variable
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
decrypt_secret (Union[Unset, None, bool]):
|
||||
|
||||
Returns:
|
||||
Response[GetVariableResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
client=client,
|
||||
decrypt_secret=decrypt_secret,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,142 @@
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.list_contextual_variables_response_200_item import ListContextualVariablesResponse200Item
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/variables/list_contextual".format(client.base_url, workspace=workspace)
|
||||
|
||||
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[List[ListContextualVariablesResponse200Item]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = ListContextualVariablesResponse200Item.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[ListContextualVariablesResponse200Item]]:
|
||||
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,
|
||||
) -> Response[List[ListContextualVariablesResponse200Item]]:
|
||||
"""list contextual variables
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Returns:
|
||||
Response[List[ListContextualVariablesResponse200Item]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[List[ListContextualVariablesResponse200Item]]:
|
||||
"""list contextual variables
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Returns:
|
||||
Response[List[ListContextualVariablesResponse200Item]]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[List[ListContextualVariablesResponse200Item]]:
|
||||
"""list contextual variables
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Returns:
|
||||
Response[List[ListContextualVariablesResponse200Item]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
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,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[List[ListContextualVariablesResponse200Item]]:
|
||||
"""list contextual variables
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Returns:
|
||||
Response[List[ListContextualVariablesResponse200Item]]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,142 @@
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.list_variable_response_200_item import ListVariableResponse200Item
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/variables/list".format(client.base_url, workspace=workspace)
|
||||
|
||||
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[List[ListVariableResponse200Item]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = ListVariableResponse200Item.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[ListVariableResponse200Item]]:
|
||||
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,
|
||||
) -> Response[List[ListVariableResponse200Item]]:
|
||||
"""list variables
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Returns:
|
||||
Response[List[ListVariableResponse200Item]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[List[ListVariableResponse200Item]]:
|
||||
"""list variables
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Returns:
|
||||
Response[List[ListVariableResponse200Item]]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[List[ListVariableResponse200Item]]:
|
||||
"""list variables
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Returns:
|
||||
Response[List[ListVariableResponse200Item]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
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,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[List[ListVariableResponse200Item]]:
|
||||
"""list variables
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Returns:
|
||||
Response[List[ListVariableResponse200Item]]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,104 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.update_variable_json_body import UpdateVariableJsonBody
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: UpdateVariableJsonBody,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/variables/update/{path}".format(client.base_url, workspace=workspace, path=path)
|
||||
|
||||
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,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: UpdateVariableJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""update variable
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
json_body (UpdateVariableJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
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,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: UpdateVariableJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""update variable
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
path (str):
|
||||
json_body (UpdateVariableJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
path=path,
|
||||
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)
|
||||
Reference in New Issue
Block a user