lsp
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.connect_callback_json_body import ConnectCallbackJsonBody
|
||||
from ...models.connect_callback_response_200 import ConnectCallbackResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
client_name: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: ConnectCallbackJsonBody,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/oauth/connect_callback/{client_name}".format(client.base_url, client_name=client_name)
|
||||
|
||||
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 _parse_response(*, response: httpx.Response) -> Optional[ConnectCallbackResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ConnectCallbackResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[ConnectCallbackResponse200]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
client_name: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: ConnectCallbackJsonBody,
|
||||
) -> Response[ConnectCallbackResponse200]:
|
||||
"""connect callback
|
||||
|
||||
Args:
|
||||
client_name (str):
|
||||
json_body (ConnectCallbackJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[ConnectCallbackResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client_name=client_name,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
client_name: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: ConnectCallbackJsonBody,
|
||||
) -> Optional[ConnectCallbackResponse200]:
|
||||
"""connect callback
|
||||
|
||||
Args:
|
||||
client_name (str):
|
||||
json_body (ConnectCallbackJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[ConnectCallbackResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client_name=client_name,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
client_name: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: ConnectCallbackJsonBody,
|
||||
) -> Response[ConnectCallbackResponse200]:
|
||||
"""connect callback
|
||||
|
||||
Args:
|
||||
client_name (str):
|
||||
json_body (ConnectCallbackJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[ConnectCallbackResponse200]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client_name=client_name,
|
||||
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_name: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: ConnectCallbackJsonBody,
|
||||
) -> Optional[ConnectCallbackResponse200]:
|
||||
"""connect callback
|
||||
|
||||
Args:
|
||||
client_name (str):
|
||||
json_body (ConnectCallbackJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[ConnectCallbackResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client_name=client_name,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,141 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.connect_slack_callback_json_body import ConnectSlackCallbackJsonBody
|
||||
from ...models.connect_slack_callback_response_200 import ConnectSlackCallbackResponse200
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: ConnectSlackCallbackJsonBody,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/oauth/connect_slack_callback".format(client.base_url)
|
||||
|
||||
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 _parse_response(*, response: httpx.Response) -> Optional[ConnectSlackCallbackResponse200]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ConnectSlackCallbackResponse200.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[ConnectSlackCallbackResponse200]:
|
||||
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: ConnectSlackCallbackJsonBody,
|
||||
) -> Response[ConnectSlackCallbackResponse200]:
|
||||
"""connect slack callback
|
||||
|
||||
Args:
|
||||
json_body (ConnectSlackCallbackJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[ConnectSlackCallbackResponse200]
|
||||
"""
|
||||
|
||||
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: ConnectSlackCallbackJsonBody,
|
||||
) -> Optional[ConnectSlackCallbackResponse200]:
|
||||
"""connect slack callback
|
||||
|
||||
Args:
|
||||
json_body (ConnectSlackCallbackJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[ConnectSlackCallbackResponse200]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
json_body: ConnectSlackCallbackJsonBody,
|
||||
) -> Response[ConnectSlackCallbackResponse200]:
|
||||
"""connect slack callback
|
||||
|
||||
Args:
|
||||
json_body (ConnectSlackCallbackJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[ConnectSlackCallbackResponse200]
|
||||
"""
|
||||
|
||||
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: ConnectSlackCallbackJsonBody,
|
||||
) -> Optional[ConnectSlackCallbackResponse200]:
|
||||
"""connect slack callback
|
||||
|
||||
Args:
|
||||
json_body (ConnectSlackCallbackJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[ConnectSlackCallbackResponse200]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,97 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.create_account_json_body import CreateAccountJsonBody
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: CreateAccountJsonBody,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/oauth/create_account".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: CreateAccountJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""create OAuth account
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (CreateAccountJsonBody):
|
||||
|
||||
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: CreateAccountJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""create OAuth account
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (CreateAccountJsonBody):
|
||||
|
||||
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,
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/oauth/disconnect/{id}".format(client.base_url, workspace=workspace, id=id)
|
||||
|
||||
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,
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""disconnect account
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""disconnect account
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
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,86 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/oauth/disconnect_slack".format(client.base_url, workspace=workspace)
|
||||
|
||||
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,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""disconnect slack
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""disconnect slack
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
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)
|
||||
@@ -0,0 +1,75 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/oauth/list_connects".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 _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(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""list oauth connects
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Any]:
|
||||
"""list oauth connects
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
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)
|
||||
@@ -0,0 +1,115 @@
|
||||
from typing import Any, Dict, List, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/oauth/list_logins".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[List[str]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = cast(List[str], response.json())
|
||||
|
||||
return response_200
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[List[str]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[List[str]]:
|
||||
"""list oauth logins
|
||||
|
||||
Returns:
|
||||
Response[List[str]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.request(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[List[str]]:
|
||||
"""list oauth logins
|
||||
|
||||
Returns:
|
||||
Response[List[str]]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[List[str]]:
|
||||
"""list oauth logins
|
||||
|
||||
Returns:
|
||||
Response[List[str]]
|
||||
"""
|
||||
|
||||
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[List[str]]:
|
||||
"""list oauth logins
|
||||
|
||||
Returns:
|
||||
Response[List[str]]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,104 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.refresh_token_json_body import RefreshTokenJsonBody
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: RefreshTokenJsonBody,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/oauth/refresh_token/{id}".format(client.base_url, workspace=workspace, id=id)
|
||||
|
||||
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,
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: RefreshTokenJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""refresh token
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
json_body (RefreshTokenJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
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,
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: RefreshTokenJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""refresh token
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
id (str):
|
||||
json_body (RefreshTokenJsonBody):
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
workspace=workspace,
|
||||
id=id,
|
||||
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,97 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.set_workspace_slack_json_body import SetWorkspaceSlackJsonBody
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
workspace: str,
|
||||
*,
|
||||
client: Client,
|
||||
json_body: SetWorkspaceSlackJsonBody,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/w/{workspace}/oauth/set_workspace_slack".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: SetWorkspaceSlackJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""set workspace's slack
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (SetWorkspaceSlackJsonBody):
|
||||
|
||||
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: SetWorkspaceSlackJsonBody,
|
||||
) -> Response[Any]:
|
||||
"""set workspace's slack
|
||||
|
||||
Args:
|
||||
workspace (str):
|
||||
json_body (SetWorkspaceSlackJsonBody):
|
||||
|
||||
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)
|
||||
Reference in New Issue
Block a user