Skip to content

Commit f823846

Browse files
authored
feat(lb): update acl documentation (#50)
1 parent 058ecfe commit f823846

File tree

6 files changed

+56
-44
lines changed

6 files changed

+56
-44
lines changed

scaleway-async/scaleway_async/lb/v1/api.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,11 +2079,11 @@ async def create_acl(
20792079
*,
20802080
frontend_id: str,
20812081
action: AclAction,
2082-
match: AclMatch,
20832082
index: int,
20842083
description: str,
20852084
region: Optional[Region] = None,
20862085
name: Optional[str] = None,
2086+
match: Optional[AclMatch] = None,
20872087
) -> Acl:
20882088
"""
20892089
Create an ACL for a given frontend
@@ -2107,7 +2107,6 @@ async def create_acl(
21072107
result = await api.create_acl(
21082108
frontend_id="example",
21092109
action=AclAction(...),
2110-
match=AclMatch(...),
21112110
index=1,
21122111
description="example",
21132112
)
@@ -2125,11 +2124,11 @@ async def create_acl(
21252124
CreateAclRequest(
21262125
frontend_id=frontend_id,
21272126
action=action,
2128-
match=match,
21292127
index=index,
21302128
description=description,
21312129
region=region,
21322130
name=name or random_name(prefix="acl"),
2131+
match=match,
21332132
),
21342133
self.client,
21352134
),
@@ -2175,9 +2174,9 @@ async def update_acl(
21752174
acl_id: str,
21762175
name: str,
21772176
action: AclAction,
2178-
match: AclMatch,
21792177
index: int,
21802178
region: Optional[Region] = None,
2179+
match: Optional[AclMatch] = None,
21812180
description: Optional[str] = None,
21822181
) -> Acl:
21832182
"""
@@ -2198,7 +2197,6 @@ async def update_acl(
21982197
acl_id="example",
21992198
name="example",
22002199
action=AclAction(...),
2201-
match=AclMatch(...),
22022200
index=1,
22032201
)
22042202
"""
@@ -2216,9 +2214,9 @@ async def update_acl(
22162214
acl_id=acl_id,
22172215
name=name,
22182216
action=action,
2219-
match=match,
22202217
index=index,
22212218
region=region,
2219+
match=match,
22222220
description=description,
22232221
),
22242222
self.client,
@@ -4932,11 +4930,11 @@ async def create_acl(
49324930
*,
49334931
frontend_id: str,
49344932
action: AclAction,
4935-
match: AclMatch,
49364933
index: int,
49374934
description: str,
49384935
zone: Optional[Zone] = None,
49394936
name: Optional[str] = None,
4937+
match: Optional[AclMatch] = None,
49404938
) -> Acl:
49414939
"""
49424940
Create an ACL for a given frontend
@@ -4960,7 +4958,6 @@ async def create_acl(
49604958
result = await api.create_acl(
49614959
frontend_id="example",
49624960
action=AclAction(...),
4963-
match=AclMatch(...),
49644961
index=1,
49654962
description="example",
49664963
)
@@ -4976,11 +4973,11 @@ async def create_acl(
49764973
ZonedApiCreateAclRequest(
49774974
frontend_id=frontend_id,
49784975
action=action,
4979-
match=match,
49804976
index=index,
49814977
description=description,
49824978
zone=zone,
49834979
name=name or random_name(prefix="acl"),
4980+
match=match,
49844981
),
49854982
self.client,
49864983
),
@@ -5024,9 +5021,9 @@ async def update_acl(
50245021
acl_id: str,
50255022
name: str,
50265023
action: AclAction,
5027-
match: AclMatch,
50285024
index: int,
50295025
zone: Optional[Zone] = None,
5026+
match: Optional[AclMatch] = None,
50305027
description: Optional[str] = None,
50315028
) -> Acl:
50325029
"""
@@ -5047,7 +5044,6 @@ async def update_acl(
50475044
acl_id="example",
50485045
name="example",
50495046
action=AclAction(...),
5050-
match=AclMatch(...),
50515047
index=1,
50525048
)
50535049
"""
@@ -5063,9 +5059,9 @@ async def update_acl(
50635059
acl_id=acl_id,
50645060
name=name,
50655061
action=action,
5066-
match=match,
50675062
index=index,
50685063
zone=zone,
5064+
match=match,
50695065
description=description,
50705066
),
50715067
self.client,

scaleway-async/scaleway_async/lb/v1/marshalling.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,9 @@ def marshal_AclSpec(
12421242
"action": marshal_AclAction(request.action, defaults),
12431243
"description": request.description,
12441244
"index": request.index,
1245-
"match": marshal_AclMatch(request.match, defaults),
1245+
"match": marshal_AclMatch(request.match, defaults)
1246+
if request.match is not None
1247+
else None,
12461248
"name": request.name,
12471249
}
12481250

@@ -1369,7 +1371,9 @@ def marshal_CreateAclRequest(
13691371
"action": marshal_AclAction(request.action, defaults),
13701372
"description": request.description,
13711373
"index": request.index,
1372-
"match": marshal_AclMatch(request.match, defaults),
1374+
"match": marshal_AclMatch(request.match, defaults)
1375+
if request.match is not None
1376+
else None,
13731377
"name": request.name,
13741378
}
13751379

@@ -1568,7 +1572,9 @@ def marshal_UpdateAclRequest(
15681572
"action": marshal_AclAction(request.action, defaults),
15691573
"description": request.description,
15701574
"index": request.index,
1571-
"match": marshal_AclMatch(request.match, defaults),
1575+
"match": marshal_AclMatch(request.match, defaults)
1576+
if request.match is not None
1577+
else None,
15721578
"name": request.name,
15731579
}
15741580

@@ -1731,7 +1737,9 @@ def marshal_ZonedApiCreateAclRequest(
17311737
"action": marshal_AclAction(request.action, defaults),
17321738
"description": request.description,
17331739
"index": request.index,
1734-
"match": marshal_AclMatch(request.match, defaults),
1740+
"match": marshal_AclMatch(request.match, defaults)
1741+
if request.match is not None
1742+
else None,
17351743
"name": request.name,
17361744
}
17371745

@@ -1939,7 +1947,9 @@ def marshal_ZonedApiUpdateAclRequest(
19391947
"action": marshal_AclAction(request.action, defaults),
19401948
"description": request.description,
19411949
"index": request.index,
1942-
"match": marshal_AclMatch(request.match, defaults),
1950+
"match": marshal_AclMatch(request.match, defaults)
1951+
if request.match is not None
1952+
else None,
19431953
"name": request.name,
19441954
}
19451955

scaleway-async/scaleway_async/lb/v1/types.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ class AclSpec:
420420
Action to undertake when an ACL filter matches
421421
"""
422422

423-
match: AclMatch
423+
match: Optional[AclMatch]
424424
"""
425425
The ACL match rule. At least `ip_subnet` or `http_filter` and `http_filter_value` are required
426426
"""
@@ -2557,7 +2557,7 @@ class CreateAclRequest:
25572557
Action to undertake when an ACL filter matches
25582558
"""
25592559

2560-
match: AclMatch
2560+
match: Optional[AclMatch]
25612561
"""
25622562
The ACL match rule. You can have one of those three cases:
25632563
@@ -2613,7 +2613,7 @@ class UpdateAclRequest:
26132613
Action to undertake when an ACL filter matches
26142614
"""
26152615

2616-
match: AclMatch
2616+
match: Optional[AclMatch]
26172617
"""
26182618
The ACL match rule. At least `ip_subnet` or `http_filter` and `http_filter_value` are required
26192619
"""
@@ -4053,7 +4053,7 @@ class ZonedApiCreateAclRequest:
40534053
Action to undertake when an ACL filter matches
40544054
"""
40554055

4056-
match: AclMatch
4056+
match: Optional[AclMatch]
40574057
"""
40584058
The ACL match rule. You can have one of those three cases:
40594059
@@ -4109,7 +4109,7 @@ class ZonedApiUpdateAclRequest:
41094109
Action to undertake when an ACL filter matches
41104110
"""
41114111

4112-
match: AclMatch
4112+
match: Optional[AclMatch]
41134113
"""
41144114
The ACL match rule. At least `ip_subnet` or `http_filter` and `http_filter_value` are required
41154115
"""

scaleway/scaleway/lb/v1/api.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,11 +2079,11 @@ def create_acl(
20792079
*,
20802080
frontend_id: str,
20812081
action: AclAction,
2082-
match: AclMatch,
20832082
index: int,
20842083
description: str,
20852084
region: Optional[Region] = None,
20862085
name: Optional[str] = None,
2086+
match: Optional[AclMatch] = None,
20872087
) -> Acl:
20882088
"""
20892089
Create an ACL for a given frontend
@@ -2107,7 +2107,6 @@ def create_acl(
21072107
result = api.create_acl(
21082108
frontend_id="example",
21092109
action=AclAction(...),
2110-
match=AclMatch(...),
21112110
index=1,
21122111
description="example",
21132112
)
@@ -2125,11 +2124,11 @@ def create_acl(
21252124
CreateAclRequest(
21262125
frontend_id=frontend_id,
21272126
action=action,
2128-
match=match,
21292127
index=index,
21302128
description=description,
21312129
region=region,
21322130
name=name or random_name(prefix="acl"),
2131+
match=match,
21332132
),
21342133
self.client,
21352134
),
@@ -2175,9 +2174,9 @@ def update_acl(
21752174
acl_id: str,
21762175
name: str,
21772176
action: AclAction,
2178-
match: AclMatch,
21792177
index: int,
21802178
region: Optional[Region] = None,
2179+
match: Optional[AclMatch] = None,
21812180
description: Optional[str] = None,
21822181
) -> Acl:
21832182
"""
@@ -2198,7 +2197,6 @@ def update_acl(
21982197
acl_id="example",
21992198
name="example",
22002199
action=AclAction(...),
2201-
match=AclMatch(...),
22022200
index=1,
22032201
)
22042202
"""
@@ -2216,9 +2214,9 @@ def update_acl(
22162214
acl_id=acl_id,
22172215
name=name,
22182216
action=action,
2219-
match=match,
22202217
index=index,
22212218
region=region,
2219+
match=match,
22222220
description=description,
22232221
),
22242222
self.client,
@@ -4930,11 +4928,11 @@ def create_acl(
49304928
*,
49314929
frontend_id: str,
49324930
action: AclAction,
4933-
match: AclMatch,
49344931
index: int,
49354932
description: str,
49364933
zone: Optional[Zone] = None,
49374934
name: Optional[str] = None,
4935+
match: Optional[AclMatch] = None,
49384936
) -> Acl:
49394937
"""
49404938
Create an ACL for a given frontend
@@ -4958,7 +4956,6 @@ def create_acl(
49584956
result = api.create_acl(
49594957
frontend_id="example",
49604958
action=AclAction(...),
4961-
match=AclMatch(...),
49624959
index=1,
49634960
description="example",
49644961
)
@@ -4974,11 +4971,11 @@ def create_acl(
49744971
ZonedApiCreateAclRequest(
49754972
frontend_id=frontend_id,
49764973
action=action,
4977-
match=match,
49784974
index=index,
49794975
description=description,
49804976
zone=zone,
49814977
name=name or random_name(prefix="acl"),
4978+
match=match,
49824979
),
49834980
self.client,
49844981
),
@@ -5022,9 +5019,9 @@ def update_acl(
50225019
acl_id: str,
50235020
name: str,
50245021
action: AclAction,
5025-
match: AclMatch,
50265022
index: int,
50275023
zone: Optional[Zone] = None,
5024+
match: Optional[AclMatch] = None,
50285025
description: Optional[str] = None,
50295026
) -> Acl:
50305027
"""
@@ -5045,7 +5042,6 @@ def update_acl(
50455042
acl_id="example",
50465043
name="example",
50475044
action=AclAction(...),
5048-
match=AclMatch(...),
50495045
index=1,
50505046
)
50515047
"""
@@ -5061,9 +5057,9 @@ def update_acl(
50615057
acl_id=acl_id,
50625058
name=name,
50635059
action=action,
5064-
match=match,
50655060
index=index,
50665061
zone=zone,
5062+
match=match,
50675063
description=description,
50685064
),
50695065
self.client,

0 commit comments

Comments
 (0)