Skip to content

Commit fbfaf04

Browse files
authored
feat(edge_services): add include_cookies to cache-stage (#1042)
1 parent b6e0975 commit fbfaf04

File tree

6 files changed

+64
-2
lines changed

6 files changed

+64
-2
lines changed

scaleway-async/scaleway_async/edge_services/v1beta1/api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,7 @@ async def create_cache_stage(
11861186
self,
11871187
*,
11881188
fallback_ttl: Optional[str] = None,
1189+
include_cookies: Optional[bool] = None,
11891190
backend_stage_id: Optional[str] = None,
11901191
pipeline_id: str,
11911192
waf_stage_id: Optional[str] = None,
@@ -1195,6 +1196,7 @@ async def create_cache_stage(
11951196
Create cache stage.
11961197
Create a new cache stage. You must specify the `fallback_ttl` field to customize the TTL of the cache.
11971198
:param fallback_ttl: Time To Live (TTL) in seconds. Defines how long content is cached.
1199+
:param include_cookies: Defines whether responses to requests with cookies must be stored in the cache.
11981200
:param backend_stage_id: Backend stage ID the cache stage will be linked to.
11991201
One-Of ('next'): at most one of 'backend_stage_id', 'waf_stage_id', 'route_stage_id' could be set.
12001202
:param pipeline_id: Pipeline ID the Cache stage belongs to.
@@ -1220,6 +1222,7 @@ async def create_cache_stage(
12201222
body=marshal_CreateCacheStageRequest(
12211223
CreateCacheStageRequest(
12221224
fallback_ttl=fallback_ttl,
1225+
include_cookies=include_cookies,
12231226
pipeline_id=pipeline_id,
12241227
backend_stage_id=backend_stage_id,
12251228
waf_stage_id=waf_stage_id,
@@ -1266,15 +1269,17 @@ async def update_cache_stage(
12661269
*,
12671270
cache_stage_id: str,
12681271
fallback_ttl: Optional[str] = None,
1272+
include_cookies: Optional[bool] = None,
12691273
backend_stage_id: Optional[str] = None,
12701274
waf_stage_id: Optional[str] = None,
12711275
route_stage_id: Optional[str] = None,
12721276
) -> CacheStage:
12731277
"""
12741278
Update cache stage.
1275-
Update the parameters of an existing cache stage, specified by its `cache_stage_id`. Parameters which can be updated include the `fallback_ttl` and `backend_stage_id`.
1279+
Update the parameters of an existing cache stage, specified by its `cache_stage_id`. Parameters which can be updated include the `fallback_ttl`, `include_cookies` and `backend_stage_id`.
12761280
:param cache_stage_id: ID of the cache stage to update.
12771281
:param fallback_ttl: Time To Live (TTL) in seconds. Defines how long content is cached.
1282+
:param include_cookies: Defines whether responses to requests with cookies must be stored in the cache.
12781283
:param backend_stage_id: Backend stage ID the cache stage will be linked to.
12791284
One-Of ('next'): at most one of 'backend_stage_id', 'waf_stage_id', 'route_stage_id' could be set.
12801285
:param waf_stage_id:
@@ -1300,6 +1305,7 @@ async def update_cache_stage(
13001305
UpdateCacheStageRequest(
13011306
cache_stage_id=cache_stage_id,
13021307
fallback_ttl=fallback_ttl,
1308+
include_cookies=include_cookies,
13031309
backend_stage_id=backend_stage_id,
13041310
waf_stage_id=waf_stage_id,
13051311
route_stage_id=route_stage_id,

scaleway-async/scaleway_async/edge_services/v1beta1/marshalling.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ def unmarshal_CacheStage(data: Any) -> CacheStage:
226226
if field is not None:
227227
args["pipeline_id"] = field
228228

229+
field = data.get("include_cookies", None)
230+
if field is not None:
231+
args["include_cookies"] = field
232+
229233
field = data.get("fallback_ttl", None)
230234
if field is not None:
231235
args["fallback_ttl"] = field
@@ -1516,6 +1520,9 @@ def marshal_CreateCacheStageRequest(
15161520
if request.fallback_ttl is not None:
15171521
output["fallback_ttl"] = request.fallback_ttl
15181522

1523+
if request.include_cookies is not None:
1524+
output["include_cookies"] = request.include_cookies
1525+
15191526
return output
15201527

15211528

@@ -1783,6 +1790,9 @@ def marshal_UpdateCacheStageRequest(
17831790
if request.fallback_ttl is not None:
17841791
output["fallback_ttl"] = request.fallback_ttl
17851792

1793+
if request.include_cookies is not None:
1794+
output["include_cookies"] = request.include_cookies
1795+
17861796
return output
17871797

17881798

scaleway-async/scaleway_async/edge_services/v1beta1/types.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ class CacheStage:
402402
Pipeline ID the cache stage belongs to.
403403
"""
404404

405+
include_cookies: bool
406+
"""
407+
Defines whether responses to requests with cookies must be stored in the cache.
408+
"""
409+
405410
fallback_ttl: Optional[str]
406411
"""
407412
Time To Live (TTL) in seconds. Defines how long content is cached.
@@ -849,6 +854,11 @@ class CreateCacheStageRequest:
849854
Time To Live (TTL) in seconds. Defines how long content is cached.
850855
"""
851856

857+
include_cookies: Optional[bool]
858+
"""
859+
Defines whether responses to requests with cookies must be stored in the cache.
860+
"""
861+
852862
pipeline_id: str
853863
"""
854864
Pipeline ID the Cache stage belongs to.
@@ -1700,6 +1710,11 @@ class UpdateCacheStageRequest:
17001710
Time To Live (TTL) in seconds. Defines how long content is cached.
17011711
"""
17021712

1713+
include_cookies: Optional[bool]
1714+
"""
1715+
Defines whether responses to requests with cookies must be stored in the cache.
1716+
"""
1717+
17031718
backend_stage_id: Optional[str]
17041719

17051720
waf_stage_id: Optional[str]

scaleway/scaleway/edge_services/v1beta1/api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,7 @@ def create_cache_stage(
11841184
self,
11851185
*,
11861186
fallback_ttl: Optional[str] = None,
1187+
include_cookies: Optional[bool] = None,
11871188
backend_stage_id: Optional[str] = None,
11881189
pipeline_id: str,
11891190
waf_stage_id: Optional[str] = None,
@@ -1193,6 +1194,7 @@ def create_cache_stage(
11931194
Create cache stage.
11941195
Create a new cache stage. You must specify the `fallback_ttl` field to customize the TTL of the cache.
11951196
:param fallback_ttl: Time To Live (TTL) in seconds. Defines how long content is cached.
1197+
:param include_cookies: Defines whether responses to requests with cookies must be stored in the cache.
11961198
:param backend_stage_id: Backend stage ID the cache stage will be linked to.
11971199
One-Of ('next'): at most one of 'backend_stage_id', 'waf_stage_id', 'route_stage_id' could be set.
11981200
:param pipeline_id: Pipeline ID the Cache stage belongs to.
@@ -1218,6 +1220,7 @@ def create_cache_stage(
12181220
body=marshal_CreateCacheStageRequest(
12191221
CreateCacheStageRequest(
12201222
fallback_ttl=fallback_ttl,
1223+
include_cookies=include_cookies,
12211224
pipeline_id=pipeline_id,
12221225
backend_stage_id=backend_stage_id,
12231226
waf_stage_id=waf_stage_id,
@@ -1264,15 +1267,17 @@ def update_cache_stage(
12641267
*,
12651268
cache_stage_id: str,
12661269
fallback_ttl: Optional[str] = None,
1270+
include_cookies: Optional[bool] = None,
12671271
backend_stage_id: Optional[str] = None,
12681272
waf_stage_id: Optional[str] = None,
12691273
route_stage_id: Optional[str] = None,
12701274
) -> CacheStage:
12711275
"""
12721276
Update cache stage.
1273-
Update the parameters of an existing cache stage, specified by its `cache_stage_id`. Parameters which can be updated include the `fallback_ttl` and `backend_stage_id`.
1277+
Update the parameters of an existing cache stage, specified by its `cache_stage_id`. Parameters which can be updated include the `fallback_ttl`, `include_cookies` and `backend_stage_id`.
12741278
:param cache_stage_id: ID of the cache stage to update.
12751279
:param fallback_ttl: Time To Live (TTL) in seconds. Defines how long content is cached.
1280+
:param include_cookies: Defines whether responses to requests with cookies must be stored in the cache.
12761281
:param backend_stage_id: Backend stage ID the cache stage will be linked to.
12771282
One-Of ('next'): at most one of 'backend_stage_id', 'waf_stage_id', 'route_stage_id' could be set.
12781283
:param waf_stage_id:
@@ -1298,6 +1303,7 @@ def update_cache_stage(
12981303
UpdateCacheStageRequest(
12991304
cache_stage_id=cache_stage_id,
13001305
fallback_ttl=fallback_ttl,
1306+
include_cookies=include_cookies,
13011307
backend_stage_id=backend_stage_id,
13021308
waf_stage_id=waf_stage_id,
13031309
route_stage_id=route_stage_id,

scaleway/scaleway/edge_services/v1beta1/marshalling.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ def unmarshal_CacheStage(data: Any) -> CacheStage:
226226
if field is not None:
227227
args["pipeline_id"] = field
228228

229+
field = data.get("include_cookies", None)
230+
if field is not None:
231+
args["include_cookies"] = field
232+
229233
field = data.get("fallback_ttl", None)
230234
if field is not None:
231235
args["fallback_ttl"] = field
@@ -1516,6 +1520,9 @@ def marshal_CreateCacheStageRequest(
15161520
if request.fallback_ttl is not None:
15171521
output["fallback_ttl"] = request.fallback_ttl
15181522

1523+
if request.include_cookies is not None:
1524+
output["include_cookies"] = request.include_cookies
1525+
15191526
return output
15201527

15211528

@@ -1783,6 +1790,9 @@ def marshal_UpdateCacheStageRequest(
17831790
if request.fallback_ttl is not None:
17841791
output["fallback_ttl"] = request.fallback_ttl
17851792

1793+
if request.include_cookies is not None:
1794+
output["include_cookies"] = request.include_cookies
1795+
17861796
return output
17871797

17881798

scaleway/scaleway/edge_services/v1beta1/types.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ class CacheStage:
402402
Pipeline ID the cache stage belongs to.
403403
"""
404404

405+
include_cookies: bool
406+
"""
407+
Defines whether responses to requests with cookies must be stored in the cache.
408+
"""
409+
405410
fallback_ttl: Optional[str]
406411
"""
407412
Time To Live (TTL) in seconds. Defines how long content is cached.
@@ -849,6 +854,11 @@ class CreateCacheStageRequest:
849854
Time To Live (TTL) in seconds. Defines how long content is cached.
850855
"""
851856

857+
include_cookies: Optional[bool]
858+
"""
859+
Defines whether responses to requests with cookies must be stored in the cache.
860+
"""
861+
852862
pipeline_id: str
853863
"""
854864
Pipeline ID the Cache stage belongs to.
@@ -1700,6 +1710,11 @@ class UpdateCacheStageRequest:
17001710
Time To Live (TTL) in seconds. Defines how long content is cached.
17011711
"""
17021712

1713+
include_cookies: Optional[bool]
1714+
"""
1715+
Defines whether responses to requests with cookies must be stored in the cache.
1716+
"""
1717+
17031718
backend_stage_id: Optional[str]
17041719

17051720
waf_stage_id: Optional[str]

0 commit comments

Comments
 (0)