This commit is contained in:
Ruben Fiszel
2024-01-16 23:46:36 +01:00
parent a24645ee00
commit c73e2760d4
1696 changed files with 160145 additions and 0 deletions
@@ -0,0 +1,143 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from typing import Dict
from typing import Optional
from ...types import UNSET, Unset
from ...models.create_variable_json_body import CreateVariableJsonBody
def _get_kwargs(
workspace: str,
*,
json_body: CreateVariableJsonBody,
already_encrypted: Union[Unset, None, bool] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["already_encrypted"] = already_encrypted
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/variables/create".format(workspace=workspace,),
"json": json_json_body,
"params": params,
}
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: CreateVariableJsonBody,
already_encrypted: Union[Unset, None, bool] = UNSET,
) -> Response[Any]:
""" create variable
Args:
workspace (str):
already_encrypted (Union[Unset, None, bool]):
json_body (CreateVariableJsonBody):
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,
already_encrypted=already_encrypted,
)
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: CreateVariableJsonBody,
already_encrypted: Union[Unset, None, bool] = UNSET,
) -> Response[Any]:
""" create variable
Args:
workspace (str):
already_encrypted (Union[Unset, None, bool]):
json_body (CreateVariableJsonBody):
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,
already_encrypted=already_encrypted,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -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": "delete",
"url": "/w/{workspace}/variables/delete/{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]:
""" delete variable
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]:
""" delete variable
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)
@@ -0,0 +1,122 @@
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,
*,
json_body: str,
) -> Dict[str, Any]:
cookies = {}
json_json_body = json_body
return {
"method": "post",
"url": "/w/{workspace}/variables/encrypt".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: str,
) -> Response[Any]:
""" encrypt value
Args:
workspace (str):
json_body (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,
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: str,
) -> Response[Any]:
""" encrypt value
Args:
workspace (str):
json_body (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,
json_body=json_body,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)
@@ -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}/variables/exists/{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]:
""" does variable exists at 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]:
""" does variable exists at 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]:
""" does variable exists at 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]:
""" does variable exists at 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
@@ -0,0 +1,224 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from typing import Dict
from ...models.get_variable_response_200 import GetVariableResponse200
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
path: str,
*,
decrypt_secret: Union[Unset, None, bool] = UNSET,
include_encrypted: Union[Unset, None, bool] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["decrypt_secret"] = decrypt_secret
params["include_encrypted"] = include_encrypted
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}/variables/get/{path}".format(workspace=workspace,path=path,),
"params": params,
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[GetVariableResponse200]:
if response.status_code == HTTPStatus.OK:
response_200 = GetVariableResponse200.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[GetVariableResponse200]:
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],
decrypt_secret: Union[Unset, None, bool] = UNSET,
include_encrypted: Union[Unset, None, bool] = UNSET,
) -> Response[GetVariableResponse200]:
""" get variable
Args:
workspace (str):
path (str):
decrypt_secret (Union[Unset, None, bool]):
include_encrypted (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[GetVariableResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
decrypt_secret=decrypt_secret,
include_encrypted=include_encrypted,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
decrypt_secret: Union[Unset, None, bool] = UNSET,
include_encrypted: Union[Unset, None, bool] = UNSET,
) -> Optional[GetVariableResponse200]:
""" get variable
Args:
workspace (str):
path (str):
decrypt_secret (Union[Unset, None, bool]):
include_encrypted (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:
GetVariableResponse200
"""
return sync_detailed(
workspace=workspace,
path=path,
client=client,
decrypt_secret=decrypt_secret,
include_encrypted=include_encrypted,
).parsed
async def asyncio_detailed(
workspace: str,
path: str,
*,
client: Union[AuthenticatedClient, Client],
decrypt_secret: Union[Unset, None, bool] = UNSET,
include_encrypted: Union[Unset, None, bool] = UNSET,
) -> Response[GetVariableResponse200]:
""" get variable
Args:
workspace (str):
path (str):
decrypt_secret (Union[Unset, None, bool]):
include_encrypted (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[GetVariableResponse200]
"""
kwargs = _get_kwargs(
workspace=workspace,
path=path,
decrypt_secret=decrypt_secret,
include_encrypted=include_encrypted,
)
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],
decrypt_secret: Union[Unset, None, bool] = UNSET,
include_encrypted: Union[Unset, None, bool] = UNSET,
) -> Optional[GetVariableResponse200]:
""" get variable
Args:
workspace (str):
path (str):
decrypt_secret (Union[Unset, None, bool]):
include_encrypted (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:
GetVariableResponse200
"""
return (await asyncio_detailed(
workspace=workspace,
path=path,
client=client,
decrypt_secret=decrypt_secret,
include_encrypted=include_encrypted,
)).parsed
@@ -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}/variables/get_value/{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]:
""" get variable value
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]:
""" get variable value
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]:
""" get variable value
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]:
""" get variable value
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
@@ -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_contextual_variables_response_200_item import ListContextualVariablesResponse200Item
from typing import Dict
from typing import cast, List
def _get_kwargs(
workspace: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/variables/list_contextual".format(workspace=workspace,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListContextualVariablesResponse200Item']]:
if response.status_code == HTTPStatus.OK:
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
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['ListContextualVariablesResponse200Item']]:
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['ListContextualVariablesResponse200Item']]:
""" list contextual variables
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['ListContextualVariablesResponse200Item']]
"""
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['ListContextualVariablesResponse200Item']]:
""" list contextual variables
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['ListContextualVariablesResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListContextualVariablesResponse200Item']]:
""" list contextual variables
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['ListContextualVariablesResponse200Item']]
"""
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['ListContextualVariablesResponse200Item']]:
""" list contextual variables
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['ListContextualVariablesResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
)).parsed
@@ -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_variable_response_200_item import ListVariableResponse200Item
from typing import Dict
from typing import cast, List
def _get_kwargs(
workspace: str,
) -> Dict[str, Any]:
cookies = {}
return {
"method": "get",
"url": "/w/{workspace}/variables/list".format(workspace=workspace,),
}
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List['ListVariableResponse200Item']]:
if response.status_code == HTTPStatus.OK:
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
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['ListVariableResponse200Item']]:
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['ListVariableResponse200Item']]:
""" list variables
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['ListVariableResponse200Item']]
"""
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['ListVariableResponse200Item']]:
""" list variables
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['ListVariableResponse200Item']
"""
return sync_detailed(
workspace=workspace,
client=client,
).parsed
async def asyncio_detailed(
workspace: str,
*,
client: Union[AuthenticatedClient, Client],
) -> Response[List['ListVariableResponse200Item']]:
""" list variables
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['ListVariableResponse200Item']]
"""
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['ListVariableResponse200Item']]:
""" list variables
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['ListVariableResponse200Item']
"""
return (await asyncio_detailed(
workspace=workspace,
client=client,
)).parsed
@@ -0,0 +1,150 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ... import errors
from typing import Union
from typing import cast
from typing import Dict
from ...models.update_variable_json_body import UpdateVariableJsonBody
from typing import Optional
from ...types import UNSET, Unset
def _get_kwargs(
workspace: str,
path: str,
*,
json_body: UpdateVariableJsonBody,
already_encrypted: Union[Unset, None, bool] = UNSET,
) -> Dict[str, Any]:
cookies = {}
params: Dict[str, Any] = {}
params["already_encrypted"] = already_encrypted
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
json_json_body = json_body.to_dict()
return {
"method": "post",
"url": "/w/{workspace}/variables/update/{path}".format(workspace=workspace,path=path,),
"json": json_json_body,
"params": params,
}
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: UpdateVariableJsonBody,
already_encrypted: Union[Unset, None, bool] = UNSET,
) -> Response[Any]:
""" update variable
Args:
workspace (str):
path (str):
already_encrypted (Union[Unset, None, bool]):
json_body (UpdateVariableJsonBody):
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,
already_encrypted=already_encrypted,
)
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: UpdateVariableJsonBody,
already_encrypted: Union[Unset, None, bool] = UNSET,
) -> Response[Any]:
""" update variable
Args:
workspace (str):
path (str):
already_encrypted (Union[Unset, None, bool]):
json_body (UpdateVariableJsonBody):
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,
already_encrypted=already_encrypted,
)
response = await client.get_async_httpx_client().request(
**kwargs
)
return _build_response(client=client, response=response)