windmill-api 1.461.1__py3-none-any.whl → 1.462.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of windmill-api might be problematic. Click here for more details.

@@ -0,0 +1,93 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ workspace: str,
13
+ ) -> Dict[str, Any]:
14
+ pass
15
+
16
+ return {
17
+ "method": "post",
18
+ "url": "/w/{workspace}/oauth/disconnect_teams".format(
19
+ workspace=workspace,
20
+ ),
21
+ }
22
+
23
+
24
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
25
+ if client.raise_on_unexpected_status:
26
+ raise errors.UnexpectedStatus(response.status_code, response.content)
27
+ else:
28
+ return None
29
+
30
+
31
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
32
+ return Response(
33
+ status_code=HTTPStatus(response.status_code),
34
+ content=response.content,
35
+ headers=response.headers,
36
+ parsed=_parse_response(client=client, response=response),
37
+ )
38
+
39
+
40
+ def sync_detailed(
41
+ workspace: str,
42
+ *,
43
+ client: Union[AuthenticatedClient, Client],
44
+ ) -> Response[Any]:
45
+ """disconnect teams
46
+
47
+ Args:
48
+ workspace (str):
49
+
50
+ Raises:
51
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
52
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
53
+
54
+ Returns:
55
+ Response[Any]
56
+ """
57
+
58
+ kwargs = _get_kwargs(
59
+ workspace=workspace,
60
+ )
61
+
62
+ response = client.get_httpx_client().request(
63
+ **kwargs,
64
+ )
65
+
66
+ return _build_response(client=client, response=response)
67
+
68
+
69
+ async def asyncio_detailed(
70
+ workspace: str,
71
+ *,
72
+ client: Union[AuthenticatedClient, Client],
73
+ ) -> Response[Any]:
74
+ """disconnect teams
75
+
76
+ Args:
77
+ workspace (str):
78
+
79
+ Raises:
80
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
82
+
83
+ Returns:
84
+ Response[Any]
85
+ """
86
+
87
+ kwargs = _get_kwargs(
88
+ workspace=workspace,
89
+ )
90
+
91
+ response = await client.get_async_httpx_client().request(**kwargs)
92
+
93
+ return _build_response(client=client, response=response)
@@ -0,0 +1,102 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.send_message_to_conversation_json_body import SendMessageToConversationJsonBody
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ json_body: SendMessageToConversationJsonBody,
15
+ ) -> Dict[str, Any]:
16
+ pass
17
+
18
+ json_json_body = json_body.to_dict()
19
+
20
+ return {
21
+ "method": "post",
22
+ "url": "/teams/activities",
23
+ "json": json_json_body,
24
+ }
25
+
26
+
27
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
28
+ if response.status_code == HTTPStatus.OK:
29
+ return None
30
+ if client.raise_on_unexpected_status:
31
+ raise errors.UnexpectedStatus(response.status_code, response.content)
32
+ else:
33
+ return None
34
+
35
+
36
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
37
+ return Response(
38
+ status_code=HTTPStatus(response.status_code),
39
+ content=response.content,
40
+ headers=response.headers,
41
+ parsed=_parse_response(client=client, response=response),
42
+ )
43
+
44
+
45
+ def sync_detailed(
46
+ *,
47
+ client: Union[AuthenticatedClient, Client],
48
+ json_body: SendMessageToConversationJsonBody,
49
+ ) -> Response[Any]:
50
+ """send update to Microsoft Teams activity
51
+
52
+ Respond to a Microsoft Teams activity after a workspace command is run
53
+
54
+ Args:
55
+ json_body (SendMessageToConversationJsonBody):
56
+
57
+ Raises:
58
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
59
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
60
+
61
+ Returns:
62
+ Response[Any]
63
+ """
64
+
65
+ kwargs = _get_kwargs(
66
+ json_body=json_body,
67
+ )
68
+
69
+ response = client.get_httpx_client().request(
70
+ **kwargs,
71
+ )
72
+
73
+ return _build_response(client=client, response=response)
74
+
75
+
76
+ async def asyncio_detailed(
77
+ *,
78
+ client: Union[AuthenticatedClient, Client],
79
+ json_body: SendMessageToConversationJsonBody,
80
+ ) -> Response[Any]:
81
+ """send update to Microsoft Teams activity
82
+
83
+ Respond to a Microsoft Teams activity after a workspace command is run
84
+
85
+ Args:
86
+ json_body (SendMessageToConversationJsonBody):
87
+
88
+ Raises:
89
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
90
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
91
+
92
+ Returns:
93
+ Response[Any]
94
+ """
95
+
96
+ kwargs = _get_kwargs(
97
+ json_body=json_body,
98
+ )
99
+
100
+ response = await client.get_async_httpx_client().request(**kwargs)
101
+
102
+ return _build_response(client=client, response=response)
@@ -0,0 +1,105 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.connect_teams_json_body import ConnectTeamsJsonBody
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace: str,
14
+ *,
15
+ json_body: ConnectTeamsJsonBody,
16
+ ) -> Dict[str, Any]:
17
+ pass
18
+
19
+ json_json_body = json_body.to_dict()
20
+
21
+ return {
22
+ "method": "post",
23
+ "url": "/w/{workspace}/workspaces/connect_teams".format(
24
+ workspace=workspace,
25
+ ),
26
+ "json": json_json_body,
27
+ }
28
+
29
+
30
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
31
+ if client.raise_on_unexpected_status:
32
+ raise errors.UnexpectedStatus(response.status_code, response.content)
33
+ else:
34
+ return None
35
+
36
+
37
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
38
+ return Response(
39
+ status_code=HTTPStatus(response.status_code),
40
+ content=response.content,
41
+ headers=response.headers,
42
+ parsed=_parse_response(client=client, response=response),
43
+ )
44
+
45
+
46
+ def sync_detailed(
47
+ workspace: str,
48
+ *,
49
+ client: Union[AuthenticatedClient, Client],
50
+ json_body: ConnectTeamsJsonBody,
51
+ ) -> Response[Any]:
52
+ """connect teams
53
+
54
+ Args:
55
+ workspace (str):
56
+ json_body (ConnectTeamsJsonBody):
57
+
58
+ Raises:
59
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
61
+
62
+ Returns:
63
+ Response[Any]
64
+ """
65
+
66
+ kwargs = _get_kwargs(
67
+ workspace=workspace,
68
+ json_body=json_body,
69
+ )
70
+
71
+ response = client.get_httpx_client().request(
72
+ **kwargs,
73
+ )
74
+
75
+ return _build_response(client=client, response=response)
76
+
77
+
78
+ async def asyncio_detailed(
79
+ workspace: str,
80
+ *,
81
+ client: Union[AuthenticatedClient, Client],
82
+ json_body: ConnectTeamsJsonBody,
83
+ ) -> Response[Any]:
84
+ """connect teams
85
+
86
+ Args:
87
+ workspace (str):
88
+ json_body (ConnectTeamsJsonBody):
89
+
90
+ Raises:
91
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
92
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
93
+
94
+ Returns:
95
+ Response[Any]
96
+ """
97
+
98
+ kwargs = _get_kwargs(
99
+ workspace=workspace,
100
+ json_body=json_body,
101
+ )
102
+
103
+ response = await client.get_async_httpx_client().request(**kwargs)
104
+
105
+ return _build_response(client=client, response=response)
@@ -0,0 +1,105 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.edit_teams_command_json_body import EditTeamsCommandJsonBody
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace: str,
14
+ *,
15
+ json_body: EditTeamsCommandJsonBody,
16
+ ) -> Dict[str, Any]:
17
+ pass
18
+
19
+ json_json_body = json_body.to_dict()
20
+
21
+ return {
22
+ "method": "post",
23
+ "url": "/w/{workspace}/workspaces/edit_teams_command".format(
24
+ workspace=workspace,
25
+ ),
26
+ "json": json_json_body,
27
+ }
28
+
29
+
30
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
31
+ if client.raise_on_unexpected_status:
32
+ raise errors.UnexpectedStatus(response.status_code, response.content)
33
+ else:
34
+ return None
35
+
36
+
37
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
38
+ return Response(
39
+ status_code=HTTPStatus(response.status_code),
40
+ content=response.content,
41
+ headers=response.headers,
42
+ parsed=_parse_response(client=client, response=response),
43
+ )
44
+
45
+
46
+ def sync_detailed(
47
+ workspace: str,
48
+ *,
49
+ client: Union[AuthenticatedClient, Client],
50
+ json_body: EditTeamsCommandJsonBody,
51
+ ) -> Response[Any]:
52
+ """edit teams command
53
+
54
+ Args:
55
+ workspace (str):
56
+ json_body (EditTeamsCommandJsonBody):
57
+
58
+ Raises:
59
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
61
+
62
+ Returns:
63
+ Response[Any]
64
+ """
65
+
66
+ kwargs = _get_kwargs(
67
+ workspace=workspace,
68
+ json_body=json_body,
69
+ )
70
+
71
+ response = client.get_httpx_client().request(
72
+ **kwargs,
73
+ )
74
+
75
+ return _build_response(client=client, response=response)
76
+
77
+
78
+ async def asyncio_detailed(
79
+ workspace: str,
80
+ *,
81
+ client: Union[AuthenticatedClient, Client],
82
+ json_body: EditTeamsCommandJsonBody,
83
+ ) -> Response[Any]:
84
+ """edit teams command
85
+
86
+ Args:
87
+ workspace (str):
88
+ json_body (EditTeamsCommandJsonBody):
89
+
90
+ Raises:
91
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
92
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
93
+
94
+ Returns:
95
+ Response[Any]
96
+ """
97
+
98
+ kwargs = _get_kwargs(
99
+ workspace=workspace,
100
+ json_body=json_body,
101
+ )
102
+
103
+ response = await client.get_async_httpx_client().request(**kwargs)
104
+
105
+ return _build_response(client=client, response=response)
@@ -0,0 +1,157 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, List, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.list_available_teams_channels_response_200_item import ListAvailableTeamsChannelsResponse200Item
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace: str,
14
+ ) -> Dict[str, Any]:
15
+ pass
16
+
17
+ return {
18
+ "method": "get",
19
+ "url": "/w/{workspace}/workspaces/available_teams_channels".format(
20
+ workspace=workspace,
21
+ ),
22
+ }
23
+
24
+
25
+ def _parse_response(
26
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
27
+ ) -> Optional[List["ListAvailableTeamsChannelsResponse200Item"]]:
28
+ if response.status_code == HTTPStatus.OK:
29
+ response_200 = []
30
+ _response_200 = response.json()
31
+ for response_200_item_data in _response_200:
32
+ response_200_item = ListAvailableTeamsChannelsResponse200Item.from_dict(response_200_item_data)
33
+
34
+ response_200.append(response_200_item)
35
+
36
+ return response_200
37
+ if client.raise_on_unexpected_status:
38
+ raise errors.UnexpectedStatus(response.status_code, response.content)
39
+ else:
40
+ return None
41
+
42
+
43
+ def _build_response(
44
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
45
+ ) -> Response[List["ListAvailableTeamsChannelsResponse200Item"]]:
46
+ return Response(
47
+ status_code=HTTPStatus(response.status_code),
48
+ content=response.content,
49
+ headers=response.headers,
50
+ parsed=_parse_response(client=client, response=response),
51
+ )
52
+
53
+
54
+ def sync_detailed(
55
+ workspace: str,
56
+ *,
57
+ client: Union[AuthenticatedClient, Client],
58
+ ) -> Response[List["ListAvailableTeamsChannelsResponse200Item"]]:
59
+ """list available teams channels
60
+
61
+ Args:
62
+ workspace (str):
63
+
64
+ Raises:
65
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
66
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
67
+
68
+ Returns:
69
+ Response[List['ListAvailableTeamsChannelsResponse200Item']]
70
+ """
71
+
72
+ kwargs = _get_kwargs(
73
+ workspace=workspace,
74
+ )
75
+
76
+ response = client.get_httpx_client().request(
77
+ **kwargs,
78
+ )
79
+
80
+ return _build_response(client=client, response=response)
81
+
82
+
83
+ def sync(
84
+ workspace: str,
85
+ *,
86
+ client: Union[AuthenticatedClient, Client],
87
+ ) -> Optional[List["ListAvailableTeamsChannelsResponse200Item"]]:
88
+ """list available teams channels
89
+
90
+ Args:
91
+ workspace (str):
92
+
93
+ Raises:
94
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
95
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
96
+
97
+ Returns:
98
+ List['ListAvailableTeamsChannelsResponse200Item']
99
+ """
100
+
101
+ return sync_detailed(
102
+ workspace=workspace,
103
+ client=client,
104
+ ).parsed
105
+
106
+
107
+ async def asyncio_detailed(
108
+ workspace: str,
109
+ *,
110
+ client: Union[AuthenticatedClient, Client],
111
+ ) -> Response[List["ListAvailableTeamsChannelsResponse200Item"]]:
112
+ """list available teams channels
113
+
114
+ Args:
115
+ workspace (str):
116
+
117
+ Raises:
118
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
119
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
120
+
121
+ Returns:
122
+ Response[List['ListAvailableTeamsChannelsResponse200Item']]
123
+ """
124
+
125
+ kwargs = _get_kwargs(
126
+ workspace=workspace,
127
+ )
128
+
129
+ response = await client.get_async_httpx_client().request(**kwargs)
130
+
131
+ return _build_response(client=client, response=response)
132
+
133
+
134
+ async def asyncio(
135
+ workspace: str,
136
+ *,
137
+ client: Union[AuthenticatedClient, Client],
138
+ ) -> Optional[List["ListAvailableTeamsChannelsResponse200Item"]]:
139
+ """list available teams channels
140
+
141
+ Args:
142
+ workspace (str):
143
+
144
+ Raises:
145
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
146
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
147
+
148
+ Returns:
149
+ List['ListAvailableTeamsChannelsResponse200Item']
150
+ """
151
+
152
+ return (
153
+ await asyncio_detailed(
154
+ workspace=workspace,
155
+ client=client,
156
+ )
157
+ ).parsed