Skip to content

feat(edge_services): add include_cookies to cache-stage #1042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,7 @@ async def create_cache_stage(
self,
*,
fallback_ttl: Optional[str] = None,
include_cookies: Optional[bool] = None,
backend_stage_id: Optional[str] = None,
pipeline_id: str,
waf_stage_id: Optional[str] = None,
Expand All @@ -1195,6 +1196,7 @@ async def create_cache_stage(
Create cache stage.
Create a new cache stage. You must specify the `fallback_ttl` field to customize the TTL of the cache.
:param fallback_ttl: Time To Live (TTL) in seconds. Defines how long content is cached.
:param include_cookies: Defines whether responses to requests with cookies must be stored in the cache.
:param backend_stage_id: Backend stage ID the cache stage will be linked to.
One-Of ('next'): at most one of 'backend_stage_id', 'waf_stage_id', 'route_stage_id' could be set.
:param pipeline_id: Pipeline ID the Cache stage belongs to.
Expand All @@ -1220,6 +1222,7 @@ async def create_cache_stage(
body=marshal_CreateCacheStageRequest(
CreateCacheStageRequest(
fallback_ttl=fallback_ttl,
include_cookies=include_cookies,
pipeline_id=pipeline_id,
backend_stage_id=backend_stage_id,
waf_stage_id=waf_stage_id,
Expand Down Expand Up @@ -1266,15 +1269,17 @@ async def update_cache_stage(
*,
cache_stage_id: str,
fallback_ttl: Optional[str] = None,
include_cookies: Optional[bool] = None,
backend_stage_id: Optional[str] = None,
waf_stage_id: Optional[str] = None,
route_stage_id: Optional[str] = None,
) -> CacheStage:
"""
Update cache stage.
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`.
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`.
:param cache_stage_id: ID of the cache stage to update.
:param fallback_ttl: Time To Live (TTL) in seconds. Defines how long content is cached.
:param include_cookies: Defines whether responses to requests with cookies must be stored in the cache.
:param backend_stage_id: Backend stage ID the cache stage will be linked to.
One-Of ('next'): at most one of 'backend_stage_id', 'waf_stage_id', 'route_stage_id' could be set.
:param waf_stage_id:
Expand All @@ -1300,6 +1305,7 @@ async def update_cache_stage(
UpdateCacheStageRequest(
cache_stage_id=cache_stage_id,
fallback_ttl=fallback_ttl,
include_cookies=include_cookies,
backend_stage_id=backend_stage_id,
waf_stage_id=waf_stage_id,
route_stage_id=route_stage_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ def unmarshal_CacheStage(data: Any) -> CacheStage:
if field is not None:
args["pipeline_id"] = field

field = data.get("include_cookies", None)
if field is not None:
args["include_cookies"] = field

field = data.get("fallback_ttl", None)
if field is not None:
args["fallback_ttl"] = field
Expand Down Expand Up @@ -1516,6 +1520,9 @@ def marshal_CreateCacheStageRequest(
if request.fallback_ttl is not None:
output["fallback_ttl"] = request.fallback_ttl

if request.include_cookies is not None:
output["include_cookies"] = request.include_cookies

return output


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

if request.include_cookies is not None:
output["include_cookies"] = request.include_cookies

return output


Expand Down
15 changes: 15 additions & 0 deletions scaleway-async/scaleway_async/edge_services/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ class CacheStage:
Pipeline ID the cache stage belongs to.
"""

include_cookies: bool
"""
Defines whether responses to requests with cookies must be stored in the cache.
"""

fallback_ttl: Optional[str]
"""
Time To Live (TTL) in seconds. Defines how long content is cached.
Expand Down Expand Up @@ -849,6 +854,11 @@ class CreateCacheStageRequest:
Time To Live (TTL) in seconds. Defines how long content is cached.
"""

include_cookies: Optional[bool]
"""
Defines whether responses to requests with cookies must be stored in the cache.
"""

pipeline_id: str
"""
Pipeline ID the Cache stage belongs to.
Expand Down Expand Up @@ -1700,6 +1710,11 @@ class UpdateCacheStageRequest:
Time To Live (TTL) in seconds. Defines how long content is cached.
"""

include_cookies: Optional[bool]
"""
Defines whether responses to requests with cookies must be stored in the cache.
"""

backend_stage_id: Optional[str]

waf_stage_id: Optional[str]
Expand Down
8 changes: 7 additions & 1 deletion scaleway/scaleway/edge_services/v1beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,7 @@ def create_cache_stage(
self,
*,
fallback_ttl: Optional[str] = None,
include_cookies: Optional[bool] = None,
backend_stage_id: Optional[str] = None,
pipeline_id: str,
waf_stage_id: Optional[str] = None,
Expand All @@ -1193,6 +1194,7 @@ def create_cache_stage(
Create cache stage.
Create a new cache stage. You must specify the `fallback_ttl` field to customize the TTL of the cache.
:param fallback_ttl: Time To Live (TTL) in seconds. Defines how long content is cached.
:param include_cookies: Defines whether responses to requests with cookies must be stored in the cache.
:param backend_stage_id: Backend stage ID the cache stage will be linked to.
One-Of ('next'): at most one of 'backend_stage_id', 'waf_stage_id', 'route_stage_id' could be set.
:param pipeline_id: Pipeline ID the Cache stage belongs to.
Expand All @@ -1218,6 +1220,7 @@ def create_cache_stage(
body=marshal_CreateCacheStageRequest(
CreateCacheStageRequest(
fallback_ttl=fallback_ttl,
include_cookies=include_cookies,
pipeline_id=pipeline_id,
backend_stage_id=backend_stage_id,
waf_stage_id=waf_stage_id,
Expand Down Expand Up @@ -1264,15 +1267,17 @@ def update_cache_stage(
*,
cache_stage_id: str,
fallback_ttl: Optional[str] = None,
include_cookies: Optional[bool] = None,
backend_stage_id: Optional[str] = None,
waf_stage_id: Optional[str] = None,
route_stage_id: Optional[str] = None,
) -> CacheStage:
"""
Update cache stage.
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`.
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`.
:param cache_stage_id: ID of the cache stage to update.
:param fallback_ttl: Time To Live (TTL) in seconds. Defines how long content is cached.
:param include_cookies: Defines whether responses to requests with cookies must be stored in the cache.
:param backend_stage_id: Backend stage ID the cache stage will be linked to.
One-Of ('next'): at most one of 'backend_stage_id', 'waf_stage_id', 'route_stage_id' could be set.
:param waf_stage_id:
Expand All @@ -1298,6 +1303,7 @@ def update_cache_stage(
UpdateCacheStageRequest(
cache_stage_id=cache_stage_id,
fallback_ttl=fallback_ttl,
include_cookies=include_cookies,
backend_stage_id=backend_stage_id,
waf_stage_id=waf_stage_id,
route_stage_id=route_stage_id,
Expand Down
10 changes: 10 additions & 0 deletions scaleway/scaleway/edge_services/v1beta1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ def unmarshal_CacheStage(data: Any) -> CacheStage:
if field is not None:
args["pipeline_id"] = field

field = data.get("include_cookies", None)
if field is not None:
args["include_cookies"] = field

field = data.get("fallback_ttl", None)
if field is not None:
args["fallback_ttl"] = field
Expand Down Expand Up @@ -1516,6 +1520,9 @@ def marshal_CreateCacheStageRequest(
if request.fallback_ttl is not None:
output["fallback_ttl"] = request.fallback_ttl

if request.include_cookies is not None:
output["include_cookies"] = request.include_cookies

return output


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

if request.include_cookies is not None:
output["include_cookies"] = request.include_cookies

return output


Expand Down
15 changes: 15 additions & 0 deletions scaleway/scaleway/edge_services/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ class CacheStage:
Pipeline ID the cache stage belongs to.
"""

include_cookies: bool
"""
Defines whether responses to requests with cookies must be stored in the cache.
"""

fallback_ttl: Optional[str]
"""
Time To Live (TTL) in seconds. Defines how long content is cached.
Expand Down Expand Up @@ -849,6 +854,11 @@ class CreateCacheStageRequest:
Time To Live (TTL) in seconds. Defines how long content is cached.
"""

include_cookies: Optional[bool]
"""
Defines whether responses to requests with cookies must be stored in the cache.
"""

pipeline_id: str
"""
Pipeline ID the Cache stage belongs to.
Expand Down Expand Up @@ -1700,6 +1710,11 @@ class UpdateCacheStageRequest:
Time To Live (TTL) in seconds. Defines how long content is cached.
"""

include_cookies: Optional[bool]
"""
Defines whether responses to requests with cookies must be stored in the cache.
"""

backend_stage_id: Optional[str]

waf_stage_id: Optional[str]
Expand Down