lsp
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.add_granular_acls_json_body import AddGranularAclsJsonBody
|
||||
from ...models.add_granular_acls_kind import AddGranularAclsKind
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
kind: AddGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: AddGranularAclsJsonBody,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/acls/add/{kind}/{path}".format(client.base_url, workspace=workspace, kind=kind, 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,
|
||||
kind: AddGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: AddGranularAclsJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""add granular acls
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
kind (AddGranularAclsKind):
|
||||
path (str):
|
||||
json_body (AddGranularAclsJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
kind=kind,
|
||||
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,
|
||||
kind: AddGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: AddGranularAclsJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""add granular acls
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
kind (AddGranularAclsKind):
|
||||
path (str):
|
||||
json_body (AddGranularAclsJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
kind=kind,
|
||||
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)
|
||||
@@ -0,0 +1,164 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.get_granular_acls_kind import GetGranularAclsKind
|
||||
from ...models.get_granular_acls_response_200 import GetGranularAclsResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
kind: GetGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/acls/get/{kind}/{path}".format(client.base_url, workspace=workspace, kind=kind, 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[GetGranularAclsResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = GetGranularAclsResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[GetGranularAclsResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
workspace: str,
|
||||
kind: GetGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[GetGranularAclsResponse200]:
|
||||
"""get granular acls
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
kind (GetGranularAclsKind):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[GetGranularAclsResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
kind=kind,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
workspace: str,
|
||||
kind: GetGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[GetGranularAclsResponse200]:
|
||||
"""get granular acls
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
kind (GetGranularAclsKind):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[GetGranularAclsResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
workspace=workspace,
|
||||
kind=kind,
|
||||
path=path,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
kind: GetGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[GetGranularAclsResponse200]:
|
||||
"""get granular acls
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
kind (GetGranularAclsKind):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[GetGranularAclsResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
kind=kind,
|
||||
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,
|
||||
kind: GetGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[GetGranularAclsResponse200]:
|
||||
"""get granular acls
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
kind (GetGranularAclsKind):
|
||||
path (str):
|
||||
|
||||
Returns:
|
||||
Response[GetGranularAclsResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
workspace=workspace,
|
||||
kind=kind,
|
||||
path=path,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,114 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.remove_granular_acls_json_body import RemoveGranularAclsJsonBody
|
||||
from ...models.remove_granular_acls_kind import RemoveGranularAclsKind
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
kind: RemoveGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: RemoveGranularAclsJsonBody,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/acls/remove/{kind}/{path}".format(
|
||||
client.base_url, workspace=workspace, kind=kind, 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,
|
||||
kind: RemoveGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: RemoveGranularAclsJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""remove granular acls
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
kind (RemoveGranularAclsKind):
|
||||
path (str):
|
||||
json_body (RemoveGranularAclsJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
kind=kind,
|
||||
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,
|
||||
kind: RemoveGranularAclsKind,
|
||||
path: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: RemoveGranularAclsJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""remove granular acls
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
kind (RemoveGranularAclsKind):
|
||||
path (str):
|
||||
json_body (RemoveGranularAclsJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
kind=kind,
|
||||
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