Skip to content

Commit 935fbc9

Browse files
committed
Update definitions to sync with 25.11
1 parent 0bc4c81 commit 935fbc9

File tree

1,150 files changed

+30104
-25553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,150 files changed

+30104
-25553
lines changed

docs/index.html

Lines changed: 34 additions & 18 deletions
Large diffs are not rendered by default.

pfapi_openapi.yml

Lines changed: 262 additions & 21 deletions
Large diffs are not rendered by default.

py/pfapi/api/aliases/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Contains endpoint functions for accessing the API"""

py/pfapi/api/aliases/firewall_add_alias.py

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from http import HTTPStatus
2-
from typing import Any, Dict, Optional, Union
2+
from typing import Any
33

44
import httpx
55

@@ -14,43 +14,42 @@
1414
def _get_kwargs(
1515
*,
1616
body: FWAliasReq,
17-
) -> Dict[str, Any]:
18-
headers: Dict[str, Any] = {}
17+
) -> dict[str, Any]:
18+
headers: dict[str, Any] = {}
1919

20-
_kwargs: Dict[str, Any] = {
20+
_kwargs: dict[str, Any] = {
2121
"method": "put",
2222
"url": "/aliases",
2323
}
2424

25-
_body = body.to_dict()
25+
_kwargs["json"] = body.to_dict()
2626

27-
_kwargs["json"] = _body
2827
headers["Content-Type"] = "application/json"
2928

3029
_kwargs["headers"] = headers
3130
return _kwargs
3231

3332

34-
def _parse_response(
35-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
36-
) -> Optional[Union[Error, PfsenseResult]]:
33+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | PfsenseResult | None:
3734
if response.status_code == 200:
3835
response_200 = PfsenseResult.from_dict(response.json())
3936

4037
return response_200
38+
4139
if response.status_code == 400:
4240
response_400 = Error.from_dict(response.json())
4341

4442
return response_400
43+
4544
if client.raise_on_unexpected_status:
4645
raise errors.UnexpectedStatus(response.status_code, response.content)
4746
else:
4847
return None
4948

5049

5150
def _build_response(
52-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
53-
) -> Response[Union[Error, PfsenseResult]]:
51+
*, client: AuthenticatedClient | Client, response: httpx.Response
52+
) -> Response[Error | PfsenseResult]:
5453
return Response(
5554
status_code=HTTPStatus(response.status_code),
5655
content=response.content,
@@ -61,9 +60,9 @@ def _build_response(
6160

6261
def sync_detailed(
6362
*,
64-
client: Union[AuthenticatedClient, Client],
63+
client: AuthenticatedClient | Client,
6564
body: FWAliasReq,
66-
) -> Response[Union[Error, PfsenseResult]]:
65+
) -> Response[Error | PfsenseResult]:
6766
"""Create a new alias
6867
6968
Args:
@@ -74,7 +73,7 @@ def sync_detailed(
7473
httpx.TimeoutException: If the request takes longer than Client.timeout.
7574
7675
Returns:
77-
Response[Union[Error, PfsenseResult]]
76+
Response[Error | PfsenseResult]
7877
"""
7978

8079
kwargs = _get_kwargs(
@@ -90,9 +89,9 @@ def sync_detailed(
9089

9190
def sync(
9291
*,
93-
client: Union[AuthenticatedClient, Client],
92+
client: AuthenticatedClient | Client,
9493
body: FWAliasReq,
95-
) -> Optional[Union[Error, PfsenseResult]]:
94+
) -> Error | PfsenseResult | None:
9695
"""Create a new alias
9796
9897
Args:
@@ -103,7 +102,7 @@ def sync(
103102
httpx.TimeoutException: If the request takes longer than Client.timeout.
104103
105104
Returns:
106-
Union[Error, PfsenseResult]
105+
Error | PfsenseResult
107106
"""
108107

109108
return sync_detailed(
@@ -114,9 +113,9 @@ def sync(
114113

115114
async def asyncio_detailed(
116115
*,
117-
client: Union[AuthenticatedClient, Client],
116+
client: AuthenticatedClient | Client,
118117
body: FWAliasReq,
119-
) -> Response[Union[Error, PfsenseResult]]:
118+
) -> Response[Error | PfsenseResult]:
120119
"""Create a new alias
121120
122121
Args:
@@ -127,7 +126,7 @@ async def asyncio_detailed(
127126
httpx.TimeoutException: If the request takes longer than Client.timeout.
128127
129128
Returns:
130-
Response[Union[Error, PfsenseResult]]
129+
Response[Error | PfsenseResult]
131130
"""
132131

133132
kwargs = _get_kwargs(
@@ -141,9 +140,9 @@ async def asyncio_detailed(
141140

142141
async def asyncio(
143142
*,
144-
client: Union[AuthenticatedClient, Client],
143+
client: AuthenticatedClient | Client,
145144
body: FWAliasReq,
146-
) -> Optional[Union[Error, PfsenseResult]]:
145+
) -> Error | PfsenseResult | None:
147146
"""Create a new alias
148147
149148
Args:
@@ -154,7 +153,7 @@ async def asyncio(
154153
httpx.TimeoutException: If the request takes longer than Client.timeout.
155154
156155
Returns:
157-
Union[Error, PfsenseResult]
156+
Error | PfsenseResult
158157
"""
159158

160159
return (

py/pfapi/api/aliases/firewall_delete_alias.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from http import HTTPStatus
2-
from typing import Any, Dict, Optional, Union
2+
from typing import Any
3+
from urllib.parse import quote
34

45
import httpx
56

@@ -12,35 +13,37 @@
1213

1314
def _get_kwargs(
1415
id: str,
15-
) -> Dict[str, Any]:
16-
_kwargs: Dict[str, Any] = {
16+
) -> dict[str, Any]:
17+
_kwargs: dict[str, Any] = {
1718
"method": "delete",
18-
"url": f"/aliases/{id}",
19+
"url": "/aliases/{id}".format(
20+
id=quote(str(id), safe=""),
21+
),
1922
}
2023

2124
return _kwargs
2225

2326

24-
def _parse_response(
25-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
26-
) -> Optional[Union[Error, PfsenseResult]]:
27+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | PfsenseResult | None:
2728
if response.status_code == 200:
2829
response_200 = PfsenseResult.from_dict(response.json())
2930

3031
return response_200
32+
3133
if response.status_code == 400:
3234
response_400 = Error.from_dict(response.json())
3335

3436
return response_400
37+
3538
if client.raise_on_unexpected_status:
3639
raise errors.UnexpectedStatus(response.status_code, response.content)
3740
else:
3841
return None
3942

4043

4144
def _build_response(
42-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
43-
) -> Response[Union[Error, PfsenseResult]]:
45+
*, client: AuthenticatedClient | Client, response: httpx.Response
46+
) -> Response[Error | PfsenseResult]:
4447
return Response(
4548
status_code=HTTPStatus(response.status_code),
4649
content=response.content,
@@ -52,8 +55,8 @@ def _build_response(
5255
def sync_detailed(
5356
id: str,
5457
*,
55-
client: Union[AuthenticatedClient, Client],
56-
) -> Response[Union[Error, PfsenseResult]]:
58+
client: AuthenticatedClient | Client,
59+
) -> Response[Error | PfsenseResult]:
5760
"""Delete alias
5861
5962
Args:
@@ -64,7 +67,7 @@ def sync_detailed(
6467
httpx.TimeoutException: If the request takes longer than Client.timeout.
6568
6669
Returns:
67-
Response[Union[Error, PfsenseResult]]
70+
Response[Error | PfsenseResult]
6871
"""
6972

7073
kwargs = _get_kwargs(
@@ -81,8 +84,8 @@ def sync_detailed(
8184
def sync(
8285
id: str,
8386
*,
84-
client: Union[AuthenticatedClient, Client],
85-
) -> Optional[Union[Error, PfsenseResult]]:
87+
client: AuthenticatedClient | Client,
88+
) -> Error | PfsenseResult | None:
8689
"""Delete alias
8790
8891
Args:
@@ -93,7 +96,7 @@ def sync(
9396
httpx.TimeoutException: If the request takes longer than Client.timeout.
9497
9598
Returns:
96-
Union[Error, PfsenseResult]
99+
Error | PfsenseResult
97100
"""
98101

99102
return sync_detailed(
@@ -105,8 +108,8 @@ def sync(
105108
async def asyncio_detailed(
106109
id: str,
107110
*,
108-
client: Union[AuthenticatedClient, Client],
109-
) -> Response[Union[Error, PfsenseResult]]:
111+
client: AuthenticatedClient | Client,
112+
) -> Response[Error | PfsenseResult]:
110113
"""Delete alias
111114
112115
Args:
@@ -117,7 +120,7 @@ async def asyncio_detailed(
117120
httpx.TimeoutException: If the request takes longer than Client.timeout.
118121
119122
Returns:
120-
Response[Union[Error, PfsenseResult]]
123+
Response[Error | PfsenseResult]
121124
"""
122125

123126
kwargs = _get_kwargs(
@@ -132,8 +135,8 @@ async def asyncio_detailed(
132135
async def asyncio(
133136
id: str,
134137
*,
135-
client: Union[AuthenticatedClient, Client],
136-
) -> Optional[Union[Error, PfsenseResult]]:
138+
client: AuthenticatedClient | Client,
139+
) -> Error | PfsenseResult | None:
137140
"""Delete alias
138141
139142
Args:
@@ -144,7 +147,7 @@ async def asyncio(
144147
httpx.TimeoutException: If the request takes longer than Client.timeout.
145148
146149
Returns:
147-
Union[Error, PfsenseResult]
150+
Error | PfsenseResult
148151
"""
149152

150153
return (

0 commit comments

Comments
 (0)