22
33from __future__ import annotations
44
5- from typing import Optional
5+ from typing import Iterable , Optional
66
77import httpx
88
1919)
2020from ..pagination import SyncNetworkPoliciesCursorIDPage , AsyncNetworkPoliciesCursorIDPage
2121from .._base_client import AsyncPaginator , make_request_options
22+ from ..types .allowed_cidr_param import AllowedCidrParam
2223from ..types .network_policy_view import NetworkPolicyView
2324
2425__all__ = ["NetworkPoliciesResource" , "AsyncNetworkPoliciesResource" ]
@@ -52,6 +53,7 @@ def create(
5253 allow_all : Optional [bool ] | Omit = omit ,
5354 allow_devbox_to_devbox : Optional [bool ] | Omit = omit ,
5455 allow_mcp_gateway : Optional [bool ] | Omit = omit ,
56+ allowed_cidrs : Optional [Iterable [AllowedCidrParam ]] | Omit = omit ,
5557 allowed_hostnames : Optional [SequenceNotStr [str ]] | Omit = omit ,
5658 description : Optional [str ] | Omit = omit ,
5759 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -84,6 +86,10 @@ def create(
8486 allow_mcp_gateway: (Optional) If true, allows devbox egress to the MCP hub for MCP server access.
8587 Defaults to false.
8688
89+ allowed_cidrs: (Optional) IPv4 CIDR-based allow list with optional port restrictions, additive
90+ with allowed_hostnames. Example: [{'cidr': '10.12.0.0/16', 'ports': [{'port':
91+ 443}]}].
92+
8793 allowed_hostnames: (Optional) DNS-based allow list with wildcard support. Examples: ['github.com',
8894 '*.npmjs.org'].
8995
@@ -108,6 +114,7 @@ def create(
108114 "allow_all" : allow_all ,
109115 "allow_devbox_to_devbox" : allow_devbox_to_devbox ,
110116 "allow_mcp_gateway" : allow_mcp_gateway ,
117+ "allowed_cidrs" : allowed_cidrs ,
111118 "allowed_hostnames" : allowed_hostnames ,
112119 "description" : description ,
113120 },
@@ -164,6 +171,7 @@ def update(
164171 allow_all : Optional [bool ] | Omit = omit ,
165172 allow_devbox_to_devbox : Optional [bool ] | Omit = omit ,
166173 allow_mcp_gateway : Optional [bool ] | Omit = omit ,
174+ allowed_cidrs : Optional [Iterable [AllowedCidrParam ]] | Omit = omit ,
167175 allowed_hostnames : Optional [SequenceNotStr [str ]] | Omit = omit ,
168176 description : Optional [str ] | Omit = omit ,
169177 name : Optional [str ] | Omit = omit ,
@@ -188,6 +196,9 @@ def update(
188196
189197 allow_mcp_gateway: If true, allows devbox egress to the MCP hub.
190198
199+ allowed_cidrs: Updated IPv4 CIDR-based allow list with optional port restrictions, additive
200+ with allowed_hostnames.
201+
191202 allowed_hostnames: Updated DNS-based allow list with wildcard support. Examples: ['github.com',
192203 '*.npmjs.org'].
193204
@@ -215,6 +226,7 @@ def update(
215226 "allow_all" : allow_all ,
216227 "allow_devbox_to_devbox" : allow_devbox_to_devbox ,
217228 "allow_mcp_gateway" : allow_mcp_gateway ,
229+ "allowed_cidrs" : allowed_cidrs ,
218230 "allowed_hostnames" : allowed_hostnames ,
219231 "description" : description ,
220232 "name" : name ,
@@ -365,6 +377,7 @@ async def create(
365377 allow_all : Optional [bool ] | Omit = omit ,
366378 allow_devbox_to_devbox : Optional [bool ] | Omit = omit ,
367379 allow_mcp_gateway : Optional [bool ] | Omit = omit ,
380+ allowed_cidrs : Optional [Iterable [AllowedCidrParam ]] | Omit = omit ,
368381 allowed_hostnames : Optional [SequenceNotStr [str ]] | Omit = omit ,
369382 description : Optional [str ] | Omit = omit ,
370383 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -397,6 +410,10 @@ async def create(
397410 allow_mcp_gateway: (Optional) If true, allows devbox egress to the MCP hub for MCP server access.
398411 Defaults to false.
399412
413+ allowed_cidrs: (Optional) IPv4 CIDR-based allow list with optional port restrictions, additive
414+ with allowed_hostnames. Example: [{'cidr': '10.12.0.0/16', 'ports': [{'port':
415+ 443}]}].
416+
400417 allowed_hostnames: (Optional) DNS-based allow list with wildcard support. Examples: ['github.com',
401418 '*.npmjs.org'].
402419
@@ -421,6 +438,7 @@ async def create(
421438 "allow_all" : allow_all ,
422439 "allow_devbox_to_devbox" : allow_devbox_to_devbox ,
423440 "allow_mcp_gateway" : allow_mcp_gateway ,
441+ "allowed_cidrs" : allowed_cidrs ,
424442 "allowed_hostnames" : allowed_hostnames ,
425443 "description" : description ,
426444 },
@@ -477,6 +495,7 @@ async def update(
477495 allow_all : Optional [bool ] | Omit = omit ,
478496 allow_devbox_to_devbox : Optional [bool ] | Omit = omit ,
479497 allow_mcp_gateway : Optional [bool ] | Omit = omit ,
498+ allowed_cidrs : Optional [Iterable [AllowedCidrParam ]] | Omit = omit ,
480499 allowed_hostnames : Optional [SequenceNotStr [str ]] | Omit = omit ,
481500 description : Optional [str ] | Omit = omit ,
482501 name : Optional [str ] | Omit = omit ,
@@ -501,6 +520,9 @@ async def update(
501520
502521 allow_mcp_gateway: If true, allows devbox egress to the MCP hub.
503522
523+ allowed_cidrs: Updated IPv4 CIDR-based allow list with optional port restrictions, additive
524+ with allowed_hostnames.
525+
504526 allowed_hostnames: Updated DNS-based allow list with wildcard support. Examples: ['github.com',
505527 '*.npmjs.org'].
506528
@@ -528,6 +550,7 @@ async def update(
528550 "allow_all" : allow_all ,
529551 "allow_devbox_to_devbox" : allow_devbox_to_devbox ,
530552 "allow_mcp_gateway" : allow_mcp_gateway ,
553+ "allowed_cidrs" : allowed_cidrs ,
531554 "allowed_hostnames" : allowed_hostnames ,
532555 "description" : description ,
533556 "name" : name ,
0 commit comments