mirror of
https://github.com/cloudflare/cloudflare-python.git
synced 2026-01-17 07:10:37 +00:00
feat(api): OpenAPI spec update via Stainless API (#149)
This commit is contained in:
parent
9f3a5e7f01
commit
626d7c354c
81 changed files with 1 additions and 13921 deletions
|
|
@ -1 +1 @@
|
|||
configured_endpoints: 1284
|
||||
configured_endpoints: 1244
|
||||
|
|
|
|||
178
api.md
178
api.md
|
|
@ -3716,184 +3716,6 @@ Methods:
|
|||
- <code title="get /accounts/{account_id}/intel/attack-surface-report/issues/severity">client.intel.attack_surface_report.issues.<a href="./src/cloudflare/resources/intel/attack_surface_report/issues.py">severity</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/attack_surface_report/issue_severity_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/attack_surface_report/issue_severity_response.py">IssueSeverityResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/intel/attack-surface-report/issues/type">client.intel.attack_surface_report.issues.<a href="./src/cloudflare/resources/intel/attack_surface_report/issues.py">type</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/attack_surface_report/issue_type_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/attack_surface_report/issue_type_response.py">IssueTypeResponse</a></code>
|
||||
|
||||
# MagicTransit
|
||||
|
||||
## CfInterconnects
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.magic_transit import (
|
||||
CfInterconnectUpdateResponse,
|
||||
CfInterconnectListResponse,
|
||||
CfInterconnectGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="put /accounts/{account_identifier}/magic/cf_interconnects/{tunnel_identifier}">client.magic_transit.cf_interconnects.<a href="./src/cloudflare/resources/magic_transit/cf_interconnects.py">update</a>(tunnel_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/cf_interconnect_update_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/cf_interconnect_update_response.py">CfInterconnectUpdateResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/cf_interconnects">client.magic_transit.cf_interconnects.<a href="./src/cloudflare/resources/magic_transit/cf_interconnects.py">list</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_transit/cf_interconnect_list_response.py">CfInterconnectListResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/cf_interconnects/{tunnel_identifier}">client.magic_transit.cf_interconnects.<a href="./src/cloudflare/resources/magic_transit/cf_interconnects.py">get</a>(tunnel_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/cf_interconnect_get_response.py">CfInterconnectGetResponse</a></code>
|
||||
|
||||
## GRETunnels
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.magic_transit import (
|
||||
GRETunnelCreateResponse,
|
||||
GRETunnelUpdateResponse,
|
||||
GRETunnelListResponse,
|
||||
GRETunnelDeleteResponse,
|
||||
GRETunnelGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_identifier}/magic/gre_tunnels">client.magic_transit.gre_tunnels.<a href="./src/cloudflare/resources/magic_transit/gre_tunnels.py">create</a>(account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/gre_tunnel_create_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/gre_tunnel_create_response.py">GRETunnelCreateResponse</a></code>
|
||||
- <code title="put /accounts/{account_identifier}/magic/gre_tunnels/{tunnel_identifier}">client.magic_transit.gre_tunnels.<a href="./src/cloudflare/resources/magic_transit/gre_tunnels.py">update</a>(tunnel_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/gre_tunnel_update_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/gre_tunnel_update_response.py">GRETunnelUpdateResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/gre_tunnels">client.magic_transit.gre_tunnels.<a href="./src/cloudflare/resources/magic_transit/gre_tunnels.py">list</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_transit/gre_tunnel_list_response.py">GRETunnelListResponse</a></code>
|
||||
- <code title="delete /accounts/{account_identifier}/magic/gre_tunnels/{tunnel_identifier}">client.magic_transit.gre_tunnels.<a href="./src/cloudflare/resources/magic_transit/gre_tunnels.py">delete</a>(tunnel_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/gre_tunnel_delete_response.py">GRETunnelDeleteResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/gre_tunnels/{tunnel_identifier}">client.magic_transit.gre_tunnels.<a href="./src/cloudflare/resources/magic_transit/gre_tunnels.py">get</a>(tunnel_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/gre_tunnel_get_response.py">GRETunnelGetResponse</a></code>
|
||||
|
||||
## IPSECTunnels
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.magic_transit import (
|
||||
IPSECTunnelCreateResponse,
|
||||
IPSECTunnelUpdateResponse,
|
||||
IPSECTunnelListResponse,
|
||||
IPSECTunnelDeleteResponse,
|
||||
IPSECTunnelGetResponse,
|
||||
IPSECTunnelPSKGenerateResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_identifier}/magic/ipsec_tunnels">client.magic_transit.ipsec_tunnels.<a href="./src/cloudflare/resources/magic_transit/ipsec_tunnels.py">create</a>(account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/ipsec_tunnel_create_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/ipsec_tunnel_create_response.py">IPSECTunnelCreateResponse</a></code>
|
||||
- <code title="put /accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}">client.magic_transit.ipsec_tunnels.<a href="./src/cloudflare/resources/magic_transit/ipsec_tunnels.py">update</a>(tunnel_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/ipsec_tunnel_update_response.py">IPSECTunnelUpdateResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/ipsec_tunnels">client.magic_transit.ipsec_tunnels.<a href="./src/cloudflare/resources/magic_transit/ipsec_tunnels.py">list</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_transit/ipsec_tunnel_list_response.py">IPSECTunnelListResponse</a></code>
|
||||
- <code title="delete /accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}">client.magic_transit.ipsec_tunnels.<a href="./src/cloudflare/resources/magic_transit/ipsec_tunnels.py">delete</a>(tunnel_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/ipsec_tunnel_delete_response.py">IPSECTunnelDeleteResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}">client.magic_transit.ipsec_tunnels.<a href="./src/cloudflare/resources/magic_transit/ipsec_tunnels.py">get</a>(tunnel_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/ipsec_tunnel_get_response.py">IPSECTunnelGetResponse</a></code>
|
||||
- <code title="post /accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}/psk_generate">client.magic_transit.ipsec_tunnels.<a href="./src/cloudflare/resources/magic_transit/ipsec_tunnels.py">psk_generate</a>(tunnel_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_response.py">IPSECTunnelPSKGenerateResponse</a></code>
|
||||
|
||||
## Routes
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.magic_transit import (
|
||||
RouteCreateResponse,
|
||||
RouteUpdateResponse,
|
||||
RouteListResponse,
|
||||
RouteDeleteResponse,
|
||||
RouteEmptyResponse,
|
||||
RouteGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_identifier}/magic/routes">client.magic_transit.routes.<a href="./src/cloudflare/resources/magic_transit/routes.py">create</a>(account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/route_create_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/route_create_response.py">RouteCreateResponse</a></code>
|
||||
- <code title="put /accounts/{account_identifier}/magic/routes/{route_identifier}">client.magic_transit.routes.<a href="./src/cloudflare/resources/magic_transit/routes.py">update</a>(route_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/route_update_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/route_update_response.py">RouteUpdateResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/routes">client.magic_transit.routes.<a href="./src/cloudflare/resources/magic_transit/routes.py">list</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_transit/route_list_response.py">RouteListResponse</a></code>
|
||||
- <code title="delete /accounts/{account_identifier}/magic/routes/{route_identifier}">client.magic_transit.routes.<a href="./src/cloudflare/resources/magic_transit/routes.py">delete</a>(route_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/route_delete_response.py">RouteDeleteResponse</a></code>
|
||||
- <code title="delete /accounts/{account_identifier}/magic/routes">client.magic_transit.routes.<a href="./src/cloudflare/resources/magic_transit/routes.py">empty</a>(account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/route_empty_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/route_empty_response.py">RouteEmptyResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/routes/{route_identifier}">client.magic_transit.routes.<a href="./src/cloudflare/resources/magic_transit/routes.py">get</a>(route_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/route_get_response.py">RouteGetResponse</a></code>
|
||||
|
||||
## Sites
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.magic_transit import (
|
||||
SiteCreateResponse,
|
||||
SiteUpdateResponse,
|
||||
SiteListResponse,
|
||||
SiteDeleteResponse,
|
||||
SiteGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_identifier}/magic/sites">client.magic_transit.sites.<a href="./src/cloudflare/resources/magic_transit/sites/sites.py">create</a>(account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/site_create_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/site_create_response.py">SiteCreateResponse</a></code>
|
||||
- <code title="put /accounts/{account_identifier}/magic/sites/{site_identifier}">client.magic_transit.sites.<a href="./src/cloudflare/resources/magic_transit/sites/sites.py">update</a>(site_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/site_update_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/site_update_response.py">SiteUpdateResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/sites">client.magic_transit.sites.<a href="./src/cloudflare/resources/magic_transit/sites/sites.py">list</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_transit/site_list_response.py">SiteListResponse</a></code>
|
||||
- <code title="delete /accounts/{account_identifier}/magic/sites/{site_identifier}">client.magic_transit.sites.<a href="./src/cloudflare/resources/magic_transit/sites/sites.py">delete</a>(site_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/site_delete_response.py">SiteDeleteResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/sites/{site_identifier}">client.magic_transit.sites.<a href="./src/cloudflare/resources/magic_transit/sites/sites.py">get</a>(site_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/site_get_response.py">SiteGetResponse</a></code>
|
||||
|
||||
### ACLs
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.magic_transit.sites import (
|
||||
ACLCreateResponse,
|
||||
ACLUpdateResponse,
|
||||
ACLListResponse,
|
||||
ACLDeleteResponse,
|
||||
ACLGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_identifier}/magic/sites/{site_identifier}/acls">client.magic_transit.sites.acls.<a href="./src/cloudflare/resources/magic_transit/sites/acls.py">create</a>(site_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/sites/acl_create_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/sites/acl_create_response.py">ACLCreateResponse</a></code>
|
||||
- <code title="put /accounts/{account_identifier}/magic/sites/{site_identifier}/acls/{acl_identifier}">client.magic_transit.sites.acls.<a href="./src/cloudflare/resources/magic_transit/sites/acls.py">update</a>(acl_identifier, \*, account_identifier, site_identifier, \*\*<a href="src/cloudflare/types/magic_transit/sites/acl_update_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/sites/acl_update_response.py">ACLUpdateResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/sites/{site_identifier}/acls">client.magic_transit.sites.acls.<a href="./src/cloudflare/resources/magic_transit/sites/acls.py">list</a>(site_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/sites/acl_list_response.py">ACLListResponse</a></code>
|
||||
- <code title="delete /accounts/{account_identifier}/magic/sites/{site_identifier}/acls/{acl_identifier}">client.magic_transit.sites.acls.<a href="./src/cloudflare/resources/magic_transit/sites/acls.py">delete</a>(acl_identifier, \*, account_identifier, site_identifier) -> <a href="./src/cloudflare/types/magic_transit/sites/acl_delete_response.py">ACLDeleteResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/sites/{site_identifier}/acls/{acl_identifier}">client.magic_transit.sites.acls.<a href="./src/cloudflare/resources/magic_transit/sites/acls.py">get</a>(acl_identifier, \*, account_identifier, site_identifier) -> <a href="./src/cloudflare/types/magic_transit/sites/acl_get_response.py">ACLGetResponse</a></code>
|
||||
|
||||
### Lans
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.magic_transit.sites import (
|
||||
LanCreateResponse,
|
||||
LanUpdateResponse,
|
||||
LanListResponse,
|
||||
LanDeleteResponse,
|
||||
LanGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_identifier}/magic/sites/{site_identifier}/lans">client.magic_transit.sites.lans.<a href="./src/cloudflare/resources/magic_transit/sites/lans.py">create</a>(site_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/sites/lan_create_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/sites/lan_create_response.py">LanCreateResponse</a></code>
|
||||
- <code title="put /accounts/{account_identifier}/magic/sites/{site_identifier}/lans/{lan_identifier}">client.magic_transit.sites.lans.<a href="./src/cloudflare/resources/magic_transit/sites/lans.py">update</a>(lan_identifier, \*, account_identifier, site_identifier, \*\*<a href="src/cloudflare/types/magic_transit/sites/lan_update_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/sites/lan_update_response.py">LanUpdateResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/sites/{site_identifier}/lans">client.magic_transit.sites.lans.<a href="./src/cloudflare/resources/magic_transit/sites/lans.py">list</a>(site_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/sites/lan_list_response.py">LanListResponse</a></code>
|
||||
- <code title="delete /accounts/{account_identifier}/magic/sites/{site_identifier}/lans/{lan_identifier}">client.magic_transit.sites.lans.<a href="./src/cloudflare/resources/magic_transit/sites/lans.py">delete</a>(lan_identifier, \*, account_identifier, site_identifier) -> <a href="./src/cloudflare/types/magic_transit/sites/lan_delete_response.py">LanDeleteResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/sites/{site_identifier}/lans/{lan_identifier}">client.magic_transit.sites.lans.<a href="./src/cloudflare/resources/magic_transit/sites/lans.py">get</a>(lan_identifier, \*, account_identifier, site_identifier) -> <a href="./src/cloudflare/types/magic_transit/sites/lan_get_response.py">LanGetResponse</a></code>
|
||||
|
||||
### Wans
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.magic_transit.sites import (
|
||||
WanCreateResponse,
|
||||
WanUpdateResponse,
|
||||
WanListResponse,
|
||||
WanDeleteResponse,
|
||||
WanGetResponse,
|
||||
)
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_identifier}/magic/sites/{site_identifier}/wans">client.magic_transit.sites.wans.<a href="./src/cloudflare/resources/magic_transit/sites/wans.py">create</a>(site_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/magic_transit/sites/wan_create_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/sites/wan_create_response.py">WanCreateResponse</a></code>
|
||||
- <code title="put /accounts/{account_identifier}/magic/sites/{site_identifier}/wans/{wan_identifier}">client.magic_transit.sites.wans.<a href="./src/cloudflare/resources/magic_transit/sites/wans.py">update</a>(wan_identifier, \*, account_identifier, site_identifier, \*\*<a href="src/cloudflare/types/magic_transit/sites/wan_update_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/sites/wan_update_response.py">WanUpdateResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/sites/{site_identifier}/wans">client.magic_transit.sites.wans.<a href="./src/cloudflare/resources/magic_transit/sites/wans.py">list</a>(site_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_transit/sites/wan_list_response.py">WanListResponse</a></code>
|
||||
- <code title="delete /accounts/{account_identifier}/magic/sites/{site_identifier}/wans/{wan_identifier}">client.magic_transit.sites.wans.<a href="./src/cloudflare/resources/magic_transit/sites/wans.py">delete</a>(wan_identifier, \*, account_identifier, site_identifier) -> <a href="./src/cloudflare/types/magic_transit/sites/wan_delete_response.py">WanDeleteResponse</a></code>
|
||||
- <code title="get /accounts/{account_identifier}/magic/sites/{site_identifier}/wans/{wan_identifier}">client.magic_transit.sites.wans.<a href="./src/cloudflare/resources/magic_transit/sites/wans.py">get</a>(wan_identifier, \*, account_identifier, site_identifier) -> <a href="./src/cloudflare/types/magic_transit/sites/wan_get_response.py">WanGetResponse</a></code>
|
||||
|
||||
# MagicNetworkMonitoring
|
||||
|
||||
## Configs
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ class Cloudflare(SyncAPIClient):
|
|||
diagnostics: resources.Diagnostics
|
||||
images: resources.Images
|
||||
intel: resources.Intel
|
||||
magic_transit: resources.MagicTransit
|
||||
magic_network_monitoring: resources.MagicNetworkMonitoring
|
||||
mtls_certificates: resources.MTLSCertificates
|
||||
pages: resources.Pages
|
||||
|
|
@ -250,7 +249,6 @@ class Cloudflare(SyncAPIClient):
|
|||
self.diagnostics = resources.Diagnostics(self)
|
||||
self.images = resources.Images(self)
|
||||
self.intel = resources.Intel(self)
|
||||
self.magic_transit = resources.MagicTransit(self)
|
||||
self.magic_network_monitoring = resources.MagicNetworkMonitoring(self)
|
||||
self.mtls_certificates = resources.MTLSCertificates(self)
|
||||
self.pages = resources.Pages(self)
|
||||
|
|
@ -508,7 +506,6 @@ class AsyncCloudflare(AsyncAPIClient):
|
|||
diagnostics: resources.AsyncDiagnostics
|
||||
images: resources.AsyncImages
|
||||
intel: resources.AsyncIntel
|
||||
magic_transit: resources.AsyncMagicTransit
|
||||
magic_network_monitoring: resources.AsyncMagicNetworkMonitoring
|
||||
mtls_certificates: resources.AsyncMTLSCertificates
|
||||
pages: resources.AsyncPages
|
||||
|
|
@ -661,7 +658,6 @@ class AsyncCloudflare(AsyncAPIClient):
|
|||
self.diagnostics = resources.AsyncDiagnostics(self)
|
||||
self.images = resources.AsyncImages(self)
|
||||
self.intel = resources.AsyncIntel(self)
|
||||
self.magic_transit = resources.AsyncMagicTransit(self)
|
||||
self.magic_network_monitoring = resources.AsyncMagicNetworkMonitoring(self)
|
||||
self.mtls_certificates = resources.AsyncMTLSCertificates(self)
|
||||
self.pages = resources.AsyncPages(self)
|
||||
|
|
@ -920,7 +916,6 @@ class CloudflareWithRawResponse:
|
|||
self.diagnostics = resources.DiagnosticsWithRawResponse(client.diagnostics)
|
||||
self.images = resources.ImagesWithRawResponse(client.images)
|
||||
self.intel = resources.IntelWithRawResponse(client.intel)
|
||||
self.magic_transit = resources.MagicTransitWithRawResponse(client.magic_transit)
|
||||
self.magic_network_monitoring = resources.MagicNetworkMonitoringWithRawResponse(client.magic_network_monitoring)
|
||||
self.mtls_certificates = resources.MTLSCertificatesWithRawResponse(client.mtls_certificates)
|
||||
self.pages = resources.PagesWithRawResponse(client.pages)
|
||||
|
|
@ -1008,7 +1003,6 @@ class AsyncCloudflareWithRawResponse:
|
|||
self.diagnostics = resources.AsyncDiagnosticsWithRawResponse(client.diagnostics)
|
||||
self.images = resources.AsyncImagesWithRawResponse(client.images)
|
||||
self.intel = resources.AsyncIntelWithRawResponse(client.intel)
|
||||
self.magic_transit = resources.AsyncMagicTransitWithRawResponse(client.magic_transit)
|
||||
self.magic_network_monitoring = resources.AsyncMagicNetworkMonitoringWithRawResponse(
|
||||
client.magic_network_monitoring
|
||||
)
|
||||
|
|
@ -1098,7 +1092,6 @@ class CloudflareWithStreamedResponse:
|
|||
self.diagnostics = resources.DiagnosticsWithStreamingResponse(client.diagnostics)
|
||||
self.images = resources.ImagesWithStreamingResponse(client.images)
|
||||
self.intel = resources.IntelWithStreamingResponse(client.intel)
|
||||
self.magic_transit = resources.MagicTransitWithStreamingResponse(client.magic_transit)
|
||||
self.magic_network_monitoring = resources.MagicNetworkMonitoringWithStreamingResponse(
|
||||
client.magic_network_monitoring
|
||||
)
|
||||
|
|
@ -1192,7 +1185,6 @@ class AsyncCloudflareWithStreamedResponse:
|
|||
self.diagnostics = resources.AsyncDiagnosticsWithStreamingResponse(client.diagnostics)
|
||||
self.images = resources.AsyncImagesWithStreamingResponse(client.images)
|
||||
self.intel = resources.AsyncIntelWithStreamingResponse(client.intel)
|
||||
self.magic_transit = resources.AsyncMagicTransitWithStreamingResponse(client.magic_transit)
|
||||
self.magic_network_monitoring = resources.AsyncMagicNetworkMonitoringWithStreamingResponse(
|
||||
client.magic_network_monitoring
|
||||
)
|
||||
|
|
|
|||
|
|
@ -416,14 +416,6 @@ from .email_routing import (
|
|||
EmailRoutingWithStreamingResponse,
|
||||
AsyncEmailRoutingWithStreamingResponse,
|
||||
)
|
||||
from .magic_transit import (
|
||||
MagicTransit,
|
||||
AsyncMagicTransit,
|
||||
MagicTransitWithRawResponse,
|
||||
AsyncMagicTransitWithRawResponse,
|
||||
MagicTransitWithStreamingResponse,
|
||||
AsyncMagicTransitWithStreamingResponse,
|
||||
)
|
||||
from .secondary_dns import (
|
||||
SecondaryDNS,
|
||||
AsyncSecondaryDNS,
|
||||
|
|
@ -942,12 +934,6 @@ __all__ = [
|
|||
"AsyncIntelWithRawResponse",
|
||||
"IntelWithStreamingResponse",
|
||||
"AsyncIntelWithStreamingResponse",
|
||||
"MagicTransit",
|
||||
"AsyncMagicTransit",
|
||||
"MagicTransitWithRawResponse",
|
||||
"AsyncMagicTransitWithRawResponse",
|
||||
"MagicTransitWithStreamingResponse",
|
||||
"AsyncMagicTransitWithStreamingResponse",
|
||||
"MagicNetworkMonitoring",
|
||||
"AsyncMagicNetworkMonitoring",
|
||||
"MagicNetworkMonitoringWithRawResponse",
|
||||
|
|
|
|||
|
|
@ -1,89 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .sites import (
|
||||
Sites,
|
||||
AsyncSites,
|
||||
SitesWithRawResponse,
|
||||
AsyncSitesWithRawResponse,
|
||||
SitesWithStreamingResponse,
|
||||
AsyncSitesWithStreamingResponse,
|
||||
)
|
||||
from .routes import (
|
||||
Routes,
|
||||
AsyncRoutes,
|
||||
RoutesWithRawResponse,
|
||||
AsyncRoutesWithRawResponse,
|
||||
RoutesWithStreamingResponse,
|
||||
AsyncRoutesWithStreamingResponse,
|
||||
)
|
||||
from .gre_tunnels import (
|
||||
GRETunnels,
|
||||
AsyncGRETunnels,
|
||||
GRETunnelsWithRawResponse,
|
||||
AsyncGRETunnelsWithRawResponse,
|
||||
GRETunnelsWithStreamingResponse,
|
||||
AsyncGRETunnelsWithStreamingResponse,
|
||||
)
|
||||
from .ipsec_tunnels import (
|
||||
IPSECTunnels,
|
||||
AsyncIPSECTunnels,
|
||||
IPSECTunnelsWithRawResponse,
|
||||
AsyncIPSECTunnelsWithRawResponse,
|
||||
IPSECTunnelsWithStreamingResponse,
|
||||
AsyncIPSECTunnelsWithStreamingResponse,
|
||||
)
|
||||
from .magic_transit import (
|
||||
MagicTransit,
|
||||
AsyncMagicTransit,
|
||||
MagicTransitWithRawResponse,
|
||||
AsyncMagicTransitWithRawResponse,
|
||||
MagicTransitWithStreamingResponse,
|
||||
AsyncMagicTransitWithStreamingResponse,
|
||||
)
|
||||
from .cf_interconnects import (
|
||||
CfInterconnects,
|
||||
AsyncCfInterconnects,
|
||||
CfInterconnectsWithRawResponse,
|
||||
AsyncCfInterconnectsWithRawResponse,
|
||||
CfInterconnectsWithStreamingResponse,
|
||||
AsyncCfInterconnectsWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"CfInterconnects",
|
||||
"AsyncCfInterconnects",
|
||||
"CfInterconnectsWithRawResponse",
|
||||
"AsyncCfInterconnectsWithRawResponse",
|
||||
"CfInterconnectsWithStreamingResponse",
|
||||
"AsyncCfInterconnectsWithStreamingResponse",
|
||||
"GRETunnels",
|
||||
"AsyncGRETunnels",
|
||||
"GRETunnelsWithRawResponse",
|
||||
"AsyncGRETunnelsWithRawResponse",
|
||||
"GRETunnelsWithStreamingResponse",
|
||||
"AsyncGRETunnelsWithStreamingResponse",
|
||||
"IPSECTunnels",
|
||||
"AsyncIPSECTunnels",
|
||||
"IPSECTunnelsWithRawResponse",
|
||||
"AsyncIPSECTunnelsWithRawResponse",
|
||||
"IPSECTunnelsWithStreamingResponse",
|
||||
"AsyncIPSECTunnelsWithStreamingResponse",
|
||||
"Routes",
|
||||
"AsyncRoutes",
|
||||
"RoutesWithRawResponse",
|
||||
"AsyncRoutesWithRawResponse",
|
||||
"RoutesWithStreamingResponse",
|
||||
"AsyncRoutesWithStreamingResponse",
|
||||
"Sites",
|
||||
"AsyncSites",
|
||||
"SitesWithRawResponse",
|
||||
"AsyncSitesWithRawResponse",
|
||||
"SitesWithStreamingResponse",
|
||||
"AsyncSitesWithStreamingResponse",
|
||||
"MagicTransit",
|
||||
"AsyncMagicTransit",
|
||||
"MagicTransitWithRawResponse",
|
||||
"AsyncMagicTransitWithRawResponse",
|
||||
"MagicTransitWithStreamingResponse",
|
||||
"AsyncMagicTransitWithStreamingResponse",
|
||||
]
|
||||
|
|
@ -1,425 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ..._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ..._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ...types.magic_transit import (
|
||||
CfInterconnectGetResponse,
|
||||
CfInterconnectListResponse,
|
||||
CfInterconnectUpdateResponse,
|
||||
cf_interconnect_update_params,
|
||||
)
|
||||
|
||||
__all__ = ["CfInterconnects", "AsyncCfInterconnects"]
|
||||
|
||||
|
||||
class CfInterconnects(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> CfInterconnectsWithRawResponse:
|
||||
return CfInterconnectsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> CfInterconnectsWithStreamingResponse:
|
||||
return CfInterconnectsWithStreamingResponse(self)
|
||||
|
||||
def update(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
description: str | NotGiven = NOT_GIVEN,
|
||||
gre: cf_interconnect_update_params.GRE | NotGiven = NOT_GIVEN,
|
||||
health_check: cf_interconnect_update_params.HealthCheck | NotGiven = NOT_GIVEN,
|
||||
interface_address: str | NotGiven = NOT_GIVEN,
|
||||
mtu: int | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> CfInterconnectUpdateResponse:
|
||||
"""Updates a specific interconnect associated with an account.
|
||||
|
||||
Use
|
||||
`?validate_only=true` as an optional query parameter to only run validation
|
||||
without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
description: An optional description of the interconnect.
|
||||
|
||||
gre: The configuration specific to GRE interconnects.
|
||||
|
||||
interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
|
||||
mtu: The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum
|
||||
value is 576.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_identifier}/magic/cf_interconnects/{tunnel_identifier}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"description": description,
|
||||
"gre": gre,
|
||||
"health_check": health_check,
|
||||
"interface_address": interface_address,
|
||||
"mtu": mtu,
|
||||
},
|
||||
cf_interconnect_update_params.CfInterconnectUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[CfInterconnectUpdateResponse], ResultWrapper[CfInterconnectUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> CfInterconnectListResponse:
|
||||
"""
|
||||
Lists interconnects associated with an account.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/cf_interconnects",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[CfInterconnectListResponse], ResultWrapper[CfInterconnectListResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> CfInterconnectGetResponse:
|
||||
"""
|
||||
Lists details for a specific interconnect.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/cf_interconnects/{tunnel_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[CfInterconnectGetResponse], ResultWrapper[CfInterconnectGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncCfInterconnects(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncCfInterconnectsWithRawResponse:
|
||||
return AsyncCfInterconnectsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncCfInterconnectsWithStreamingResponse:
|
||||
return AsyncCfInterconnectsWithStreamingResponse(self)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
description: str | NotGiven = NOT_GIVEN,
|
||||
gre: cf_interconnect_update_params.GRE | NotGiven = NOT_GIVEN,
|
||||
health_check: cf_interconnect_update_params.HealthCheck | NotGiven = NOT_GIVEN,
|
||||
interface_address: str | NotGiven = NOT_GIVEN,
|
||||
mtu: int | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> CfInterconnectUpdateResponse:
|
||||
"""Updates a specific interconnect associated with an account.
|
||||
|
||||
Use
|
||||
`?validate_only=true` as an optional query parameter to only run validation
|
||||
without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
description: An optional description of the interconnect.
|
||||
|
||||
gre: The configuration specific to GRE interconnects.
|
||||
|
||||
interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
|
||||
mtu: The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum
|
||||
value is 576.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_identifier}/magic/cf_interconnects/{tunnel_identifier}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"description": description,
|
||||
"gre": gre,
|
||||
"health_check": health_check,
|
||||
"interface_address": interface_address,
|
||||
"mtu": mtu,
|
||||
},
|
||||
cf_interconnect_update_params.CfInterconnectUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[CfInterconnectUpdateResponse], ResultWrapper[CfInterconnectUpdateResponse]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> CfInterconnectListResponse:
|
||||
"""
|
||||
Lists interconnects associated with an account.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/cf_interconnects",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[CfInterconnectListResponse], ResultWrapper[CfInterconnectListResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> CfInterconnectGetResponse:
|
||||
"""
|
||||
Lists details for a specific interconnect.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/cf_interconnects/{tunnel_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[CfInterconnectGetResponse], ResultWrapper[CfInterconnectGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class CfInterconnectsWithRawResponse:
|
||||
def __init__(self, cf_interconnects: CfInterconnects) -> None:
|
||||
self._cf_interconnects = cf_interconnects
|
||||
|
||||
self.update = to_raw_response_wrapper(
|
||||
cf_interconnects.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
cf_interconnects.list,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
cf_interconnects.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncCfInterconnectsWithRawResponse:
|
||||
def __init__(self, cf_interconnects: AsyncCfInterconnects) -> None:
|
||||
self._cf_interconnects = cf_interconnects
|
||||
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
cf_interconnects.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
cf_interconnects.list,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
cf_interconnects.get,
|
||||
)
|
||||
|
||||
|
||||
class CfInterconnectsWithStreamingResponse:
|
||||
def __init__(self, cf_interconnects: CfInterconnects) -> None:
|
||||
self._cf_interconnects = cf_interconnects
|
||||
|
||||
self.update = to_streamed_response_wrapper(
|
||||
cf_interconnects.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
cf_interconnects.list,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
cf_interconnects.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncCfInterconnectsWithStreamingResponse:
|
||||
def __init__(self, cf_interconnects: AsyncCfInterconnects) -> None:
|
||||
self._cf_interconnects = cf_interconnects
|
||||
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
cf_interconnects.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
cf_interconnects.list,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
cf_interconnects.get,
|
||||
)
|
||||
|
|
@ -1,654 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ..._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ..._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ...types.magic_transit import (
|
||||
GRETunnelGetResponse,
|
||||
GRETunnelListResponse,
|
||||
GRETunnelCreateResponse,
|
||||
GRETunnelDeleteResponse,
|
||||
GRETunnelUpdateResponse,
|
||||
gre_tunnel_create_params,
|
||||
gre_tunnel_update_params,
|
||||
)
|
||||
|
||||
__all__ = ["GRETunnels", "AsyncGRETunnels"]
|
||||
|
||||
|
||||
class GRETunnels(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> GRETunnelsWithRawResponse:
|
||||
return GRETunnelsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> GRETunnelsWithStreamingResponse:
|
||||
return GRETunnelsWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> GRETunnelCreateResponse:
|
||||
"""Creates new GRE tunnels.
|
||||
|
||||
Use `?validate_only=true` as an optional query
|
||||
parameter to only run validation without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_identifier}/magic/gre_tunnels",
|
||||
body=maybe_transform(body, gre_tunnel_create_params.GRETunnelCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[GRETunnelCreateResponse], ResultWrapper[GRETunnelCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
cloudflare_gre_endpoint: str,
|
||||
customer_gre_endpoint: str,
|
||||
interface_address: str,
|
||||
name: str,
|
||||
description: str | NotGiven = NOT_GIVEN,
|
||||
health_check: gre_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN,
|
||||
mtu: int | NotGiven = NOT_GIVEN,
|
||||
ttl: int | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> GRETunnelUpdateResponse:
|
||||
"""Updates a specific GRE tunnel.
|
||||
|
||||
Use `?validate_only=true` as an optional query
|
||||
parameter to only run validation without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
cloudflare_gre_endpoint: The IP address assigned to the Cloudflare side of the GRE tunnel.
|
||||
|
||||
customer_gre_endpoint: The IP address assigned to the customer side of the GRE tunnel.
|
||||
|
||||
interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
|
||||
name: The name of the tunnel. The name cannot contain spaces or special characters,
|
||||
must be 15 characters or less, and cannot share a name with another GRE tunnel.
|
||||
|
||||
description: An optional description of the GRE tunnel.
|
||||
|
||||
mtu: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value
|
||||
is 576.
|
||||
|
||||
ttl: Time To Live (TTL) in number of hops of the GRE tunnel.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_identifier}/magic/gre_tunnels/{tunnel_identifier}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"cloudflare_gre_endpoint": cloudflare_gre_endpoint,
|
||||
"customer_gre_endpoint": customer_gre_endpoint,
|
||||
"interface_address": interface_address,
|
||||
"name": name,
|
||||
"description": description,
|
||||
"health_check": health_check,
|
||||
"mtu": mtu,
|
||||
"ttl": ttl,
|
||||
},
|
||||
gre_tunnel_update_params.GRETunnelUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[GRETunnelUpdateResponse], ResultWrapper[GRETunnelUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> GRETunnelListResponse:
|
||||
"""
|
||||
Lists GRE tunnels associated with an account.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/gre_tunnels",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[GRETunnelListResponse], ResultWrapper[GRETunnelListResponse]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> GRETunnelDeleteResponse:
|
||||
"""Disables and removes a specific static GRE tunnel.
|
||||
|
||||
Use `?validate_only=true` as
|
||||
an optional query parameter to only run validation without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_identifier}/magic/gre_tunnels/{tunnel_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[GRETunnelDeleteResponse], ResultWrapper[GRETunnelDeleteResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> GRETunnelGetResponse:
|
||||
"""
|
||||
Lists informtion for a specific GRE tunnel.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/gre_tunnels/{tunnel_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[GRETunnelGetResponse], ResultWrapper[GRETunnelGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncGRETunnels(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncGRETunnelsWithRawResponse:
|
||||
return AsyncGRETunnelsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncGRETunnelsWithStreamingResponse:
|
||||
return AsyncGRETunnelsWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> GRETunnelCreateResponse:
|
||||
"""Creates new GRE tunnels.
|
||||
|
||||
Use `?validate_only=true` as an optional query
|
||||
parameter to only run validation without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_identifier}/magic/gre_tunnels",
|
||||
body=await async_maybe_transform(body, gre_tunnel_create_params.GRETunnelCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[GRETunnelCreateResponse], ResultWrapper[GRETunnelCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
cloudflare_gre_endpoint: str,
|
||||
customer_gre_endpoint: str,
|
||||
interface_address: str,
|
||||
name: str,
|
||||
description: str | NotGiven = NOT_GIVEN,
|
||||
health_check: gre_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN,
|
||||
mtu: int | NotGiven = NOT_GIVEN,
|
||||
ttl: int | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> GRETunnelUpdateResponse:
|
||||
"""Updates a specific GRE tunnel.
|
||||
|
||||
Use `?validate_only=true` as an optional query
|
||||
parameter to only run validation without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
cloudflare_gre_endpoint: The IP address assigned to the Cloudflare side of the GRE tunnel.
|
||||
|
||||
customer_gre_endpoint: The IP address assigned to the customer side of the GRE tunnel.
|
||||
|
||||
interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
|
||||
name: The name of the tunnel. The name cannot contain spaces or special characters,
|
||||
must be 15 characters or less, and cannot share a name with another GRE tunnel.
|
||||
|
||||
description: An optional description of the GRE tunnel.
|
||||
|
||||
mtu: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value
|
||||
is 576.
|
||||
|
||||
ttl: Time To Live (TTL) in number of hops of the GRE tunnel.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_identifier}/magic/gre_tunnels/{tunnel_identifier}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"cloudflare_gre_endpoint": cloudflare_gre_endpoint,
|
||||
"customer_gre_endpoint": customer_gre_endpoint,
|
||||
"interface_address": interface_address,
|
||||
"name": name,
|
||||
"description": description,
|
||||
"health_check": health_check,
|
||||
"mtu": mtu,
|
||||
"ttl": ttl,
|
||||
},
|
||||
gre_tunnel_update_params.GRETunnelUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[GRETunnelUpdateResponse], ResultWrapper[GRETunnelUpdateResponse]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> GRETunnelListResponse:
|
||||
"""
|
||||
Lists GRE tunnels associated with an account.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/gre_tunnels",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[GRETunnelListResponse], ResultWrapper[GRETunnelListResponse]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> GRETunnelDeleteResponse:
|
||||
"""Disables and removes a specific static GRE tunnel.
|
||||
|
||||
Use `?validate_only=true` as
|
||||
an optional query parameter to only run validation without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_identifier}/magic/gre_tunnels/{tunnel_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[GRETunnelDeleteResponse], ResultWrapper[GRETunnelDeleteResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> GRETunnelGetResponse:
|
||||
"""
|
||||
Lists informtion for a specific GRE tunnel.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/gre_tunnels/{tunnel_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[GRETunnelGetResponse], ResultWrapper[GRETunnelGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class GRETunnelsWithRawResponse:
|
||||
def __init__(self, gre_tunnels: GRETunnels) -> None:
|
||||
self._gre_tunnels = gre_tunnels
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
gre_tunnels.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
gre_tunnels.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
gre_tunnels.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
gre_tunnels.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
gre_tunnels.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncGRETunnelsWithRawResponse:
|
||||
def __init__(self, gre_tunnels: AsyncGRETunnels) -> None:
|
||||
self._gre_tunnels = gre_tunnels
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
gre_tunnels.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
gre_tunnels.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
gre_tunnels.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
gre_tunnels.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
gre_tunnels.get,
|
||||
)
|
||||
|
||||
|
||||
class GRETunnelsWithStreamingResponse:
|
||||
def __init__(self, gre_tunnels: GRETunnels) -> None:
|
||||
self._gre_tunnels = gre_tunnels
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
gre_tunnels.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
gre_tunnels.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
gre_tunnels.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
gre_tunnels.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
gre_tunnels.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncGRETunnelsWithStreamingResponse:
|
||||
def __init__(self, gre_tunnels: AsyncGRETunnels) -> None:
|
||||
self._gre_tunnels = gre_tunnels
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
gre_tunnels.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
gre_tunnels.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
gre_tunnels.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
gre_tunnels.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
gre_tunnels.get,
|
||||
)
|
||||
|
|
@ -1,837 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ..._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ..._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ...types.magic_transit import (
|
||||
IPSECTunnelGetResponse,
|
||||
IPSECTunnelListResponse,
|
||||
IPSECTunnelCreateResponse,
|
||||
IPSECTunnelDeleteResponse,
|
||||
IPSECTunnelUpdateResponse,
|
||||
IPSECTunnelPSKGenerateResponse,
|
||||
ipsec_tunnel_create_params,
|
||||
ipsec_tunnel_update_params,
|
||||
)
|
||||
|
||||
__all__ = ["IPSECTunnels", "AsyncIPSECTunnels"]
|
||||
|
||||
|
||||
class IPSECTunnels(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> IPSECTunnelsWithRawResponse:
|
||||
return IPSECTunnelsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> IPSECTunnelsWithStreamingResponse:
|
||||
return IPSECTunnelsWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
cloudflare_endpoint: str,
|
||||
interface_address: str,
|
||||
name: str,
|
||||
customer_endpoint: str | NotGiven = NOT_GIVEN,
|
||||
description: str | NotGiven = NOT_GIVEN,
|
||||
health_check: ipsec_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN,
|
||||
psk: str | NotGiven = NOT_GIVEN,
|
||||
replay_protection: bool | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelCreateResponse:
|
||||
"""Creates new IPsec tunnels associated with an account.
|
||||
|
||||
Use `?validate_only=true`
|
||||
as an optional query parameter to only run validation without persisting
|
||||
changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
cloudflare_endpoint: The IP address assigned to the Cloudflare side of the IPsec tunnel.
|
||||
|
||||
interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
|
||||
name: The name of the IPsec tunnel. The name cannot share a name with other tunnels.
|
||||
|
||||
customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel.
|
||||
|
||||
description: An optional description forthe IPsec tunnel.
|
||||
|
||||
psk: A randomly generated or provided string for use in the IPsec tunnel.
|
||||
|
||||
replay_protection: If `true`, then IPsec replay protection will be supported in the
|
||||
Cloudflare-to-customer direction.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"cloudflare_endpoint": cloudflare_endpoint,
|
||||
"interface_address": interface_address,
|
||||
"name": name,
|
||||
"customer_endpoint": customer_endpoint,
|
||||
"description": description,
|
||||
"health_check": health_check,
|
||||
"psk": psk,
|
||||
"replay_protection": replay_protection,
|
||||
},
|
||||
ipsec_tunnel_create_params.IPSECTunnelCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelCreateResponse], ResultWrapper[IPSECTunnelCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
cloudflare_endpoint: str,
|
||||
interface_address: str,
|
||||
name: str,
|
||||
customer_endpoint: str | NotGiven = NOT_GIVEN,
|
||||
description: str | NotGiven = NOT_GIVEN,
|
||||
health_check: ipsec_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN,
|
||||
psk: str | NotGiven = NOT_GIVEN,
|
||||
replay_protection: bool | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelUpdateResponse:
|
||||
"""Updates a specific IPsec tunnel associated with an account.
|
||||
|
||||
Use
|
||||
`?validate_only=true` as an optional query parameter to only run validation
|
||||
without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
cloudflare_endpoint: The IP address assigned to the Cloudflare side of the IPsec tunnel.
|
||||
|
||||
interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
|
||||
name: The name of the IPsec tunnel. The name cannot share a name with other tunnels.
|
||||
|
||||
customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel.
|
||||
|
||||
description: An optional description forthe IPsec tunnel.
|
||||
|
||||
psk: A randomly generated or provided string for use in the IPsec tunnel.
|
||||
|
||||
replay_protection: If `true`, then IPsec replay protection will be supported in the
|
||||
Cloudflare-to-customer direction.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"cloudflare_endpoint": cloudflare_endpoint,
|
||||
"interface_address": interface_address,
|
||||
"name": name,
|
||||
"customer_endpoint": customer_endpoint,
|
||||
"description": description,
|
||||
"health_check": health_check,
|
||||
"psk": psk,
|
||||
"replay_protection": replay_protection,
|
||||
},
|
||||
ipsec_tunnel_update_params.IPSECTunnelUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelUpdateResponse], ResultWrapper[IPSECTunnelUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelListResponse:
|
||||
"""
|
||||
Lists IPsec tunnels associated with an account.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelListResponse], ResultWrapper[IPSECTunnelListResponse]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelDeleteResponse:
|
||||
"""
|
||||
Disables and removes a specific static IPsec Tunnel associated with an account.
|
||||
Use `?validate_only=true` as an optional query parameter to only run validation
|
||||
without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelDeleteResponse], ResultWrapper[IPSECTunnelDeleteResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelGetResponse:
|
||||
"""
|
||||
Lists details for a specific IPsec tunnel.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelGetResponse], ResultWrapper[IPSECTunnelGetResponse]),
|
||||
)
|
||||
|
||||
def psk_generate(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelPSKGenerateResponse:
|
||||
"""
|
||||
Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session.
|
||||
Use `?validate_only=true` as an optional query parameter to only run validation
|
||||
without persisting changes. After a PSK is generated, the PSK is immediately
|
||||
persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a
|
||||
safe place.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}/psk_generate",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelPSKGenerateResponse], ResultWrapper[IPSECTunnelPSKGenerateResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncIPSECTunnels(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncIPSECTunnelsWithRawResponse:
|
||||
return AsyncIPSECTunnelsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncIPSECTunnelsWithStreamingResponse:
|
||||
return AsyncIPSECTunnelsWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
cloudflare_endpoint: str,
|
||||
interface_address: str,
|
||||
name: str,
|
||||
customer_endpoint: str | NotGiven = NOT_GIVEN,
|
||||
description: str | NotGiven = NOT_GIVEN,
|
||||
health_check: ipsec_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN,
|
||||
psk: str | NotGiven = NOT_GIVEN,
|
||||
replay_protection: bool | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelCreateResponse:
|
||||
"""Creates new IPsec tunnels associated with an account.
|
||||
|
||||
Use `?validate_only=true`
|
||||
as an optional query parameter to only run validation without persisting
|
||||
changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
cloudflare_endpoint: The IP address assigned to the Cloudflare side of the IPsec tunnel.
|
||||
|
||||
interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
|
||||
name: The name of the IPsec tunnel. The name cannot share a name with other tunnels.
|
||||
|
||||
customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel.
|
||||
|
||||
description: An optional description forthe IPsec tunnel.
|
||||
|
||||
psk: A randomly generated or provided string for use in the IPsec tunnel.
|
||||
|
||||
replay_protection: If `true`, then IPsec replay protection will be supported in the
|
||||
Cloudflare-to-customer direction.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"cloudflare_endpoint": cloudflare_endpoint,
|
||||
"interface_address": interface_address,
|
||||
"name": name,
|
||||
"customer_endpoint": customer_endpoint,
|
||||
"description": description,
|
||||
"health_check": health_check,
|
||||
"psk": psk,
|
||||
"replay_protection": replay_protection,
|
||||
},
|
||||
ipsec_tunnel_create_params.IPSECTunnelCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelCreateResponse], ResultWrapper[IPSECTunnelCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
cloudflare_endpoint: str,
|
||||
interface_address: str,
|
||||
name: str,
|
||||
customer_endpoint: str | NotGiven = NOT_GIVEN,
|
||||
description: str | NotGiven = NOT_GIVEN,
|
||||
health_check: ipsec_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN,
|
||||
psk: str | NotGiven = NOT_GIVEN,
|
||||
replay_protection: bool | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelUpdateResponse:
|
||||
"""Updates a specific IPsec tunnel associated with an account.
|
||||
|
||||
Use
|
||||
`?validate_only=true` as an optional query parameter to only run validation
|
||||
without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
cloudflare_endpoint: The IP address assigned to the Cloudflare side of the IPsec tunnel.
|
||||
|
||||
interface_address: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
|
||||
name: The name of the IPsec tunnel. The name cannot share a name with other tunnels.
|
||||
|
||||
customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel.
|
||||
|
||||
description: An optional description forthe IPsec tunnel.
|
||||
|
||||
psk: A randomly generated or provided string for use in the IPsec tunnel.
|
||||
|
||||
replay_protection: If `true`, then IPsec replay protection will be supported in the
|
||||
Cloudflare-to-customer direction.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"cloudflare_endpoint": cloudflare_endpoint,
|
||||
"interface_address": interface_address,
|
||||
"name": name,
|
||||
"customer_endpoint": customer_endpoint,
|
||||
"description": description,
|
||||
"health_check": health_check,
|
||||
"psk": psk,
|
||||
"replay_protection": replay_protection,
|
||||
},
|
||||
ipsec_tunnel_update_params.IPSECTunnelUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelUpdateResponse], ResultWrapper[IPSECTunnelUpdateResponse]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelListResponse:
|
||||
"""
|
||||
Lists IPsec tunnels associated with an account.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelListResponse], ResultWrapper[IPSECTunnelListResponse]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelDeleteResponse:
|
||||
"""
|
||||
Disables and removes a specific static IPsec Tunnel associated with an account.
|
||||
Use `?validate_only=true` as an optional query parameter to only run validation
|
||||
without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelDeleteResponse], ResultWrapper[IPSECTunnelDeleteResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelGetResponse:
|
||||
"""
|
||||
Lists details for a specific IPsec tunnel.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelGetResponse], ResultWrapper[IPSECTunnelGetResponse]),
|
||||
)
|
||||
|
||||
async def psk_generate(
|
||||
self,
|
||||
tunnel_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> IPSECTunnelPSKGenerateResponse:
|
||||
"""
|
||||
Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session.
|
||||
Use `?validate_only=true` as an optional query parameter to only run validation
|
||||
without persisting changes. After a PSK is generated, the PSK is immediately
|
||||
persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a
|
||||
safe place.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
tunnel_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not tunnel_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}/psk_generate",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[IPSECTunnelPSKGenerateResponse], ResultWrapper[IPSECTunnelPSKGenerateResponse]),
|
||||
)
|
||||
|
||||
|
||||
class IPSECTunnelsWithRawResponse:
|
||||
def __init__(self, ipsec_tunnels: IPSECTunnels) -> None:
|
||||
self._ipsec_tunnels = ipsec_tunnels
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
ipsec_tunnels.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
ipsec_tunnels.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
ipsec_tunnels.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
ipsec_tunnels.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
ipsec_tunnels.get,
|
||||
)
|
||||
self.psk_generate = to_raw_response_wrapper(
|
||||
ipsec_tunnels.psk_generate,
|
||||
)
|
||||
|
||||
|
||||
class AsyncIPSECTunnelsWithRawResponse:
|
||||
def __init__(self, ipsec_tunnels: AsyncIPSECTunnels) -> None:
|
||||
self._ipsec_tunnels = ipsec_tunnels
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
ipsec_tunnels.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
ipsec_tunnels.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
ipsec_tunnels.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
ipsec_tunnels.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
ipsec_tunnels.get,
|
||||
)
|
||||
self.psk_generate = async_to_raw_response_wrapper(
|
||||
ipsec_tunnels.psk_generate,
|
||||
)
|
||||
|
||||
|
||||
class IPSECTunnelsWithStreamingResponse:
|
||||
def __init__(self, ipsec_tunnels: IPSECTunnels) -> None:
|
||||
self._ipsec_tunnels = ipsec_tunnels
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
ipsec_tunnels.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
ipsec_tunnels.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
ipsec_tunnels.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
ipsec_tunnels.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
ipsec_tunnels.get,
|
||||
)
|
||||
self.psk_generate = to_streamed_response_wrapper(
|
||||
ipsec_tunnels.psk_generate,
|
||||
)
|
||||
|
||||
|
||||
class AsyncIPSECTunnelsWithStreamingResponse:
|
||||
def __init__(self, ipsec_tunnels: AsyncIPSECTunnels) -> None:
|
||||
self._ipsec_tunnels = ipsec_tunnels
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
ipsec_tunnels.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
ipsec_tunnels.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
ipsec_tunnels.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
ipsec_tunnels.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
ipsec_tunnels.get,
|
||||
)
|
||||
self.psk_generate = async_to_streamed_response_wrapper(
|
||||
ipsec_tunnels.psk_generate,
|
||||
)
|
||||
|
|
@ -1,209 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .sites import (
|
||||
Sites,
|
||||
AsyncSites,
|
||||
SitesWithRawResponse,
|
||||
AsyncSitesWithRawResponse,
|
||||
SitesWithStreamingResponse,
|
||||
AsyncSitesWithStreamingResponse,
|
||||
)
|
||||
from .routes import (
|
||||
Routes,
|
||||
AsyncRoutes,
|
||||
RoutesWithRawResponse,
|
||||
AsyncRoutesWithRawResponse,
|
||||
RoutesWithStreamingResponse,
|
||||
AsyncRoutesWithStreamingResponse,
|
||||
)
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from .gre_tunnels import (
|
||||
GRETunnels,
|
||||
AsyncGRETunnels,
|
||||
GRETunnelsWithRawResponse,
|
||||
AsyncGRETunnelsWithRawResponse,
|
||||
GRETunnelsWithStreamingResponse,
|
||||
AsyncGRETunnelsWithStreamingResponse,
|
||||
)
|
||||
from .sites.sites import Sites, AsyncSites
|
||||
from .ipsec_tunnels import (
|
||||
IPSECTunnels,
|
||||
AsyncIPSECTunnels,
|
||||
IPSECTunnelsWithRawResponse,
|
||||
AsyncIPSECTunnelsWithRawResponse,
|
||||
IPSECTunnelsWithStreamingResponse,
|
||||
AsyncIPSECTunnelsWithStreamingResponse,
|
||||
)
|
||||
from .cf_interconnects import (
|
||||
CfInterconnects,
|
||||
AsyncCfInterconnects,
|
||||
CfInterconnectsWithRawResponse,
|
||||
AsyncCfInterconnectsWithRawResponse,
|
||||
CfInterconnectsWithStreamingResponse,
|
||||
AsyncCfInterconnectsWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = ["MagicTransit", "AsyncMagicTransit"]
|
||||
|
||||
|
||||
class MagicTransit(SyncAPIResource):
|
||||
@cached_property
|
||||
def cf_interconnects(self) -> CfInterconnects:
|
||||
return CfInterconnects(self._client)
|
||||
|
||||
@cached_property
|
||||
def gre_tunnels(self) -> GRETunnels:
|
||||
return GRETunnels(self._client)
|
||||
|
||||
@cached_property
|
||||
def ipsec_tunnels(self) -> IPSECTunnels:
|
||||
return IPSECTunnels(self._client)
|
||||
|
||||
@cached_property
|
||||
def routes(self) -> Routes:
|
||||
return Routes(self._client)
|
||||
|
||||
@cached_property
|
||||
def sites(self) -> Sites:
|
||||
return Sites(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> MagicTransitWithRawResponse:
|
||||
return MagicTransitWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> MagicTransitWithStreamingResponse:
|
||||
return MagicTransitWithStreamingResponse(self)
|
||||
|
||||
|
||||
class AsyncMagicTransit(AsyncAPIResource):
|
||||
@cached_property
|
||||
def cf_interconnects(self) -> AsyncCfInterconnects:
|
||||
return AsyncCfInterconnects(self._client)
|
||||
|
||||
@cached_property
|
||||
def gre_tunnels(self) -> AsyncGRETunnels:
|
||||
return AsyncGRETunnels(self._client)
|
||||
|
||||
@cached_property
|
||||
def ipsec_tunnels(self) -> AsyncIPSECTunnels:
|
||||
return AsyncIPSECTunnels(self._client)
|
||||
|
||||
@cached_property
|
||||
def routes(self) -> AsyncRoutes:
|
||||
return AsyncRoutes(self._client)
|
||||
|
||||
@cached_property
|
||||
def sites(self) -> AsyncSites:
|
||||
return AsyncSites(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncMagicTransitWithRawResponse:
|
||||
return AsyncMagicTransitWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncMagicTransitWithStreamingResponse:
|
||||
return AsyncMagicTransitWithStreamingResponse(self)
|
||||
|
||||
|
||||
class MagicTransitWithRawResponse:
|
||||
def __init__(self, magic_transit: MagicTransit) -> None:
|
||||
self._magic_transit = magic_transit
|
||||
|
||||
@cached_property
|
||||
def cf_interconnects(self) -> CfInterconnectsWithRawResponse:
|
||||
return CfInterconnectsWithRawResponse(self._magic_transit.cf_interconnects)
|
||||
|
||||
@cached_property
|
||||
def gre_tunnels(self) -> GRETunnelsWithRawResponse:
|
||||
return GRETunnelsWithRawResponse(self._magic_transit.gre_tunnels)
|
||||
|
||||
@cached_property
|
||||
def ipsec_tunnels(self) -> IPSECTunnelsWithRawResponse:
|
||||
return IPSECTunnelsWithRawResponse(self._magic_transit.ipsec_tunnels)
|
||||
|
||||
@cached_property
|
||||
def routes(self) -> RoutesWithRawResponse:
|
||||
return RoutesWithRawResponse(self._magic_transit.routes)
|
||||
|
||||
@cached_property
|
||||
def sites(self) -> SitesWithRawResponse:
|
||||
return SitesWithRawResponse(self._magic_transit.sites)
|
||||
|
||||
|
||||
class AsyncMagicTransitWithRawResponse:
|
||||
def __init__(self, magic_transit: AsyncMagicTransit) -> None:
|
||||
self._magic_transit = magic_transit
|
||||
|
||||
@cached_property
|
||||
def cf_interconnects(self) -> AsyncCfInterconnectsWithRawResponse:
|
||||
return AsyncCfInterconnectsWithRawResponse(self._magic_transit.cf_interconnects)
|
||||
|
||||
@cached_property
|
||||
def gre_tunnels(self) -> AsyncGRETunnelsWithRawResponse:
|
||||
return AsyncGRETunnelsWithRawResponse(self._magic_transit.gre_tunnels)
|
||||
|
||||
@cached_property
|
||||
def ipsec_tunnels(self) -> AsyncIPSECTunnelsWithRawResponse:
|
||||
return AsyncIPSECTunnelsWithRawResponse(self._magic_transit.ipsec_tunnels)
|
||||
|
||||
@cached_property
|
||||
def routes(self) -> AsyncRoutesWithRawResponse:
|
||||
return AsyncRoutesWithRawResponse(self._magic_transit.routes)
|
||||
|
||||
@cached_property
|
||||
def sites(self) -> AsyncSitesWithRawResponse:
|
||||
return AsyncSitesWithRawResponse(self._magic_transit.sites)
|
||||
|
||||
|
||||
class MagicTransitWithStreamingResponse:
|
||||
def __init__(self, magic_transit: MagicTransit) -> None:
|
||||
self._magic_transit = magic_transit
|
||||
|
||||
@cached_property
|
||||
def cf_interconnects(self) -> CfInterconnectsWithStreamingResponse:
|
||||
return CfInterconnectsWithStreamingResponse(self._magic_transit.cf_interconnects)
|
||||
|
||||
@cached_property
|
||||
def gre_tunnels(self) -> GRETunnelsWithStreamingResponse:
|
||||
return GRETunnelsWithStreamingResponse(self._magic_transit.gre_tunnels)
|
||||
|
||||
@cached_property
|
||||
def ipsec_tunnels(self) -> IPSECTunnelsWithStreamingResponse:
|
||||
return IPSECTunnelsWithStreamingResponse(self._magic_transit.ipsec_tunnels)
|
||||
|
||||
@cached_property
|
||||
def routes(self) -> RoutesWithStreamingResponse:
|
||||
return RoutesWithStreamingResponse(self._magic_transit.routes)
|
||||
|
||||
@cached_property
|
||||
def sites(self) -> SitesWithStreamingResponse:
|
||||
return SitesWithStreamingResponse(self._magic_transit.sites)
|
||||
|
||||
|
||||
class AsyncMagicTransitWithStreamingResponse:
|
||||
def __init__(self, magic_transit: AsyncMagicTransit) -> None:
|
||||
self._magic_transit = magic_transit
|
||||
|
||||
@cached_property
|
||||
def cf_interconnects(self) -> AsyncCfInterconnectsWithStreamingResponse:
|
||||
return AsyncCfInterconnectsWithStreamingResponse(self._magic_transit.cf_interconnects)
|
||||
|
||||
@cached_property
|
||||
def gre_tunnels(self) -> AsyncGRETunnelsWithStreamingResponse:
|
||||
return AsyncGRETunnelsWithStreamingResponse(self._magic_transit.gre_tunnels)
|
||||
|
||||
@cached_property
|
||||
def ipsec_tunnels(self) -> AsyncIPSECTunnelsWithStreamingResponse:
|
||||
return AsyncIPSECTunnelsWithStreamingResponse(self._magic_transit.ipsec_tunnels)
|
||||
|
||||
@cached_property
|
||||
def routes(self) -> AsyncRoutesWithStreamingResponse:
|
||||
return AsyncRoutesWithStreamingResponse(self._magic_transit.routes)
|
||||
|
||||
@cached_property
|
||||
def sites(self) -> AsyncSitesWithStreamingResponse:
|
||||
return AsyncSitesWithStreamingResponse(self._magic_transit.sites)
|
||||
|
|
@ -1,726 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Iterable, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ..._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ..._compat import cached_property
|
||||
from ..._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ..._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ..._wrappers import ResultWrapper
|
||||
from ..._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ...types.magic_transit import (
|
||||
RouteGetResponse,
|
||||
RouteListResponse,
|
||||
RouteEmptyResponse,
|
||||
RouteCreateResponse,
|
||||
RouteDeleteResponse,
|
||||
RouteUpdateResponse,
|
||||
route_empty_params,
|
||||
route_create_params,
|
||||
route_update_params,
|
||||
)
|
||||
|
||||
__all__ = ["Routes", "AsyncRoutes"]
|
||||
|
||||
|
||||
class Routes(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> RoutesWithRawResponse:
|
||||
return RoutesWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> RoutesWithStreamingResponse:
|
||||
return RoutesWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteCreateResponse:
|
||||
"""Creates a new Magic static route.
|
||||
|
||||
Use `?validate_only=true` as an optional query
|
||||
parameter to run validation only without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_identifier}/magic/routes",
|
||||
body=maybe_transform(body, route_create_params.RouteCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteCreateResponse], ResultWrapper[RouteCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
route_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
nexthop: str,
|
||||
prefix: str,
|
||||
priority: int,
|
||||
description: str | NotGiven = NOT_GIVEN,
|
||||
scope: route_update_params.Scope | NotGiven = NOT_GIVEN,
|
||||
weight: int | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteUpdateResponse:
|
||||
"""Update a specific Magic static route.
|
||||
|
||||
Use `?validate_only=true` as an optional
|
||||
query parameter to run validation only without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
route_identifier: Identifier
|
||||
|
||||
nexthop: The next-hop IP Address for the static route.
|
||||
|
||||
prefix: IP Prefix in Classless Inter-Domain Routing format.
|
||||
|
||||
priority: Priority of the static route.
|
||||
|
||||
description: An optional human provided description of the static route.
|
||||
|
||||
scope: Used only for ECMP routes.
|
||||
|
||||
weight: Optional weight of the ECMP scope - if provided.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not route_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_identifier}/magic/routes/{route_identifier}",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"nexthop": nexthop,
|
||||
"prefix": prefix,
|
||||
"priority": priority,
|
||||
"description": description,
|
||||
"scope": scope,
|
||||
"weight": weight,
|
||||
},
|
||||
route_update_params.RouteUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteUpdateResponse], ResultWrapper[RouteUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteListResponse:
|
||||
"""
|
||||
List all Magic static routes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/routes",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteListResponse], ResultWrapper[RouteListResponse]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
route_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteDeleteResponse:
|
||||
"""
|
||||
Disable and remove a specific Magic static route.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
route_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not route_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_identifier}/magic/routes/{route_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteDeleteResponse], ResultWrapper[RouteDeleteResponse]),
|
||||
)
|
||||
|
||||
def empty(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
routes: Iterable[route_empty_params.Route],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteEmptyResponse:
|
||||
"""
|
||||
Delete multiple Magic static routes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_identifier}/magic/routes",
|
||||
body=maybe_transform({"routes": routes}, route_empty_params.RouteEmptyParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteEmptyResponse], ResultWrapper[RouteEmptyResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
route_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteGetResponse:
|
||||
"""
|
||||
Get a specific Magic static route.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
route_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not route_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/routes/{route_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteGetResponse], ResultWrapper[RouteGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncRoutes(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncRoutesWithRawResponse:
|
||||
return AsyncRoutesWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncRoutesWithStreamingResponse:
|
||||
return AsyncRoutesWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
body: object,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteCreateResponse:
|
||||
"""Creates a new Magic static route.
|
||||
|
||||
Use `?validate_only=true` as an optional query
|
||||
parameter to run validation only without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_identifier}/magic/routes",
|
||||
body=await async_maybe_transform(body, route_create_params.RouteCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteCreateResponse], ResultWrapper[RouteCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
route_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
nexthop: str,
|
||||
prefix: str,
|
||||
priority: int,
|
||||
description: str | NotGiven = NOT_GIVEN,
|
||||
scope: route_update_params.Scope | NotGiven = NOT_GIVEN,
|
||||
weight: int | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteUpdateResponse:
|
||||
"""Update a specific Magic static route.
|
||||
|
||||
Use `?validate_only=true` as an optional
|
||||
query parameter to run validation only without persisting changes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
route_identifier: Identifier
|
||||
|
||||
nexthop: The next-hop IP Address for the static route.
|
||||
|
||||
prefix: IP Prefix in Classless Inter-Domain Routing format.
|
||||
|
||||
priority: Priority of the static route.
|
||||
|
||||
description: An optional human provided description of the static route.
|
||||
|
||||
scope: Used only for ECMP routes.
|
||||
|
||||
weight: Optional weight of the ECMP scope - if provided.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not route_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_identifier}/magic/routes/{route_identifier}",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"nexthop": nexthop,
|
||||
"prefix": prefix,
|
||||
"priority": priority,
|
||||
"description": description,
|
||||
"scope": scope,
|
||||
"weight": weight,
|
||||
},
|
||||
route_update_params.RouteUpdateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteUpdateResponse], ResultWrapper[RouteUpdateResponse]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteListResponse:
|
||||
"""
|
||||
List all Magic static routes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/routes",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteListResponse], ResultWrapper[RouteListResponse]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
route_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteDeleteResponse:
|
||||
"""
|
||||
Disable and remove a specific Magic static route.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
route_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not route_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_identifier}/magic/routes/{route_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteDeleteResponse], ResultWrapper[RouteDeleteResponse]),
|
||||
)
|
||||
|
||||
async def empty(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
routes: Iterable[route_empty_params.Route],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteEmptyResponse:
|
||||
"""
|
||||
Delete multiple Magic static routes.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_identifier}/magic/routes",
|
||||
body=await async_maybe_transform({"routes": routes}, route_empty_params.RouteEmptyParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteEmptyResponse], ResultWrapper[RouteEmptyResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
route_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RouteGetResponse:
|
||||
"""
|
||||
Get a specific Magic static route.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
route_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not route_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `route_identifier` but received {route_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/routes/{route_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[RouteGetResponse], ResultWrapper[RouteGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class RoutesWithRawResponse:
|
||||
def __init__(self, routes: Routes) -> None:
|
||||
self._routes = routes
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
routes.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
routes.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
routes.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
routes.delete,
|
||||
)
|
||||
self.empty = to_raw_response_wrapper(
|
||||
routes.empty,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
routes.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncRoutesWithRawResponse:
|
||||
def __init__(self, routes: AsyncRoutes) -> None:
|
||||
self._routes = routes
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
routes.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
routes.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
routes.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
routes.delete,
|
||||
)
|
||||
self.empty = async_to_raw_response_wrapper(
|
||||
routes.empty,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
routes.get,
|
||||
)
|
||||
|
||||
|
||||
class RoutesWithStreamingResponse:
|
||||
def __init__(self, routes: Routes) -> None:
|
||||
self._routes = routes
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
routes.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
routes.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
routes.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
routes.delete,
|
||||
)
|
||||
self.empty = to_streamed_response_wrapper(
|
||||
routes.empty,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
routes.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncRoutesWithStreamingResponse:
|
||||
def __init__(self, routes: AsyncRoutes) -> None:
|
||||
self._routes = routes
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
routes.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
routes.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
routes.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
routes.delete,
|
||||
)
|
||||
self.empty = async_to_streamed_response_wrapper(
|
||||
routes.empty,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
routes.get,
|
||||
)
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .acls import (
|
||||
ACLs,
|
||||
AsyncACLs,
|
||||
ACLsWithRawResponse,
|
||||
AsyncACLsWithRawResponse,
|
||||
ACLsWithStreamingResponse,
|
||||
AsyncACLsWithStreamingResponse,
|
||||
)
|
||||
from .lans import (
|
||||
Lans,
|
||||
AsyncLans,
|
||||
LansWithRawResponse,
|
||||
AsyncLansWithRawResponse,
|
||||
LansWithStreamingResponse,
|
||||
AsyncLansWithStreamingResponse,
|
||||
)
|
||||
from .wans import (
|
||||
Wans,
|
||||
AsyncWans,
|
||||
WansWithRawResponse,
|
||||
AsyncWansWithRawResponse,
|
||||
WansWithStreamingResponse,
|
||||
AsyncWansWithStreamingResponse,
|
||||
)
|
||||
from .sites import (
|
||||
Sites,
|
||||
AsyncSites,
|
||||
SitesWithRawResponse,
|
||||
AsyncSitesWithRawResponse,
|
||||
SitesWithStreamingResponse,
|
||||
AsyncSitesWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"ACLs",
|
||||
"AsyncACLs",
|
||||
"ACLsWithRawResponse",
|
||||
"AsyncACLsWithRawResponse",
|
||||
"ACLsWithStreamingResponse",
|
||||
"AsyncACLsWithStreamingResponse",
|
||||
"Lans",
|
||||
"AsyncLans",
|
||||
"LansWithRawResponse",
|
||||
"AsyncLansWithRawResponse",
|
||||
"LansWithStreamingResponse",
|
||||
"AsyncLansWithStreamingResponse",
|
||||
"Wans",
|
||||
"AsyncWans",
|
||||
"WansWithRawResponse",
|
||||
"AsyncWansWithRawResponse",
|
||||
"WansWithStreamingResponse",
|
||||
"AsyncWansWithStreamingResponse",
|
||||
"Sites",
|
||||
"AsyncSites",
|
||||
"SitesWithRawResponse",
|
||||
"AsyncSitesWithRawResponse",
|
||||
"SitesWithStreamingResponse",
|
||||
"AsyncSitesWithStreamingResponse",
|
||||
]
|
||||
|
|
@ -1,618 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.magic_transit.sites import (
|
||||
ACLGetResponse,
|
||||
ACLListResponse,
|
||||
ACLCreateResponse,
|
||||
ACLDeleteResponse,
|
||||
ACLUpdateResponse,
|
||||
acl_create_params,
|
||||
acl_update_params,
|
||||
)
|
||||
|
||||
__all__ = ["ACLs", "AsyncACLs"]
|
||||
|
||||
|
||||
class ACLs(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ACLsWithRawResponse:
|
||||
return ACLsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ACLsWithStreamingResponse:
|
||||
return ACLsWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
acl: acl_create_params.ACL | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ACLCreateResponse:
|
||||
"""
|
||||
Creates a new Site ACL.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/acls",
|
||||
body=maybe_transform({"acl": acl}, acl_create_params.ACLCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ACLCreateResponse], ResultWrapper[ACLCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
acl_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
acl: acl_update_params.ACL | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ACLUpdateResponse:
|
||||
"""
|
||||
Update a specific Site ACL.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
acl_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not acl_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/acls/{acl_identifier}",
|
||||
body=maybe_transform({"acl": acl}, acl_update_params.ACLUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ACLUpdateResponse], ResultWrapper[ACLUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ACLListResponse:
|
||||
"""
|
||||
Lists Site ACLs associated with an account.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/acls",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ACLListResponse], ResultWrapper[ACLListResponse]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
acl_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ACLDeleteResponse:
|
||||
"""
|
||||
Remove a specific Site ACL.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
acl_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not acl_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/acls/{acl_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ACLDeleteResponse], ResultWrapper[ACLDeleteResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
acl_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ACLGetResponse:
|
||||
"""
|
||||
Get a specific Site ACL.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
acl_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not acl_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/acls/{acl_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ACLGetResponse], ResultWrapper[ACLGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncACLs(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncACLsWithRawResponse:
|
||||
return AsyncACLsWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncACLsWithStreamingResponse:
|
||||
return AsyncACLsWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
acl: acl_create_params.ACL | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ACLCreateResponse:
|
||||
"""
|
||||
Creates a new Site ACL.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/acls",
|
||||
body=await async_maybe_transform({"acl": acl}, acl_create_params.ACLCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ACLCreateResponse], ResultWrapper[ACLCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
acl_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
acl: acl_update_params.ACL | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ACLUpdateResponse:
|
||||
"""
|
||||
Update a specific Site ACL.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
acl_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not acl_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/acls/{acl_identifier}",
|
||||
body=await async_maybe_transform({"acl": acl}, acl_update_params.ACLUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ACLUpdateResponse], ResultWrapper[ACLUpdateResponse]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ACLListResponse:
|
||||
"""
|
||||
Lists Site ACLs associated with an account.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/acls",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ACLListResponse], ResultWrapper[ACLListResponse]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
acl_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ACLDeleteResponse:
|
||||
"""
|
||||
Remove a specific Site ACL.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
acl_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not acl_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/acls/{acl_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ACLDeleteResponse], ResultWrapper[ACLDeleteResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
acl_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> ACLGetResponse:
|
||||
"""
|
||||
Get a specific Site ACL.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
acl_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not acl_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `acl_identifier` but received {acl_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/acls/{acl_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[ACLGetResponse], ResultWrapper[ACLGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class ACLsWithRawResponse:
|
||||
def __init__(self, acls: ACLs) -> None:
|
||||
self._acls = acls
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
acls.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
acls.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
acls.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
acls.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
acls.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncACLsWithRawResponse:
|
||||
def __init__(self, acls: AsyncACLs) -> None:
|
||||
self._acls = acls
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
acls.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
acls.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
acls.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
acls.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
acls.get,
|
||||
)
|
||||
|
||||
|
||||
class ACLsWithStreamingResponse:
|
||||
def __init__(self, acls: ACLs) -> None:
|
||||
self._acls = acls
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
acls.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
acls.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
acls.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
acls.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
acls.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncACLsWithStreamingResponse:
|
||||
def __init__(self, acls: AsyncACLs) -> None:
|
||||
self._acls = acls
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
acls.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
acls.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
acls.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
acls.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
acls.get,
|
||||
)
|
||||
|
|
@ -1,622 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.magic_transit.sites import (
|
||||
LanGetResponse,
|
||||
LanListResponse,
|
||||
LanCreateResponse,
|
||||
LanDeleteResponse,
|
||||
LanUpdateResponse,
|
||||
lan_create_params,
|
||||
lan_update_params,
|
||||
)
|
||||
|
||||
__all__ = ["Lans", "AsyncLans"]
|
||||
|
||||
|
||||
class Lans(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> LansWithRawResponse:
|
||||
return LansWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> LansWithStreamingResponse:
|
||||
return LansWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
lan: lan_create_params.Lan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LanCreateResponse:
|
||||
"""Creates a new LAN.
|
||||
|
||||
If the site is in high availability mode, static_addressing
|
||||
is required along with secondary and virtual address.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/lans",
|
||||
body=maybe_transform({"lan": lan}, lan_create_params.LanCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LanCreateResponse], ResultWrapper[LanCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
lan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
lan: lan_update_params.Lan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LanUpdateResponse:
|
||||
"""
|
||||
Update a specific LAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
lan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not lan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `lan_identifier` but received {lan_identifier!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/lans/{lan_identifier}",
|
||||
body=maybe_transform({"lan": lan}, lan_update_params.LanUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LanUpdateResponse], ResultWrapper[LanUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LanListResponse:
|
||||
"""
|
||||
Lists LANs associated with an account and site.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/lans",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LanListResponse], ResultWrapper[LanListResponse]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
lan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LanDeleteResponse:
|
||||
"""
|
||||
Remove a specific LAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
lan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not lan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `lan_identifier` but received {lan_identifier!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/lans/{lan_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LanDeleteResponse], ResultWrapper[LanDeleteResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
lan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LanGetResponse:
|
||||
"""
|
||||
Get a specific LAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
lan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not lan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `lan_identifier` but received {lan_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/lans/{lan_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LanGetResponse], ResultWrapper[LanGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncLans(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncLansWithRawResponse:
|
||||
return AsyncLansWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncLansWithStreamingResponse:
|
||||
return AsyncLansWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
lan: lan_create_params.Lan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LanCreateResponse:
|
||||
"""Creates a new LAN.
|
||||
|
||||
If the site is in high availability mode, static_addressing
|
||||
is required along with secondary and virtual address.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/lans",
|
||||
body=await async_maybe_transform({"lan": lan}, lan_create_params.LanCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LanCreateResponse], ResultWrapper[LanCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
lan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
lan: lan_update_params.Lan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LanUpdateResponse:
|
||||
"""
|
||||
Update a specific LAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
lan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not lan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `lan_identifier` but received {lan_identifier!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/lans/{lan_identifier}",
|
||||
body=await async_maybe_transform({"lan": lan}, lan_update_params.LanUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LanUpdateResponse], ResultWrapper[LanUpdateResponse]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LanListResponse:
|
||||
"""
|
||||
Lists LANs associated with an account and site.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/lans",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LanListResponse], ResultWrapper[LanListResponse]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
lan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LanDeleteResponse:
|
||||
"""
|
||||
Remove a specific LAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
lan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not lan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `lan_identifier` but received {lan_identifier!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/lans/{lan_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LanDeleteResponse], ResultWrapper[LanDeleteResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
lan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> LanGetResponse:
|
||||
"""
|
||||
Get a specific LAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
lan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not lan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `lan_identifier` but received {lan_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/lans/{lan_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[LanGetResponse], ResultWrapper[LanGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class LansWithRawResponse:
|
||||
def __init__(self, lans: Lans) -> None:
|
||||
self._lans = lans
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
lans.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
lans.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
lans.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
lans.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
lans.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncLansWithRawResponse:
|
||||
def __init__(self, lans: AsyncLans) -> None:
|
||||
self._lans = lans
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
lans.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
lans.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
lans.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
lans.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
lans.get,
|
||||
)
|
||||
|
||||
|
||||
class LansWithStreamingResponse:
|
||||
def __init__(self, lans: Lans) -> None:
|
||||
self._lans = lans
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
lans.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
lans.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
lans.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
lans.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
lans.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncLansWithStreamingResponse:
|
||||
def __init__(self, lans: AsyncLans) -> None:
|
||||
self._lans = lans
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
lans.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
lans.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
lans.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
lans.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
lans.get,
|
||||
)
|
||||
|
|
@ -1,670 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from .acls import (
|
||||
ACLs,
|
||||
AsyncACLs,
|
||||
ACLsWithRawResponse,
|
||||
AsyncACLsWithRawResponse,
|
||||
ACLsWithStreamingResponse,
|
||||
AsyncACLsWithStreamingResponse,
|
||||
)
|
||||
from .lans import (
|
||||
Lans,
|
||||
AsyncLans,
|
||||
LansWithRawResponse,
|
||||
AsyncLansWithRawResponse,
|
||||
LansWithStreamingResponse,
|
||||
AsyncLansWithStreamingResponse,
|
||||
)
|
||||
from .wans import (
|
||||
Wans,
|
||||
AsyncWans,
|
||||
WansWithRawResponse,
|
||||
AsyncWansWithRawResponse,
|
||||
WansWithStreamingResponse,
|
||||
AsyncWansWithStreamingResponse,
|
||||
)
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.magic_transit import (
|
||||
SiteGetResponse,
|
||||
SiteListResponse,
|
||||
SiteCreateResponse,
|
||||
SiteDeleteResponse,
|
||||
SiteUpdateResponse,
|
||||
site_create_params,
|
||||
site_update_params,
|
||||
)
|
||||
|
||||
__all__ = ["Sites", "AsyncSites"]
|
||||
|
||||
|
||||
class Sites(SyncAPIResource):
|
||||
@cached_property
|
||||
def acls(self) -> ACLs:
|
||||
return ACLs(self._client)
|
||||
|
||||
@cached_property
|
||||
def lans(self) -> Lans:
|
||||
return Lans(self._client)
|
||||
|
||||
@cached_property
|
||||
def wans(self) -> Wans:
|
||||
return Wans(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> SitesWithRawResponse:
|
||||
return SitesWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> SitesWithStreamingResponse:
|
||||
return SitesWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
site: site_create_params.Site | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SiteCreateResponse:
|
||||
"""
|
||||
Creates a new Site
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_identifier}/magic/sites",
|
||||
body=maybe_transform({"site": site}, site_create_params.SiteCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SiteCreateResponse], ResultWrapper[SiteCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site: site_update_params.Site | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SiteUpdateResponse:
|
||||
"""
|
||||
Update a specific Site.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}",
|
||||
body=maybe_transform({"site": site}, site_update_params.SiteUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SiteUpdateResponse], ResultWrapper[SiteUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SiteListResponse:
|
||||
"""Lists Sites associated with an account.
|
||||
|
||||
Use connector_identifier query param to
|
||||
return sites where connector_identifier matches either site.ConnectorID or
|
||||
site.SecondaryConnectorID.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SiteListResponse], ResultWrapper[SiteListResponse]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SiteDeleteResponse:
|
||||
"""
|
||||
Remove a specific Site.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SiteDeleteResponse], ResultWrapper[SiteDeleteResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SiteGetResponse:
|
||||
"""
|
||||
Get a specific Site.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SiteGetResponse], ResultWrapper[SiteGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncSites(AsyncAPIResource):
|
||||
@cached_property
|
||||
def acls(self) -> AsyncACLs:
|
||||
return AsyncACLs(self._client)
|
||||
|
||||
@cached_property
|
||||
def lans(self) -> AsyncLans:
|
||||
return AsyncLans(self._client)
|
||||
|
||||
@cached_property
|
||||
def wans(self) -> AsyncWans:
|
||||
return AsyncWans(self._client)
|
||||
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncSitesWithRawResponse:
|
||||
return AsyncSitesWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncSitesWithStreamingResponse:
|
||||
return AsyncSitesWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
site: site_create_params.Site | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SiteCreateResponse:
|
||||
"""
|
||||
Creates a new Site
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_identifier}/magic/sites",
|
||||
body=await async_maybe_transform({"site": site}, site_create_params.SiteCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SiteCreateResponse], ResultWrapper[SiteCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site: site_update_params.Site | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SiteUpdateResponse:
|
||||
"""
|
||||
Update a specific Site.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}",
|
||||
body=await async_maybe_transform({"site": site}, site_update_params.SiteUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SiteUpdateResponse], ResultWrapper[SiteUpdateResponse]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
account_identifier: str,
|
||||
*,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SiteListResponse:
|
||||
"""Lists Sites associated with an account.
|
||||
|
||||
Use connector_identifier query param to
|
||||
return sites where connector_identifier matches either site.ConnectorID or
|
||||
site.SecondaryConnectorID.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SiteListResponse], ResultWrapper[SiteListResponse]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SiteDeleteResponse:
|
||||
"""
|
||||
Remove a specific Site.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SiteDeleteResponse], ResultWrapper[SiteDeleteResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SiteGetResponse:
|
||||
"""
|
||||
Get a specific Site.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[SiteGetResponse], ResultWrapper[SiteGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class SitesWithRawResponse:
|
||||
def __init__(self, sites: Sites) -> None:
|
||||
self._sites = sites
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
sites.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
sites.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
sites.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
sites.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
sites.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def acls(self) -> ACLsWithRawResponse:
|
||||
return ACLsWithRawResponse(self._sites.acls)
|
||||
|
||||
@cached_property
|
||||
def lans(self) -> LansWithRawResponse:
|
||||
return LansWithRawResponse(self._sites.lans)
|
||||
|
||||
@cached_property
|
||||
def wans(self) -> WansWithRawResponse:
|
||||
return WansWithRawResponse(self._sites.wans)
|
||||
|
||||
|
||||
class AsyncSitesWithRawResponse:
|
||||
def __init__(self, sites: AsyncSites) -> None:
|
||||
self._sites = sites
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
sites.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
sites.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
sites.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
sites.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
sites.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def acls(self) -> AsyncACLsWithRawResponse:
|
||||
return AsyncACLsWithRawResponse(self._sites.acls)
|
||||
|
||||
@cached_property
|
||||
def lans(self) -> AsyncLansWithRawResponse:
|
||||
return AsyncLansWithRawResponse(self._sites.lans)
|
||||
|
||||
@cached_property
|
||||
def wans(self) -> AsyncWansWithRawResponse:
|
||||
return AsyncWansWithRawResponse(self._sites.wans)
|
||||
|
||||
|
||||
class SitesWithStreamingResponse:
|
||||
def __init__(self, sites: Sites) -> None:
|
||||
self._sites = sites
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
sites.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
sites.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
sites.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
sites.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
sites.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def acls(self) -> ACLsWithStreamingResponse:
|
||||
return ACLsWithStreamingResponse(self._sites.acls)
|
||||
|
||||
@cached_property
|
||||
def lans(self) -> LansWithStreamingResponse:
|
||||
return LansWithStreamingResponse(self._sites.lans)
|
||||
|
||||
@cached_property
|
||||
def wans(self) -> WansWithStreamingResponse:
|
||||
return WansWithStreamingResponse(self._sites.wans)
|
||||
|
||||
|
||||
class AsyncSitesWithStreamingResponse:
|
||||
def __init__(self, sites: AsyncSites) -> None:
|
||||
self._sites = sites
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
sites.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
sites.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
sites.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
sites.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
sites.get,
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def acls(self) -> AsyncACLsWithStreamingResponse:
|
||||
return AsyncACLsWithStreamingResponse(self._sites.acls)
|
||||
|
||||
@cached_property
|
||||
def lans(self) -> AsyncLansWithStreamingResponse:
|
||||
return AsyncLansWithStreamingResponse(self._sites.lans)
|
||||
|
||||
@cached_property
|
||||
def wans(self) -> AsyncWansWithStreamingResponse:
|
||||
return AsyncWansWithStreamingResponse(self._sites.wans)
|
||||
|
|
@ -1,618 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.magic_transit.sites import (
|
||||
WanGetResponse,
|
||||
WanListResponse,
|
||||
WanCreateResponse,
|
||||
WanDeleteResponse,
|
||||
WanUpdateResponse,
|
||||
wan_create_params,
|
||||
wan_update_params,
|
||||
)
|
||||
|
||||
__all__ = ["Wans", "AsyncWans"]
|
||||
|
||||
|
||||
class Wans(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> WansWithRawResponse:
|
||||
return WansWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> WansWithStreamingResponse:
|
||||
return WansWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
wan: wan_create_params.Wan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WanCreateResponse:
|
||||
"""
|
||||
Creates a new WAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return self._post(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/wans",
|
||||
body=maybe_transform({"wan": wan}, wan_create_params.WanCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WanCreateResponse], ResultWrapper[WanCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
wan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
wan: wan_update_params.Wan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WanUpdateResponse:
|
||||
"""
|
||||
Update a specific WAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
wan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not wan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `wan_identifier` but received {wan_identifier!r}")
|
||||
return self._put(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/wans/{wan_identifier}",
|
||||
body=maybe_transform({"wan": wan}, wan_update_params.WanUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WanUpdateResponse], ResultWrapper[WanUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WanListResponse:
|
||||
"""
|
||||
Lists WANs associated with an account and site.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/wans",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WanListResponse], ResultWrapper[WanListResponse]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
wan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WanDeleteResponse:
|
||||
"""
|
||||
Remove a specific WAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
wan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not wan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `wan_identifier` but received {wan_identifier!r}")
|
||||
return self._delete(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/wans/{wan_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WanDeleteResponse], ResultWrapper[WanDeleteResponse]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
wan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WanGetResponse:
|
||||
"""
|
||||
Get a specific WAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
wan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not wan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `wan_identifier` but received {wan_identifier!r}")
|
||||
return self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/wans/{wan_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WanGetResponse], ResultWrapper[WanGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncWans(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncWansWithRawResponse:
|
||||
return AsyncWansWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncWansWithStreamingResponse:
|
||||
return AsyncWansWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
wan: wan_create_params.Wan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WanCreateResponse:
|
||||
"""
|
||||
Creates a new WAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/wans",
|
||||
body=await async_maybe_transform({"wan": wan}, wan_create_params.WanCreateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WanCreateResponse], ResultWrapper[WanCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
wan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
wan: wan_update_params.Wan | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WanUpdateResponse:
|
||||
"""
|
||||
Update a specific WAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
wan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not wan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `wan_identifier` but received {wan_identifier!r}")
|
||||
return await self._put(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/wans/{wan_identifier}",
|
||||
body=await async_maybe_transform({"wan": wan}, wan_update_params.WanUpdateParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WanUpdateResponse], ResultWrapper[WanUpdateResponse]),
|
||||
)
|
||||
|
||||
async def list(
|
||||
self,
|
||||
site_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WanListResponse:
|
||||
"""
|
||||
Lists WANs associated with an account and site.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/wans",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WanListResponse], ResultWrapper[WanListResponse]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
wan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WanDeleteResponse:
|
||||
"""
|
||||
Remove a specific WAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
wan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not wan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `wan_identifier` but received {wan_identifier!r}")
|
||||
return await self._delete(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/wans/{wan_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WanDeleteResponse], ResultWrapper[WanDeleteResponse]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
wan_identifier: str,
|
||||
*,
|
||||
account_identifier: str,
|
||||
site_identifier: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WanGetResponse:
|
||||
"""
|
||||
Get a specific WAN.
|
||||
|
||||
Args:
|
||||
account_identifier: Identifier
|
||||
|
||||
site_identifier: Identifier
|
||||
|
||||
wan_identifier: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not account_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
|
||||
if not site_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `site_identifier` but received {site_identifier!r}")
|
||||
if not wan_identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `wan_identifier` but received {wan_identifier!r}")
|
||||
return await self._get(
|
||||
f"/accounts/{account_identifier}/magic/sites/{site_identifier}/wans/{wan_identifier}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WanGetResponse], ResultWrapper[WanGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
class WansWithRawResponse:
|
||||
def __init__(self, wans: Wans) -> None:
|
||||
self._wans = wans
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
wans.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
wans.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
wans.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
wans.delete,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
wans.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncWansWithRawResponse:
|
||||
def __init__(self, wans: AsyncWans) -> None:
|
||||
self._wans = wans
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
wans.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
wans.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
wans.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
wans.delete,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
wans.get,
|
||||
)
|
||||
|
||||
|
||||
class WansWithStreamingResponse:
|
||||
def __init__(self, wans: Wans) -> None:
|
||||
self._wans = wans
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
wans.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
wans.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
wans.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
wans.delete,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
wans.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncWansWithStreamingResponse:
|
||||
def __init__(self, wans: AsyncWans) -> None:
|
||||
self._wans = wans
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
wans.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
wans.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
wans.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
wans.delete,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
wans.get,
|
||||
)
|
||||
|
|
@ -1,39 +1,3 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .site_get_response import SiteGetResponse as SiteGetResponse
|
||||
from .route_empty_params import RouteEmptyParams as RouteEmptyParams
|
||||
from .route_get_response import RouteGetResponse as RouteGetResponse
|
||||
from .site_create_params import SiteCreateParams as SiteCreateParams
|
||||
from .site_list_response import SiteListResponse as SiteListResponse
|
||||
from .site_update_params import SiteUpdateParams as SiteUpdateParams
|
||||
from .route_create_params import RouteCreateParams as RouteCreateParams
|
||||
from .route_list_response import RouteListResponse as RouteListResponse
|
||||
from .route_update_params import RouteUpdateParams as RouteUpdateParams
|
||||
from .route_empty_response import RouteEmptyResponse as RouteEmptyResponse
|
||||
from .site_create_response import SiteCreateResponse as SiteCreateResponse
|
||||
from .site_delete_response import SiteDeleteResponse as SiteDeleteResponse
|
||||
from .site_update_response import SiteUpdateResponse as SiteUpdateResponse
|
||||
from .route_create_response import RouteCreateResponse as RouteCreateResponse
|
||||
from .route_delete_response import RouteDeleteResponse as RouteDeleteResponse
|
||||
from .route_update_response import RouteUpdateResponse as RouteUpdateResponse
|
||||
from .gre_tunnel_get_response import GRETunnelGetResponse as GRETunnelGetResponse
|
||||
from .gre_tunnel_create_params import GRETunnelCreateParams as GRETunnelCreateParams
|
||||
from .gre_tunnel_list_response import GRETunnelListResponse as GRETunnelListResponse
|
||||
from .gre_tunnel_update_params import GRETunnelUpdateParams as GRETunnelUpdateParams
|
||||
from .ipsec_tunnel_get_response import IPSECTunnelGetResponse as IPSECTunnelGetResponse
|
||||
from .gre_tunnel_create_response import GRETunnelCreateResponse as GRETunnelCreateResponse
|
||||
from .gre_tunnel_delete_response import GRETunnelDeleteResponse as GRETunnelDeleteResponse
|
||||
from .gre_tunnel_update_response import GRETunnelUpdateResponse as GRETunnelUpdateResponse
|
||||
from .ipsec_tunnel_create_params import IPSECTunnelCreateParams as IPSECTunnelCreateParams
|
||||
from .ipsec_tunnel_list_response import IPSECTunnelListResponse as IPSECTunnelListResponse
|
||||
from .ipsec_tunnel_update_params import IPSECTunnelUpdateParams as IPSECTunnelUpdateParams
|
||||
from .cf_interconnect_get_response import CfInterconnectGetResponse as CfInterconnectGetResponse
|
||||
from .ipsec_tunnel_create_response import IPSECTunnelCreateResponse as IPSECTunnelCreateResponse
|
||||
from .ipsec_tunnel_delete_response import IPSECTunnelDeleteResponse as IPSECTunnelDeleteResponse
|
||||
from .ipsec_tunnel_update_response import IPSECTunnelUpdateResponse as IPSECTunnelUpdateResponse
|
||||
from .cf_interconnect_list_response import CfInterconnectListResponse as CfInterconnectListResponse
|
||||
from .cf_interconnect_update_params import CfInterconnectUpdateParams as CfInterconnectUpdateParams
|
||||
from .cf_interconnect_update_response import CfInterconnectUpdateResponse as CfInterconnectUpdateResponse
|
||||
from .ipsec_tunnel_psk_generate_response import IPSECTunnelPSKGenerateResponse as IPSECTunnelPSKGenerateResponse
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["CfInterconnectGetResponse"]
|
||||
|
||||
|
||||
class CfInterconnectGetResponse(BaseModel):
|
||||
interconnect: Optional[object] = None
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["CfInterconnectListResponse", "Interconnect", "InterconnectGRE", "InterconnectHealthCheck"]
|
||||
|
||||
|
||||
class InterconnectGRE(BaseModel):
|
||||
cloudflare_endpoint: Optional[str] = None
|
||||
"""
|
||||
The IP address assigned to the Cloudflare side of the GRE tunnel created as part
|
||||
of the Interconnect.
|
||||
"""
|
||||
|
||||
|
||||
class InterconnectHealthCheck(BaseModel):
|
||||
enabled: Optional[bool] = None
|
||||
"""Determines whether to run healthchecks for a tunnel."""
|
||||
|
||||
rate: Optional[Literal["low", "mid", "high"]] = None
|
||||
"""How frequent the health check is run. The default value is `mid`."""
|
||||
|
||||
target: Optional[str] = None
|
||||
"""The destination address in a request type health check.
|
||||
|
||||
After the healthcheck is decapsulated at the customer end of the tunnel, the
|
||||
ICMP echo will be forwarded to this address. This field defaults to
|
||||
`customer_gre_endpoint address`.
|
||||
"""
|
||||
|
||||
type: Optional[Literal["reply", "request"]] = None
|
||||
"""The type of healthcheck to run, reply or request. The default value is `reply`."""
|
||||
|
||||
|
||||
class Interconnect(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Tunnel identifier tag."""
|
||||
|
||||
colo_name: Optional[str] = None
|
||||
"""The name of the interconnect. The name cannot share a name with other tunnels."""
|
||||
|
||||
created_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was created."""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""An optional description of the interconnect."""
|
||||
|
||||
gre: Optional[InterconnectGRE] = None
|
||||
"""The configuration specific to GRE interconnects."""
|
||||
|
||||
health_check: Optional[InterconnectHealthCheck] = None
|
||||
|
||||
interface_address: Optional[str] = None
|
||||
"""
|
||||
A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
"""
|
||||
|
||||
modified_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was last modified."""
|
||||
|
||||
mtu: Optional[int] = None
|
||||
"""The Maximum Transmission Unit (MTU) in bytes for the interconnect.
|
||||
|
||||
The minimum value is 576.
|
||||
"""
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the interconnect. The name cannot share a name with other tunnels."""
|
||||
|
||||
|
||||
class CfInterconnectListResponse(BaseModel):
|
||||
interconnects: Optional[List[Interconnect]] = None
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["CfInterconnectUpdateParams", "GRE", "HealthCheck"]
|
||||
|
||||
|
||||
class CfInterconnectUpdateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
description: str
|
||||
"""An optional description of the interconnect."""
|
||||
|
||||
gre: GRE
|
||||
"""The configuration specific to GRE interconnects."""
|
||||
|
||||
health_check: HealthCheck
|
||||
|
||||
interface_address: str
|
||||
"""
|
||||
A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
"""
|
||||
|
||||
mtu: int
|
||||
"""The Maximum Transmission Unit (MTU) in bytes for the interconnect.
|
||||
|
||||
The minimum value is 576.
|
||||
"""
|
||||
|
||||
|
||||
class GRE(TypedDict, total=False):
|
||||
cloudflare_endpoint: str
|
||||
"""
|
||||
The IP address assigned to the Cloudflare side of the GRE tunnel created as part
|
||||
of the Interconnect.
|
||||
"""
|
||||
|
||||
|
||||
class HealthCheck(TypedDict, total=False):
|
||||
enabled: bool
|
||||
"""Determines whether to run healthchecks for a tunnel."""
|
||||
|
||||
rate: Literal["low", "mid", "high"]
|
||||
"""How frequent the health check is run. The default value is `mid`."""
|
||||
|
||||
target: str
|
||||
"""The destination address in a request type health check.
|
||||
|
||||
After the healthcheck is decapsulated at the customer end of the tunnel, the
|
||||
ICMP echo will be forwarded to this address. This field defaults to
|
||||
`customer_gre_endpoint address`.
|
||||
"""
|
||||
|
||||
type: Literal["reply", "request"]
|
||||
"""The type of healthcheck to run, reply or request. The default value is `reply`."""
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["CfInterconnectUpdateResponse"]
|
||||
|
||||
|
||||
class CfInterconnectUpdateResponse(BaseModel):
|
||||
modified: Optional[bool] = None
|
||||
|
||||
modified_interconnect: Optional[object] = None
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["GRETunnelCreateParams"]
|
||||
|
||||
|
||||
class GRETunnelCreateParams(TypedDict, total=False):
|
||||
body: Required[object]
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["GRETunnelCreateResponse", "GRETunnel", "GRETunnelHealthCheck"]
|
||||
|
||||
|
||||
class GRETunnelHealthCheck(BaseModel):
|
||||
direction: Optional[Literal["unidirectional", "bidirectional"]] = None
|
||||
"""The direction of the flow of the healthcheck.
|
||||
|
||||
Either unidirectional, where the probe comes to you via the tunnel and the
|
||||
result comes back to Cloudflare via the open Internet, or bidirectional where
|
||||
both the probe and result come and go via the tunnel. Note in the case of
|
||||
bidirecitonal healthchecks, the target field in health_check is ignored as the
|
||||
interface_address is used to send traffic into the tunnel.
|
||||
"""
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
"""Determines whether to run healthchecks for a tunnel."""
|
||||
|
||||
rate: Optional[Literal["low", "mid", "high"]] = None
|
||||
"""How frequent the health check is run. The default value is `mid`."""
|
||||
|
||||
target: Optional[str] = None
|
||||
"""The destination address in a request type health check.
|
||||
|
||||
After the healthcheck is decapsulated at the customer end of the tunnel, the
|
||||
ICMP echo will be forwarded to this address. This field defaults to
|
||||
`customer_gre_endpoint address`. This field is ignored for bidirectional
|
||||
healthchecks as the interface_address (not assigned to the Cloudflare side of
|
||||
the tunnel) is used as the target.
|
||||
"""
|
||||
|
||||
type: Optional[Literal["reply", "request"]] = None
|
||||
"""The type of healthcheck to run, reply or request. The default value is `reply`."""
|
||||
|
||||
|
||||
class GRETunnel(BaseModel):
|
||||
cloudflare_gre_endpoint: str
|
||||
"""The IP address assigned to the Cloudflare side of the GRE tunnel."""
|
||||
|
||||
customer_gre_endpoint: str
|
||||
"""The IP address assigned to the customer side of the GRE tunnel."""
|
||||
|
||||
interface_address: str
|
||||
"""
|
||||
A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
"""
|
||||
|
||||
name: str
|
||||
"""The name of the tunnel.
|
||||
|
||||
The name cannot contain spaces or special characters, must be 15 characters or
|
||||
less, and cannot share a name with another GRE tunnel.
|
||||
"""
|
||||
|
||||
id: Optional[str] = None
|
||||
"""Tunnel identifier tag."""
|
||||
|
||||
created_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was created."""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""An optional description of the GRE tunnel."""
|
||||
|
||||
health_check: Optional[GRETunnelHealthCheck] = None
|
||||
|
||||
modified_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was last modified."""
|
||||
|
||||
mtu: Optional[int] = None
|
||||
"""Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
|
||||
|
||||
The minimum value is 576.
|
||||
"""
|
||||
|
||||
ttl: Optional[int] = None
|
||||
"""Time To Live (TTL) in number of hops of the GRE tunnel."""
|
||||
|
||||
|
||||
class GRETunnelCreateResponse(BaseModel):
|
||||
gre_tunnels: Optional[List[GRETunnel]] = None
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["GRETunnelDeleteResponse"]
|
||||
|
||||
|
||||
class GRETunnelDeleteResponse(BaseModel):
|
||||
deleted: Optional[bool] = None
|
||||
|
||||
deleted_gre_tunnel: Optional[object] = None
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["GRETunnelGetResponse"]
|
||||
|
||||
|
||||
class GRETunnelGetResponse(BaseModel):
|
||||
gre_tunnel: Optional[object] = None
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["GRETunnelListResponse", "GRETunnel", "GRETunnelHealthCheck"]
|
||||
|
||||
|
||||
class GRETunnelHealthCheck(BaseModel):
|
||||
direction: Optional[Literal["unidirectional", "bidirectional"]] = None
|
||||
"""The direction of the flow of the healthcheck.
|
||||
|
||||
Either unidirectional, where the probe comes to you via the tunnel and the
|
||||
result comes back to Cloudflare via the open Internet, or bidirectional where
|
||||
both the probe and result come and go via the tunnel. Note in the case of
|
||||
bidirecitonal healthchecks, the target field in health_check is ignored as the
|
||||
interface_address is used to send traffic into the tunnel.
|
||||
"""
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
"""Determines whether to run healthchecks for a tunnel."""
|
||||
|
||||
rate: Optional[Literal["low", "mid", "high"]] = None
|
||||
"""How frequent the health check is run. The default value is `mid`."""
|
||||
|
||||
target: Optional[str] = None
|
||||
"""The destination address in a request type health check.
|
||||
|
||||
After the healthcheck is decapsulated at the customer end of the tunnel, the
|
||||
ICMP echo will be forwarded to this address. This field defaults to
|
||||
`customer_gre_endpoint address`. This field is ignored for bidirectional
|
||||
healthchecks as the interface_address (not assigned to the Cloudflare side of
|
||||
the tunnel) is used as the target.
|
||||
"""
|
||||
|
||||
type: Optional[Literal["reply", "request"]] = None
|
||||
"""The type of healthcheck to run, reply or request. The default value is `reply`."""
|
||||
|
||||
|
||||
class GRETunnel(BaseModel):
|
||||
cloudflare_gre_endpoint: str
|
||||
"""The IP address assigned to the Cloudflare side of the GRE tunnel."""
|
||||
|
||||
customer_gre_endpoint: str
|
||||
"""The IP address assigned to the customer side of the GRE tunnel."""
|
||||
|
||||
interface_address: str
|
||||
"""
|
||||
A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
"""
|
||||
|
||||
name: str
|
||||
"""The name of the tunnel.
|
||||
|
||||
The name cannot contain spaces or special characters, must be 15 characters or
|
||||
less, and cannot share a name with another GRE tunnel.
|
||||
"""
|
||||
|
||||
id: Optional[str] = None
|
||||
"""Tunnel identifier tag."""
|
||||
|
||||
created_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was created."""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""An optional description of the GRE tunnel."""
|
||||
|
||||
health_check: Optional[GRETunnelHealthCheck] = None
|
||||
|
||||
modified_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was last modified."""
|
||||
|
||||
mtu: Optional[int] = None
|
||||
"""Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
|
||||
|
||||
The minimum value is 576.
|
||||
"""
|
||||
|
||||
ttl: Optional[int] = None
|
||||
"""Time To Live (TTL) in number of hops of the GRE tunnel."""
|
||||
|
||||
|
||||
class GRETunnelListResponse(BaseModel):
|
||||
gre_tunnels: Optional[List[GRETunnel]] = None
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["GRETunnelUpdateParams", "HealthCheck"]
|
||||
|
||||
|
||||
class GRETunnelUpdateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
cloudflare_gre_endpoint: Required[str]
|
||||
"""The IP address assigned to the Cloudflare side of the GRE tunnel."""
|
||||
|
||||
customer_gre_endpoint: Required[str]
|
||||
"""The IP address assigned to the customer side of the GRE tunnel."""
|
||||
|
||||
interface_address: Required[str]
|
||||
"""
|
||||
A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
"""
|
||||
|
||||
name: Required[str]
|
||||
"""The name of the tunnel.
|
||||
|
||||
The name cannot contain spaces or special characters, must be 15 characters or
|
||||
less, and cannot share a name with another GRE tunnel.
|
||||
"""
|
||||
|
||||
description: str
|
||||
"""An optional description of the GRE tunnel."""
|
||||
|
||||
health_check: HealthCheck
|
||||
|
||||
mtu: int
|
||||
"""Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
|
||||
|
||||
The minimum value is 576.
|
||||
"""
|
||||
|
||||
ttl: int
|
||||
"""Time To Live (TTL) in number of hops of the GRE tunnel."""
|
||||
|
||||
|
||||
class HealthCheck(TypedDict, total=False):
|
||||
direction: Literal["unidirectional", "bidirectional"]
|
||||
"""The direction of the flow of the healthcheck.
|
||||
|
||||
Either unidirectional, where the probe comes to you via the tunnel and the
|
||||
result comes back to Cloudflare via the open Internet, or bidirectional where
|
||||
both the probe and result come and go via the tunnel. Note in the case of
|
||||
bidirecitonal healthchecks, the target field in health_check is ignored as the
|
||||
interface_address is used to send traffic into the tunnel.
|
||||
"""
|
||||
|
||||
enabled: bool
|
||||
"""Determines whether to run healthchecks for a tunnel."""
|
||||
|
||||
rate: Literal["low", "mid", "high"]
|
||||
"""How frequent the health check is run. The default value is `mid`."""
|
||||
|
||||
target: str
|
||||
"""The destination address in a request type health check.
|
||||
|
||||
After the healthcheck is decapsulated at the customer end of the tunnel, the
|
||||
ICMP echo will be forwarded to this address. This field defaults to
|
||||
`customer_gre_endpoint address`. This field is ignored for bidirectional
|
||||
healthchecks as the interface_address (not assigned to the Cloudflare side of
|
||||
the tunnel) is used as the target.
|
||||
"""
|
||||
|
||||
type: Literal["reply", "request"]
|
||||
"""The type of healthcheck to run, reply or request. The default value is `reply`."""
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["GRETunnelUpdateResponse"]
|
||||
|
||||
|
||||
class GRETunnelUpdateResponse(BaseModel):
|
||||
modified: Optional[bool] = None
|
||||
|
||||
modified_gre_tunnel: Optional[object] = None
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["IPSECTunnelCreateParams", "HealthCheck"]
|
||||
|
||||
|
||||
class IPSECTunnelCreateParams(TypedDict, total=False):
|
||||
cloudflare_endpoint: Required[str]
|
||||
"""The IP address assigned to the Cloudflare side of the IPsec tunnel."""
|
||||
|
||||
interface_address: Required[str]
|
||||
"""
|
||||
A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
"""
|
||||
|
||||
name: Required[str]
|
||||
"""The name of the IPsec tunnel. The name cannot share a name with other tunnels."""
|
||||
|
||||
customer_endpoint: str
|
||||
"""The IP address assigned to the customer side of the IPsec tunnel."""
|
||||
|
||||
description: str
|
||||
"""An optional description forthe IPsec tunnel."""
|
||||
|
||||
health_check: HealthCheck
|
||||
|
||||
psk: str
|
||||
"""A randomly generated or provided string for use in the IPsec tunnel."""
|
||||
|
||||
replay_protection: bool
|
||||
"""
|
||||
If `true`, then IPsec replay protection will be supported in the
|
||||
Cloudflare-to-customer direction.
|
||||
"""
|
||||
|
||||
|
||||
class HealthCheck(TypedDict, total=False):
|
||||
direction: Literal["unidirectional", "bidirectional"]
|
||||
"""The direction of the flow of the healthcheck.
|
||||
|
||||
Either unidirectional, where the probe comes to you via the tunnel and the
|
||||
result comes back to Cloudflare via the open Internet, or bidirectional where
|
||||
both the probe and result come and go via the tunnel. Note in the case of
|
||||
bidirecitonal healthchecks, the target field in health_check is ignored as the
|
||||
interface_address is used to send traffic into the tunnel.
|
||||
"""
|
||||
|
||||
enabled: bool
|
||||
"""Determines whether to run healthchecks for a tunnel."""
|
||||
|
||||
rate: Literal["low", "mid", "high"]
|
||||
"""How frequent the health check is run. The default value is `mid`."""
|
||||
|
||||
target: str
|
||||
"""The destination address in a request type health check.
|
||||
|
||||
After the healthcheck is decapsulated at the customer end of the tunnel, the
|
||||
ICMP echo will be forwarded to this address. This field defaults to
|
||||
`customer_gre_endpoint address`. This field is ignored for bidirectional
|
||||
healthchecks as the interface_address (not assigned to the Cloudflare side of
|
||||
the tunnel) is used as the target.
|
||||
"""
|
||||
|
||||
type: Literal["reply", "request"]
|
||||
"""The type of healthcheck to run, reply or request. The default value is `reply`."""
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["IPSECTunnelCreateResponse", "IPSECTunnel", "IPSECTunnelPSKMetadata", "IPSECTunnelTunnelHealthCheck"]
|
||||
|
||||
|
||||
class IPSECTunnelPSKMetadata(BaseModel):
|
||||
last_generated_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was last modified."""
|
||||
|
||||
|
||||
class IPSECTunnelTunnelHealthCheck(BaseModel):
|
||||
enabled: Optional[bool] = None
|
||||
"""Determines whether to run healthchecks for a tunnel."""
|
||||
|
||||
rate: Optional[Literal["low", "mid", "high"]] = None
|
||||
"""How frequent the health check is run. The default value is `mid`."""
|
||||
|
||||
target: Optional[str] = None
|
||||
"""The destination address in a request type health check.
|
||||
|
||||
After the healthcheck is decapsulated at the customer end of the tunnel, the
|
||||
ICMP echo will be forwarded to this address. This field defaults to
|
||||
`customer_gre_endpoint address`.
|
||||
"""
|
||||
|
||||
type: Optional[Literal["reply", "request"]] = None
|
||||
"""The type of healthcheck to run, reply or request. The default value is `reply`."""
|
||||
|
||||
|
||||
class IPSECTunnel(BaseModel):
|
||||
cloudflare_endpoint: str
|
||||
"""The IP address assigned to the Cloudflare side of the IPsec tunnel."""
|
||||
|
||||
interface_address: str
|
||||
"""
|
||||
A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
"""
|
||||
|
||||
name: str
|
||||
"""The name of the IPsec tunnel. The name cannot share a name with other tunnels."""
|
||||
|
||||
id: Optional[str] = None
|
||||
"""Tunnel identifier tag."""
|
||||
|
||||
allow_null_cipher: Optional[bool] = None
|
||||
"""
|
||||
When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel
|
||||
(Phase 2).
|
||||
"""
|
||||
|
||||
created_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was created."""
|
||||
|
||||
customer_endpoint: Optional[str] = None
|
||||
"""The IP address assigned to the customer side of the IPsec tunnel."""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""An optional description forthe IPsec tunnel."""
|
||||
|
||||
modified_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was last modified."""
|
||||
|
||||
psk_metadata: Optional[IPSECTunnelPSKMetadata] = None
|
||||
"""The PSK metadata that includes when the PSK was generated."""
|
||||
|
||||
replay_protection: Optional[bool] = None
|
||||
"""
|
||||
If `true`, then IPsec replay protection will be supported in the
|
||||
Cloudflare-to-customer direction.
|
||||
"""
|
||||
|
||||
tunnel_health_check: Optional[IPSECTunnelTunnelHealthCheck] = None
|
||||
|
||||
|
||||
class IPSECTunnelCreateResponse(BaseModel):
|
||||
ipsec_tunnels: Optional[List[IPSECTunnel]] = None
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["IPSECTunnelDeleteResponse"]
|
||||
|
||||
|
||||
class IPSECTunnelDeleteResponse(BaseModel):
|
||||
deleted: Optional[bool] = None
|
||||
|
||||
deleted_ipsec_tunnel: Optional[object] = None
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["IPSECTunnelGetResponse"]
|
||||
|
||||
|
||||
class IPSECTunnelGetResponse(BaseModel):
|
||||
ipsec_tunnel: Optional[object] = None
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["IPSECTunnelListResponse", "IPSECTunnel", "IPSECTunnelPSKMetadata", "IPSECTunnelTunnelHealthCheck"]
|
||||
|
||||
|
||||
class IPSECTunnelPSKMetadata(BaseModel):
|
||||
last_generated_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was last modified."""
|
||||
|
||||
|
||||
class IPSECTunnelTunnelHealthCheck(BaseModel):
|
||||
enabled: Optional[bool] = None
|
||||
"""Determines whether to run healthchecks for a tunnel."""
|
||||
|
||||
rate: Optional[Literal["low", "mid", "high"]] = None
|
||||
"""How frequent the health check is run. The default value is `mid`."""
|
||||
|
||||
target: Optional[str] = None
|
||||
"""The destination address in a request type health check.
|
||||
|
||||
After the healthcheck is decapsulated at the customer end of the tunnel, the
|
||||
ICMP echo will be forwarded to this address. This field defaults to
|
||||
`customer_gre_endpoint address`.
|
||||
"""
|
||||
|
||||
type: Optional[Literal["reply", "request"]] = None
|
||||
"""The type of healthcheck to run, reply or request. The default value is `reply`."""
|
||||
|
||||
|
||||
class IPSECTunnel(BaseModel):
|
||||
cloudflare_endpoint: str
|
||||
"""The IP address assigned to the Cloudflare side of the IPsec tunnel."""
|
||||
|
||||
interface_address: str
|
||||
"""
|
||||
A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
"""
|
||||
|
||||
name: str
|
||||
"""The name of the IPsec tunnel. The name cannot share a name with other tunnels."""
|
||||
|
||||
id: Optional[str] = None
|
||||
"""Tunnel identifier tag."""
|
||||
|
||||
allow_null_cipher: Optional[bool] = None
|
||||
"""
|
||||
When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel
|
||||
(Phase 2).
|
||||
"""
|
||||
|
||||
created_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was created."""
|
||||
|
||||
customer_endpoint: Optional[str] = None
|
||||
"""The IP address assigned to the customer side of the IPsec tunnel."""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""An optional description forthe IPsec tunnel."""
|
||||
|
||||
modified_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was last modified."""
|
||||
|
||||
psk_metadata: Optional[IPSECTunnelPSKMetadata] = None
|
||||
"""The PSK metadata that includes when the PSK was generated."""
|
||||
|
||||
replay_protection: Optional[bool] = None
|
||||
"""
|
||||
If `true`, then IPsec replay protection will be supported in the
|
||||
Cloudflare-to-customer direction.
|
||||
"""
|
||||
|
||||
tunnel_health_check: Optional[IPSECTunnelTunnelHealthCheck] = None
|
||||
|
||||
|
||||
class IPSECTunnelListResponse(BaseModel):
|
||||
ipsec_tunnels: Optional[List[IPSECTunnel]] = None
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["IPSECTunnelPSKGenerateResponse", "PSKMetadata"]
|
||||
|
||||
|
||||
class PSKMetadata(BaseModel):
|
||||
last_generated_on: Optional[datetime] = None
|
||||
"""The date and time the tunnel was last modified."""
|
||||
|
||||
|
||||
class IPSECTunnelPSKGenerateResponse(BaseModel):
|
||||
ipsec_tunnel_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
psk: Optional[str] = None
|
||||
"""A randomly generated or provided string for use in the IPsec tunnel."""
|
||||
|
||||
psk_metadata: Optional[PSKMetadata] = None
|
||||
"""The PSK metadata that includes when the PSK was generated."""
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["IPSECTunnelUpdateParams", "HealthCheck"]
|
||||
|
||||
|
||||
class IPSECTunnelUpdateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
cloudflare_endpoint: Required[str]
|
||||
"""The IP address assigned to the Cloudflare side of the IPsec tunnel."""
|
||||
|
||||
interface_address: Required[str]
|
||||
"""
|
||||
A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
|
||||
of the tunnel. Select the subnet from the following private IP space:
|
||||
10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
|
||||
"""
|
||||
|
||||
name: Required[str]
|
||||
"""The name of the IPsec tunnel. The name cannot share a name with other tunnels."""
|
||||
|
||||
customer_endpoint: str
|
||||
"""The IP address assigned to the customer side of the IPsec tunnel."""
|
||||
|
||||
description: str
|
||||
"""An optional description forthe IPsec tunnel."""
|
||||
|
||||
health_check: HealthCheck
|
||||
|
||||
psk: str
|
||||
"""A randomly generated or provided string for use in the IPsec tunnel."""
|
||||
|
||||
replay_protection: bool
|
||||
"""
|
||||
If `true`, then IPsec replay protection will be supported in the
|
||||
Cloudflare-to-customer direction.
|
||||
"""
|
||||
|
||||
|
||||
class HealthCheck(TypedDict, total=False):
|
||||
direction: Literal["unidirectional", "bidirectional"]
|
||||
"""The direction of the flow of the healthcheck.
|
||||
|
||||
Either unidirectional, where the probe comes to you via the tunnel and the
|
||||
result comes back to Cloudflare via the open Internet, or bidirectional where
|
||||
both the probe and result come and go via the tunnel. Note in the case of
|
||||
bidirecitonal healthchecks, the target field in health_check is ignored as the
|
||||
interface_address is used to send traffic into the tunnel.
|
||||
"""
|
||||
|
||||
enabled: bool
|
||||
"""Determines whether to run healthchecks for a tunnel."""
|
||||
|
||||
rate: Literal["low", "mid", "high"]
|
||||
"""How frequent the health check is run. The default value is `mid`."""
|
||||
|
||||
target: str
|
||||
"""The destination address in a request type health check.
|
||||
|
||||
After the healthcheck is decapsulated at the customer end of the tunnel, the
|
||||
ICMP echo will be forwarded to this address. This field defaults to
|
||||
`customer_gre_endpoint address`. This field is ignored for bidirectional
|
||||
healthchecks as the interface_address (not assigned to the Cloudflare side of
|
||||
the tunnel) is used as the target.
|
||||
"""
|
||||
|
||||
type: Literal["reply", "request"]
|
||||
"""The type of healthcheck to run, reply or request. The default value is `reply`."""
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["IPSECTunnelUpdateResponse"]
|
||||
|
||||
|
||||
class IPSECTunnelUpdateResponse(BaseModel):
|
||||
modified: Optional[bool] = None
|
||||
|
||||
modified_ipsec_tunnel: Optional[object] = None
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["RouteCreateParams"]
|
||||
|
||||
|
||||
class RouteCreateParams(TypedDict, total=False):
|
||||
body: Required[object]
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["RouteCreateResponse", "Route", "RouteScope"]
|
||||
|
||||
|
||||
class RouteScope(BaseModel):
|
||||
colo_names: Optional[List[str]] = None
|
||||
"""List of colo names for the ECMP scope."""
|
||||
|
||||
colo_regions: Optional[List[str]] = None
|
||||
"""List of colo regions for the ECMP scope."""
|
||||
|
||||
|
||||
class Route(BaseModel):
|
||||
nexthop: str
|
||||
"""The next-hop IP Address for the static route."""
|
||||
|
||||
prefix: str
|
||||
"""IP Prefix in Classless Inter-Domain Routing format."""
|
||||
|
||||
priority: int
|
||||
"""Priority of the static route."""
|
||||
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
created_on: Optional[datetime] = None
|
||||
"""When the route was created."""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""An optional human provided description of the static route."""
|
||||
|
||||
modified_on: Optional[datetime] = None
|
||||
"""When the route was last modified."""
|
||||
|
||||
scope: Optional[RouteScope] = None
|
||||
"""Used only for ECMP routes."""
|
||||
|
||||
weight: Optional[int] = None
|
||||
"""Optional weight of the ECMP scope - if provided."""
|
||||
|
||||
|
||||
class RouteCreateResponse(BaseModel):
|
||||
routes: Optional[List[Route]] = None
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["RouteDeleteResponse"]
|
||||
|
||||
|
||||
class RouteDeleteResponse(BaseModel):
|
||||
deleted: Optional[bool] = None
|
||||
|
||||
deleted_route: Optional[object] = None
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Iterable
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["RouteEmptyParams", "Route"]
|
||||
|
||||
|
||||
class RouteEmptyParams(TypedDict, total=False):
|
||||
routes: Required[Iterable[Route]]
|
||||
|
||||
|
||||
class Route(TypedDict, total=False):
|
||||
pass
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["RouteEmptyResponse"]
|
||||
|
||||
|
||||
class RouteEmptyResponse(BaseModel):
|
||||
deleted: Optional[bool] = None
|
||||
|
||||
deleted_routes: Optional[object] = None
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["RouteGetResponse"]
|
||||
|
||||
|
||||
class RouteGetResponse(BaseModel):
|
||||
route: Optional[object] = None
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["RouteListResponse", "Route", "RouteScope"]
|
||||
|
||||
|
||||
class RouteScope(BaseModel):
|
||||
colo_names: Optional[List[str]] = None
|
||||
"""List of colo names for the ECMP scope."""
|
||||
|
||||
colo_regions: Optional[List[str]] = None
|
||||
"""List of colo regions for the ECMP scope."""
|
||||
|
||||
|
||||
class Route(BaseModel):
|
||||
nexthop: str
|
||||
"""The next-hop IP Address for the static route."""
|
||||
|
||||
prefix: str
|
||||
"""IP Prefix in Classless Inter-Domain Routing format."""
|
||||
|
||||
priority: int
|
||||
"""Priority of the static route."""
|
||||
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
created_on: Optional[datetime] = None
|
||||
"""When the route was created."""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""An optional human provided description of the static route."""
|
||||
|
||||
modified_on: Optional[datetime] = None
|
||||
"""When the route was last modified."""
|
||||
|
||||
scope: Optional[RouteScope] = None
|
||||
"""Used only for ECMP routes."""
|
||||
|
||||
weight: Optional[int] = None
|
||||
"""Optional weight of the ECMP scope - if provided."""
|
||||
|
||||
|
||||
class RouteListResponse(BaseModel):
|
||||
routes: Optional[List[Route]] = None
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["RouteUpdateParams", "Scope"]
|
||||
|
||||
|
||||
class RouteUpdateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
nexthop: Required[str]
|
||||
"""The next-hop IP Address for the static route."""
|
||||
|
||||
prefix: Required[str]
|
||||
"""IP Prefix in Classless Inter-Domain Routing format."""
|
||||
|
||||
priority: Required[int]
|
||||
"""Priority of the static route."""
|
||||
|
||||
description: str
|
||||
"""An optional human provided description of the static route."""
|
||||
|
||||
scope: Scope
|
||||
"""Used only for ECMP routes."""
|
||||
|
||||
weight: int
|
||||
"""Optional weight of the ECMP scope - if provided."""
|
||||
|
||||
|
||||
class Scope(TypedDict, total=False):
|
||||
colo_names: List[str]
|
||||
"""List of colo names for the ECMP scope."""
|
||||
|
||||
colo_regions: List[str]
|
||||
"""List of colo regions for the ECMP scope."""
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["RouteUpdateResponse"]
|
||||
|
||||
|
||||
class RouteUpdateResponse(BaseModel):
|
||||
modified: Optional[bool] = None
|
||||
|
||||
modified_route: Optional[object] = None
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["SiteCreateParams", "Site", "SiteLocation"]
|
||||
|
||||
|
||||
class SiteCreateParams(TypedDict, total=False):
|
||||
site: Site
|
||||
|
||||
|
||||
class SiteLocation(TypedDict, total=False):
|
||||
lat: str
|
||||
"""Latitude"""
|
||||
|
||||
lon: str
|
||||
"""Longitude"""
|
||||
|
||||
|
||||
class Site(TypedDict, total=False):
|
||||
name: Required[str]
|
||||
"""The name of the site."""
|
||||
|
||||
connector_id: str
|
||||
"""Magic WAN Connector identifier tag."""
|
||||
|
||||
description: str
|
||||
|
||||
ha_mode: bool
|
||||
"""Site high availability mode.
|
||||
|
||||
If set to true, the site can have two connectors and runs in high availability
|
||||
mode.
|
||||
"""
|
||||
|
||||
location: SiteLocation
|
||||
"""Location of site in latitude and longitude."""
|
||||
|
||||
secondary_connector_id: str
|
||||
"""Magic WAN Connector identifier tag. Used when high availability mode is on."""
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["SiteCreateResponse", "Site", "SiteLocation"]
|
||||
|
||||
|
||||
class SiteLocation(BaseModel):
|
||||
lat: Optional[str] = None
|
||||
"""Latitude"""
|
||||
|
||||
lon: Optional[str] = None
|
||||
"""Longitude"""
|
||||
|
||||
|
||||
class Site(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
connector_id: Optional[str] = None
|
||||
"""Magic WAN Connector identifier tag."""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
ha_mode: Optional[bool] = None
|
||||
"""Site high availability mode.
|
||||
|
||||
If set to true, the site can have two connectors and runs in high availability
|
||||
mode.
|
||||
"""
|
||||
|
||||
location: Optional[SiteLocation] = None
|
||||
"""Location of site in latitude and longitude."""
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the site."""
|
||||
|
||||
secondary_connector_id: Optional[str] = None
|
||||
"""Magic WAN Connector identifier tag. Used when high availability mode is on."""
|
||||
|
||||
|
||||
class SiteCreateResponse(BaseModel):
|
||||
site: Optional[Site] = None
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["SiteDeleteResponse", "DeletedSite", "DeletedSiteLocation"]
|
||||
|
||||
|
||||
class DeletedSiteLocation(BaseModel):
|
||||
lat: Optional[str] = None
|
||||
"""Latitude"""
|
||||
|
||||
lon: Optional[str] = None
|
||||
"""Longitude"""
|
||||
|
||||
|
||||
class DeletedSite(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
connector_id: Optional[str] = None
|
||||
"""Magic WAN Connector identifier tag."""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
ha_mode: Optional[bool] = None
|
||||
"""Site high availability mode.
|
||||
|
||||
If set to true, the site can have two connectors and runs in high availability
|
||||
mode.
|
||||
"""
|
||||
|
||||
location: Optional[DeletedSiteLocation] = None
|
||||
"""Location of site in latitude and longitude."""
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the site."""
|
||||
|
||||
secondary_connector_id: Optional[str] = None
|
||||
"""Magic WAN Connector identifier tag. Used when high availability mode is on."""
|
||||
|
||||
|
||||
class SiteDeleteResponse(BaseModel):
|
||||
deleted: Optional[bool] = None
|
||||
|
||||
deleted_site: Optional[DeletedSite] = None
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["SiteGetResponse", "Site", "SiteLocation"]
|
||||
|
||||
|
||||
class SiteLocation(BaseModel):
|
||||
lat: Optional[str] = None
|
||||
"""Latitude"""
|
||||
|
||||
lon: Optional[str] = None
|
||||
"""Longitude"""
|
||||
|
||||
|
||||
class Site(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
connector_id: Optional[str] = None
|
||||
"""Magic WAN Connector identifier tag."""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
ha_mode: Optional[bool] = None
|
||||
"""Site high availability mode.
|
||||
|
||||
If set to true, the site can have two connectors and runs in high availability
|
||||
mode.
|
||||
"""
|
||||
|
||||
location: Optional[SiteLocation] = None
|
||||
"""Location of site in latitude and longitude."""
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the site."""
|
||||
|
||||
secondary_connector_id: Optional[str] = None
|
||||
"""Magic WAN Connector identifier tag. Used when high availability mode is on."""
|
||||
|
||||
|
||||
class SiteGetResponse(BaseModel):
|
||||
site: Optional[Site] = None
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["SiteListResponse", "Site", "SiteLocation"]
|
||||
|
||||
|
||||
class SiteLocation(BaseModel):
|
||||
lat: Optional[str] = None
|
||||
"""Latitude"""
|
||||
|
||||
lon: Optional[str] = None
|
||||
"""Longitude"""
|
||||
|
||||
|
||||
class Site(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
connector_id: Optional[str] = None
|
||||
"""Magic WAN Connector identifier tag."""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
ha_mode: Optional[bool] = None
|
||||
"""Site high availability mode.
|
||||
|
||||
If set to true, the site can have two connectors and runs in high availability
|
||||
mode.
|
||||
"""
|
||||
|
||||
location: Optional[SiteLocation] = None
|
||||
"""Location of site in latitude and longitude."""
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the site."""
|
||||
|
||||
secondary_connector_id: Optional[str] = None
|
||||
"""Magic WAN Connector identifier tag. Used when high availability mode is on."""
|
||||
|
||||
|
||||
class SiteListResponse(BaseModel):
|
||||
sites: Optional[List[Site]] = None
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["SiteUpdateParams", "Site", "SiteLocation"]
|
||||
|
||||
|
||||
class SiteUpdateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
site: Site
|
||||
|
||||
|
||||
class SiteLocation(TypedDict, total=False):
|
||||
lat: str
|
||||
"""Latitude"""
|
||||
|
||||
lon: str
|
||||
"""Longitude"""
|
||||
|
||||
|
||||
class Site(TypedDict, total=False):
|
||||
connector_id: str
|
||||
"""Magic WAN Connector identifier tag."""
|
||||
|
||||
description: str
|
||||
|
||||
location: SiteLocation
|
||||
"""Location of site in latitude and longitude."""
|
||||
|
||||
name: str
|
||||
"""The name of the site."""
|
||||
|
||||
secondary_connector_id: str
|
||||
"""Magic WAN Connector identifier tag. Used when high availability mode is on."""
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..._models import BaseModel
|
||||
|
||||
__all__ = ["SiteUpdateResponse", "Site", "SiteLocation"]
|
||||
|
||||
|
||||
class SiteLocation(BaseModel):
|
||||
lat: Optional[str] = None
|
||||
"""Latitude"""
|
||||
|
||||
lon: Optional[str] = None
|
||||
"""Longitude"""
|
||||
|
||||
|
||||
class Site(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
connector_id: Optional[str] = None
|
||||
"""Magic WAN Connector identifier tag."""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
ha_mode: Optional[bool] = None
|
||||
"""Site high availability mode.
|
||||
|
||||
If set to true, the site can have two connectors and runs in high availability
|
||||
mode.
|
||||
"""
|
||||
|
||||
location: Optional[SiteLocation] = None
|
||||
"""Location of site in latitude and longitude."""
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the site."""
|
||||
|
||||
secondary_connector_id: Optional[str] = None
|
||||
"""Magic WAN Connector identifier tag. Used when high availability mode is on."""
|
||||
|
||||
|
||||
class SiteUpdateResponse(BaseModel):
|
||||
site: Optional[Site] = None
|
||||
|
|
@ -1,25 +1,3 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .acl_get_response import ACLGetResponse as ACLGetResponse
|
||||
from .lan_get_response import LanGetResponse as LanGetResponse
|
||||
from .wan_get_response import WanGetResponse as WanGetResponse
|
||||
from .acl_create_params import ACLCreateParams as ACLCreateParams
|
||||
from .acl_list_response import ACLListResponse as ACLListResponse
|
||||
from .acl_update_params import ACLUpdateParams as ACLUpdateParams
|
||||
from .lan_create_params import LanCreateParams as LanCreateParams
|
||||
from .lan_list_response import LanListResponse as LanListResponse
|
||||
from .lan_update_params import LanUpdateParams as LanUpdateParams
|
||||
from .wan_create_params import WanCreateParams as WanCreateParams
|
||||
from .wan_list_response import WanListResponse as WanListResponse
|
||||
from .wan_update_params import WanUpdateParams as WanUpdateParams
|
||||
from .acl_create_response import ACLCreateResponse as ACLCreateResponse
|
||||
from .acl_delete_response import ACLDeleteResponse as ACLDeleteResponse
|
||||
from .acl_update_response import ACLUpdateResponse as ACLUpdateResponse
|
||||
from .lan_create_response import LanCreateResponse as LanCreateResponse
|
||||
from .lan_delete_response import LanDeleteResponse as LanDeleteResponse
|
||||
from .lan_update_response import LanUpdateResponse as LanUpdateResponse
|
||||
from .wan_create_response import WanCreateResponse as WanCreateResponse
|
||||
from .wan_delete_response import WanDeleteResponse as WanDeleteResponse
|
||||
from .wan_update_response import WanUpdateResponse as WanUpdateResponse
|
||||
|
|
|
|||
|
|
@ -1,71 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Union, Iterable
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["ACLCreateParams", "ACL", "ACLLan1", "ACLLan2"]
|
||||
|
||||
|
||||
class ACLCreateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
acl: ACL
|
||||
|
||||
|
||||
class ACLLan1(TypedDict, total=False):
|
||||
lan_id: Required[str]
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: str
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Iterable[int]
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: List[Union[str, str]]
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACLLan2(TypedDict, total=False):
|
||||
lan_id: Required[str]
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: str
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Iterable[int]
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: List[Union[str, str]]
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACL(TypedDict, total=False):
|
||||
lan_1: Required[ACLLan1]
|
||||
|
||||
lan_2: Required[ACLLan2]
|
||||
|
||||
name: Required[str]
|
||||
"""The name of the ACL."""
|
||||
|
||||
description: str
|
||||
"""Description for the ACL."""
|
||||
|
||||
protocols: List[Literal["tcp", "udp", "icmp"]]
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Union, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["ACLCreateResponse", "ACL", "ACLLan1", "ACLLan2"]
|
||||
|
||||
|
||||
class ACLLan1(BaseModel):
|
||||
lan_id: str
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: Optional[str] = None
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Optional[List[int]] = None
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: Optional[List[Union[str, str]]] = None
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACLLan2(BaseModel):
|
||||
lan_id: str
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: Optional[str] = None
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Optional[List[int]] = None
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: Optional[List[Union[str, str]]] = None
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACL(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""Description for the ACL."""
|
||||
|
||||
lan_1: Optional[ACLLan1] = None
|
||||
|
||||
lan_2: Optional[ACLLan2] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the ACL."""
|
||||
|
||||
protocols: Optional[List[Literal["tcp", "udp", "icmp"]]] = None
|
||||
|
||||
|
||||
class ACLCreateResponse(BaseModel):
|
||||
acls: Optional[List[ACL]] = None
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Union, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["ACLDeleteResponse", "DeletedACL", "DeletedACLLan1", "DeletedACLLan2"]
|
||||
|
||||
|
||||
class DeletedACLLan1(BaseModel):
|
||||
lan_id: str
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: Optional[str] = None
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Optional[List[int]] = None
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: Optional[List[Union[str, str]]] = None
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class DeletedACLLan2(BaseModel):
|
||||
lan_id: str
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: Optional[str] = None
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Optional[List[int]] = None
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: Optional[List[Union[str, str]]] = None
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class DeletedACL(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""Description for the ACL."""
|
||||
|
||||
lan_1: Optional[DeletedACLLan1] = None
|
||||
|
||||
lan_2: Optional[DeletedACLLan2] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the ACL."""
|
||||
|
||||
protocols: Optional[List[Literal["tcp", "udp", "icmp"]]] = None
|
||||
|
||||
|
||||
class ACLDeleteResponse(BaseModel):
|
||||
deleted: Optional[bool] = None
|
||||
|
||||
deleted_acl: Optional[DeletedACL] = None
|
||||
"""Bidirectional ACL policy for local network traffic within a site."""
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Union, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["ACLGetResponse", "ACL", "ACLLan1", "ACLLan2"]
|
||||
|
||||
|
||||
class ACLLan1(BaseModel):
|
||||
lan_id: str
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: Optional[str] = None
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Optional[List[int]] = None
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: Optional[List[Union[str, str]]] = None
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACLLan2(BaseModel):
|
||||
lan_id: str
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: Optional[str] = None
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Optional[List[int]] = None
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: Optional[List[Union[str, str]]] = None
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACL(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""Description for the ACL."""
|
||||
|
||||
lan_1: Optional[ACLLan1] = None
|
||||
|
||||
lan_2: Optional[ACLLan2] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the ACL."""
|
||||
|
||||
protocols: Optional[List[Literal["tcp", "udp", "icmp"]]] = None
|
||||
|
||||
|
||||
class ACLGetResponse(BaseModel):
|
||||
acl: Optional[ACL] = None
|
||||
"""Bidirectional ACL policy for local network traffic within a site."""
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Union, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["ACLListResponse", "ACL", "ACLLan1", "ACLLan2"]
|
||||
|
||||
|
||||
class ACLLan1(BaseModel):
|
||||
lan_id: str
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: Optional[str] = None
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Optional[List[int]] = None
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: Optional[List[Union[str, str]]] = None
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACLLan2(BaseModel):
|
||||
lan_id: str
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: Optional[str] = None
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Optional[List[int]] = None
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: Optional[List[Union[str, str]]] = None
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACL(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""Description for the ACL."""
|
||||
|
||||
lan_1: Optional[ACLLan1] = None
|
||||
|
||||
lan_2: Optional[ACLLan2] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the ACL."""
|
||||
|
||||
protocols: Optional[List[Literal["tcp", "udp", "icmp"]]] = None
|
||||
|
||||
|
||||
class ACLListResponse(BaseModel):
|
||||
acls: Optional[List[ACL]] = None
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Union, Iterable
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["ACLUpdateParams", "ACL", "ACLLan1", "ACLLan2"]
|
||||
|
||||
|
||||
class ACLUpdateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
site_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
acl: ACL
|
||||
|
||||
|
||||
class ACLLan1(TypedDict, total=False):
|
||||
lan_id: Required[str]
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: str
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Iterable[int]
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: List[Union[str, str]]
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACLLan2(TypedDict, total=False):
|
||||
lan_id: Required[str]
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: str
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Iterable[int]
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: List[Union[str, str]]
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACL(TypedDict, total=False):
|
||||
description: str
|
||||
"""Description for the ACL."""
|
||||
|
||||
lan_1: ACLLan1
|
||||
|
||||
lan_2: ACLLan2
|
||||
|
||||
name: str
|
||||
"""The name of the ACL."""
|
||||
|
||||
protocols: List[Literal["tcp", "udp", "icmp"]]
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Union, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["ACLUpdateResponse", "ACL", "ACLLan1", "ACLLan2"]
|
||||
|
||||
|
||||
class ACLLan1(BaseModel):
|
||||
lan_id: str
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: Optional[str] = None
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Optional[List[int]] = None
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: Optional[List[Union[str, str]]] = None
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACLLan2(BaseModel):
|
||||
lan_id: str
|
||||
"""The identifier for the LAN you want to create an ACL policy with."""
|
||||
|
||||
lan_name: Optional[str] = None
|
||||
"""The name of the LAN based on the provided lan_id."""
|
||||
|
||||
ports: Optional[List[int]] = None
|
||||
"""Array of ports on the provided LAN that will be included in the ACL.
|
||||
|
||||
If no ports are provided, communication on any port on this LAN is allowed.
|
||||
"""
|
||||
|
||||
subnets: Optional[List[Union[str, str]]] = None
|
||||
"""Array of subnet IPs within the LAN that will be included in the ACL.
|
||||
|
||||
If no subnets are provided, communication on any subnets on this LAN are
|
||||
allowed.
|
||||
"""
|
||||
|
||||
|
||||
class ACL(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
"""Description for the ACL."""
|
||||
|
||||
lan_1: Optional[ACLLan1] = None
|
||||
|
||||
lan_2: Optional[ACLLan2] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the ACL."""
|
||||
|
||||
protocols: Optional[List[Literal["tcp", "udp", "icmp"]]] = None
|
||||
|
||||
|
||||
class ACLUpdateResponse(BaseModel):
|
||||
acl: Optional[ACL] = None
|
||||
"""Bidirectional ACL policy for local network traffic within a site."""
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Dict, List, Iterable
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = [
|
||||
"LanCreateParams",
|
||||
"Lan",
|
||||
"LanNat",
|
||||
"LanRoutedSubnet",
|
||||
"LanRoutedSubnetNat",
|
||||
"LanStaticAddressing",
|
||||
"LanStaticAddressingDhcpRelay",
|
||||
"LanStaticAddressingDhcpServer",
|
||||
]
|
||||
|
||||
|
||||
class LanCreateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
lan: Lan
|
||||
|
||||
|
||||
class LanNat(TypedDict, total=False):
|
||||
static_prefix: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnetNat(TypedDict, total=False):
|
||||
static_prefix: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnet(TypedDict, total=False):
|
||||
next_hop: Required[str]
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
prefix: Required[str]
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
nat: LanRoutedSubnetNat
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpRelay(TypedDict, total=False):
|
||||
server_addresses: List[str]
|
||||
"""List of DHCP server IPs."""
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpServer(TypedDict, total=False):
|
||||
dhcp_pool_end: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dhcp_pool_start: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dns_server: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
reservations: Dict[str, str]
|
||||
"""Mapping of MAC addresses to IP addresses"""
|
||||
|
||||
|
||||
class LanStaticAddressing(TypedDict, total=False):
|
||||
address: Required[str]
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
dhcp_relay: LanStaticAddressingDhcpRelay
|
||||
|
||||
dhcp_server: LanStaticAddressingDhcpServer
|
||||
|
||||
secondary_address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
virtual_address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Lan(TypedDict, total=False):
|
||||
physport: Required[int]
|
||||
|
||||
vlan_tag: Required[int]
|
||||
"""VLAN port number."""
|
||||
|
||||
description: str
|
||||
|
||||
ha_link: bool
|
||||
"""mark true to use this LAN for HA probing.
|
||||
|
||||
only works for site with HA turned on. only one LAN can be set as the ha_link.
|
||||
"""
|
||||
|
||||
nat: LanNat
|
||||
|
||||
routed_subnets: Iterable[LanRoutedSubnet]
|
||||
|
||||
static_addressing: LanStaticAddressing
|
||||
"""
|
||||
If the site is not configured in high availability mode, this configuration is
|
||||
optional (if omitted, use DHCP). However, if in high availability mode,
|
||||
static_address is required along with secondary and virtual address.
|
||||
"""
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = [
|
||||
"LanCreateResponse",
|
||||
"Lan",
|
||||
"LanNat",
|
||||
"LanRoutedSubnet",
|
||||
"LanRoutedSubnetNat",
|
||||
"LanStaticAddressing",
|
||||
"LanStaticAddressingDhcpRelay",
|
||||
"LanStaticAddressingDhcpServer",
|
||||
]
|
||||
|
||||
|
||||
class LanNat(BaseModel):
|
||||
static_prefix: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnetNat(BaseModel):
|
||||
static_prefix: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnet(BaseModel):
|
||||
next_hop: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
prefix: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
nat: Optional[LanRoutedSubnetNat] = None
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpRelay(BaseModel):
|
||||
server_addresses: Optional[List[str]] = None
|
||||
"""List of DHCP server IPs."""
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpServer(BaseModel):
|
||||
dhcp_pool_end: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dhcp_pool_start: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dns_server: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
reservations: Optional[Dict[str, str]] = None
|
||||
"""Mapping of MAC addresses to IP addresses"""
|
||||
|
||||
|
||||
class LanStaticAddressing(BaseModel):
|
||||
address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
dhcp_relay: Optional[LanStaticAddressingDhcpRelay] = None
|
||||
|
||||
dhcp_server: Optional[LanStaticAddressingDhcpServer] = None
|
||||
|
||||
secondary_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
virtual_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Lan(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
ha_link: Optional[bool] = None
|
||||
"""mark true to use this LAN for HA probing.
|
||||
|
||||
only works for site with HA turned on. only one LAN can be set as the ha_link.
|
||||
"""
|
||||
|
||||
nat: Optional[LanNat] = None
|
||||
|
||||
physport: Optional[int] = None
|
||||
|
||||
routed_subnets: Optional[List[LanRoutedSubnet]] = None
|
||||
|
||||
site_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
static_addressing: Optional[LanStaticAddressing] = None
|
||||
"""
|
||||
If the site is not configured in high availability mode, this configuration is
|
||||
optional (if omitted, use DHCP). However, if in high availability mode,
|
||||
static_address is required along with secondary and virtual address.
|
||||
"""
|
||||
|
||||
vlan_tag: Optional[int] = None
|
||||
"""VLAN port number."""
|
||||
|
||||
|
||||
class LanCreateResponse(BaseModel):
|
||||
lans: Optional[List[Lan]] = None
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = [
|
||||
"LanDeleteResponse",
|
||||
"DeletedLan",
|
||||
"DeletedLanNat",
|
||||
"DeletedLanRoutedSubnet",
|
||||
"DeletedLanRoutedSubnetNat",
|
||||
"DeletedLanStaticAddressing",
|
||||
"DeletedLanStaticAddressingDhcpRelay",
|
||||
"DeletedLanStaticAddressingDhcpServer",
|
||||
]
|
||||
|
||||
|
||||
class DeletedLanNat(BaseModel):
|
||||
static_prefix: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class DeletedLanRoutedSubnetNat(BaseModel):
|
||||
static_prefix: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class DeletedLanRoutedSubnet(BaseModel):
|
||||
next_hop: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
prefix: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
nat: Optional[DeletedLanRoutedSubnetNat] = None
|
||||
|
||||
|
||||
class DeletedLanStaticAddressingDhcpRelay(BaseModel):
|
||||
server_addresses: Optional[List[str]] = None
|
||||
"""List of DHCP server IPs."""
|
||||
|
||||
|
||||
class DeletedLanStaticAddressingDhcpServer(BaseModel):
|
||||
dhcp_pool_end: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dhcp_pool_start: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dns_server: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
reservations: Optional[Dict[str, str]] = None
|
||||
"""Mapping of MAC addresses to IP addresses"""
|
||||
|
||||
|
||||
class DeletedLanStaticAddressing(BaseModel):
|
||||
address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
dhcp_relay: Optional[DeletedLanStaticAddressingDhcpRelay] = None
|
||||
|
||||
dhcp_server: Optional[DeletedLanStaticAddressingDhcpServer] = None
|
||||
|
||||
secondary_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
virtual_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class DeletedLan(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
ha_link: Optional[bool] = None
|
||||
"""mark true to use this LAN for HA probing.
|
||||
|
||||
only works for site with HA turned on. only one LAN can be set as the ha_link.
|
||||
"""
|
||||
|
||||
nat: Optional[DeletedLanNat] = None
|
||||
|
||||
physport: Optional[int] = None
|
||||
|
||||
routed_subnets: Optional[List[DeletedLanRoutedSubnet]] = None
|
||||
|
||||
site_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
static_addressing: Optional[DeletedLanStaticAddressing] = None
|
||||
"""
|
||||
If the site is not configured in high availability mode, this configuration is
|
||||
optional (if omitted, use DHCP). However, if in high availability mode,
|
||||
static_address is required along with secondary and virtual address.
|
||||
"""
|
||||
|
||||
vlan_tag: Optional[int] = None
|
||||
"""VLAN port number."""
|
||||
|
||||
|
||||
class LanDeleteResponse(BaseModel):
|
||||
deleted: Optional[bool] = None
|
||||
|
||||
deleted_lan: Optional[DeletedLan] = None
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = [
|
||||
"LanGetResponse",
|
||||
"Lan",
|
||||
"LanNat",
|
||||
"LanRoutedSubnet",
|
||||
"LanRoutedSubnetNat",
|
||||
"LanStaticAddressing",
|
||||
"LanStaticAddressingDhcpRelay",
|
||||
"LanStaticAddressingDhcpServer",
|
||||
]
|
||||
|
||||
|
||||
class LanNat(BaseModel):
|
||||
static_prefix: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnetNat(BaseModel):
|
||||
static_prefix: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnet(BaseModel):
|
||||
next_hop: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
prefix: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
nat: Optional[LanRoutedSubnetNat] = None
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpRelay(BaseModel):
|
||||
server_addresses: Optional[List[str]] = None
|
||||
"""List of DHCP server IPs."""
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpServer(BaseModel):
|
||||
dhcp_pool_end: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dhcp_pool_start: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dns_server: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
reservations: Optional[Dict[str, str]] = None
|
||||
"""Mapping of MAC addresses to IP addresses"""
|
||||
|
||||
|
||||
class LanStaticAddressing(BaseModel):
|
||||
address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
dhcp_relay: Optional[LanStaticAddressingDhcpRelay] = None
|
||||
|
||||
dhcp_server: Optional[LanStaticAddressingDhcpServer] = None
|
||||
|
||||
secondary_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
virtual_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Lan(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
ha_link: Optional[bool] = None
|
||||
"""mark true to use this LAN for HA probing.
|
||||
|
||||
only works for site with HA turned on. only one LAN can be set as the ha_link.
|
||||
"""
|
||||
|
||||
nat: Optional[LanNat] = None
|
||||
|
||||
physport: Optional[int] = None
|
||||
|
||||
routed_subnets: Optional[List[LanRoutedSubnet]] = None
|
||||
|
||||
site_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
static_addressing: Optional[LanStaticAddressing] = None
|
||||
"""
|
||||
If the site is not configured in high availability mode, this configuration is
|
||||
optional (if omitted, use DHCP). However, if in high availability mode,
|
||||
static_address is required along with secondary and virtual address.
|
||||
"""
|
||||
|
||||
vlan_tag: Optional[int] = None
|
||||
"""VLAN port number."""
|
||||
|
||||
|
||||
class LanGetResponse(BaseModel):
|
||||
lan: Optional[Lan] = None
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = [
|
||||
"LanListResponse",
|
||||
"Lan",
|
||||
"LanNat",
|
||||
"LanRoutedSubnet",
|
||||
"LanRoutedSubnetNat",
|
||||
"LanStaticAddressing",
|
||||
"LanStaticAddressingDhcpRelay",
|
||||
"LanStaticAddressingDhcpServer",
|
||||
]
|
||||
|
||||
|
||||
class LanNat(BaseModel):
|
||||
static_prefix: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnetNat(BaseModel):
|
||||
static_prefix: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnet(BaseModel):
|
||||
next_hop: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
prefix: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
nat: Optional[LanRoutedSubnetNat] = None
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpRelay(BaseModel):
|
||||
server_addresses: Optional[List[str]] = None
|
||||
"""List of DHCP server IPs."""
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpServer(BaseModel):
|
||||
dhcp_pool_end: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dhcp_pool_start: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dns_server: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
reservations: Optional[Dict[str, str]] = None
|
||||
"""Mapping of MAC addresses to IP addresses"""
|
||||
|
||||
|
||||
class LanStaticAddressing(BaseModel):
|
||||
address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
dhcp_relay: Optional[LanStaticAddressingDhcpRelay] = None
|
||||
|
||||
dhcp_server: Optional[LanStaticAddressingDhcpServer] = None
|
||||
|
||||
secondary_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
virtual_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Lan(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
ha_link: Optional[bool] = None
|
||||
"""mark true to use this LAN for HA probing.
|
||||
|
||||
only works for site with HA turned on. only one LAN can be set as the ha_link.
|
||||
"""
|
||||
|
||||
nat: Optional[LanNat] = None
|
||||
|
||||
physport: Optional[int] = None
|
||||
|
||||
routed_subnets: Optional[List[LanRoutedSubnet]] = None
|
||||
|
||||
site_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
static_addressing: Optional[LanStaticAddressing] = None
|
||||
"""
|
||||
If the site is not configured in high availability mode, this configuration is
|
||||
optional (if omitted, use DHCP). However, if in high availability mode,
|
||||
static_address is required along with secondary and virtual address.
|
||||
"""
|
||||
|
||||
vlan_tag: Optional[int] = None
|
||||
"""VLAN port number."""
|
||||
|
||||
|
||||
class LanListResponse(BaseModel):
|
||||
lans: Optional[List[Lan]] = None
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Dict, List, Iterable
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = [
|
||||
"LanUpdateParams",
|
||||
"Lan",
|
||||
"LanNat",
|
||||
"LanRoutedSubnet",
|
||||
"LanRoutedSubnetNat",
|
||||
"LanStaticAddressing",
|
||||
"LanStaticAddressingDhcpRelay",
|
||||
"LanStaticAddressingDhcpServer",
|
||||
]
|
||||
|
||||
|
||||
class LanUpdateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
site_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
lan: Lan
|
||||
|
||||
|
||||
class LanNat(TypedDict, total=False):
|
||||
static_prefix: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnetNat(TypedDict, total=False):
|
||||
static_prefix: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnet(TypedDict, total=False):
|
||||
next_hop: Required[str]
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
prefix: Required[str]
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
nat: LanRoutedSubnetNat
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpRelay(TypedDict, total=False):
|
||||
server_addresses: List[str]
|
||||
"""List of DHCP server IPs."""
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpServer(TypedDict, total=False):
|
||||
dhcp_pool_end: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dhcp_pool_start: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dns_server: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
reservations: Dict[str, str]
|
||||
"""Mapping of MAC addresses to IP addresses"""
|
||||
|
||||
|
||||
class LanStaticAddressing(TypedDict, total=False):
|
||||
address: Required[str]
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
dhcp_relay: LanStaticAddressingDhcpRelay
|
||||
|
||||
dhcp_server: LanStaticAddressingDhcpServer
|
||||
|
||||
secondary_address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
virtual_address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Lan(TypedDict, total=False):
|
||||
description: str
|
||||
|
||||
nat: LanNat
|
||||
|
||||
physport: int
|
||||
|
||||
routed_subnets: Iterable[LanRoutedSubnet]
|
||||
|
||||
static_addressing: LanStaticAddressing
|
||||
"""
|
||||
If the site is not configured in high availability mode, this configuration is
|
||||
optional (if omitted, use DHCP). However, if in high availability mode,
|
||||
static_address is required along with secondary and virtual address.
|
||||
"""
|
||||
|
||||
vlan_tag: int
|
||||
"""VLAN port number."""
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = [
|
||||
"LanUpdateResponse",
|
||||
"Lan",
|
||||
"LanNat",
|
||||
"LanRoutedSubnet",
|
||||
"LanRoutedSubnetNat",
|
||||
"LanStaticAddressing",
|
||||
"LanStaticAddressingDhcpRelay",
|
||||
"LanStaticAddressingDhcpServer",
|
||||
]
|
||||
|
||||
|
||||
class LanNat(BaseModel):
|
||||
static_prefix: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnetNat(BaseModel):
|
||||
static_prefix: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class LanRoutedSubnet(BaseModel):
|
||||
next_hop: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
prefix: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
nat: Optional[LanRoutedSubnetNat] = None
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpRelay(BaseModel):
|
||||
server_addresses: Optional[List[str]] = None
|
||||
"""List of DHCP server IPs."""
|
||||
|
||||
|
||||
class LanStaticAddressingDhcpServer(BaseModel):
|
||||
dhcp_pool_end: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dhcp_pool_start: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
dns_server: Optional[str] = None
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
reservations: Optional[Dict[str, str]] = None
|
||||
"""Mapping of MAC addresses to IP addresses"""
|
||||
|
||||
|
||||
class LanStaticAddressing(BaseModel):
|
||||
address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
dhcp_relay: Optional[LanStaticAddressingDhcpRelay] = None
|
||||
|
||||
dhcp_server: Optional[LanStaticAddressingDhcpServer] = None
|
||||
|
||||
secondary_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
virtual_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Lan(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
ha_link: Optional[bool] = None
|
||||
"""mark true to use this LAN for HA probing.
|
||||
|
||||
only works for site with HA turned on. only one LAN can be set as the ha_link.
|
||||
"""
|
||||
|
||||
nat: Optional[LanNat] = None
|
||||
|
||||
physport: Optional[int] = None
|
||||
|
||||
routed_subnets: Optional[List[LanRoutedSubnet]] = None
|
||||
|
||||
site_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
static_addressing: Optional[LanStaticAddressing] = None
|
||||
"""
|
||||
If the site is not configured in high availability mode, this configuration is
|
||||
optional (if omitted, use DHCP). However, if in high availability mode,
|
||||
static_address is required along with secondary and virtual address.
|
||||
"""
|
||||
|
||||
vlan_tag: Optional[int] = None
|
||||
"""VLAN port number."""
|
||||
|
||||
|
||||
class LanUpdateResponse(BaseModel):
|
||||
lan: Optional[Lan] = None
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["WanCreateParams", "Wan", "WanStaticAddressing"]
|
||||
|
||||
|
||||
class WanCreateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
wan: Wan
|
||||
|
||||
|
||||
class WanStaticAddressing(TypedDict, total=False):
|
||||
address: Required[str]
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
gateway_address: Required[str]
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
secondary_address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Wan(TypedDict, total=False):
|
||||
physport: Required[int]
|
||||
|
||||
vlan_tag: Required[int]
|
||||
"""VLAN port number."""
|
||||
|
||||
description: str
|
||||
|
||||
priority: int
|
||||
|
||||
static_addressing: WanStaticAddressing
|
||||
"""(optional) if omitted, use DHCP.
|
||||
|
||||
Submit secondary_address when site is in high availability mode.
|
||||
"""
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["WanCreateResponse", "Wan", "WanStaticAddressing"]
|
||||
|
||||
|
||||
class WanStaticAddressing(BaseModel):
|
||||
address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
gateway_address: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
secondary_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Wan(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
physport: Optional[int] = None
|
||||
|
||||
priority: Optional[int] = None
|
||||
"""Priority of WAN for traffic loadbalancing."""
|
||||
|
||||
site_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
static_addressing: Optional[WanStaticAddressing] = None
|
||||
"""(optional) if omitted, use DHCP.
|
||||
|
||||
Submit secondary_address when site is in high availability mode.
|
||||
"""
|
||||
|
||||
vlan_tag: Optional[int] = None
|
||||
"""VLAN port number."""
|
||||
|
||||
|
||||
class WanCreateResponse(BaseModel):
|
||||
wans: Optional[List[Wan]] = None
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["WanDeleteResponse", "DeletedWan", "DeletedWanStaticAddressing"]
|
||||
|
||||
|
||||
class DeletedWanStaticAddressing(BaseModel):
|
||||
address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
gateway_address: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
secondary_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class DeletedWan(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
physport: Optional[int] = None
|
||||
|
||||
priority: Optional[int] = None
|
||||
"""Priority of WAN for traffic loadbalancing."""
|
||||
|
||||
site_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
static_addressing: Optional[DeletedWanStaticAddressing] = None
|
||||
"""(optional) if omitted, use DHCP.
|
||||
|
||||
Submit secondary_address when site is in high availability mode.
|
||||
"""
|
||||
|
||||
vlan_tag: Optional[int] = None
|
||||
"""VLAN port number."""
|
||||
|
||||
|
||||
class WanDeleteResponse(BaseModel):
|
||||
deleted: Optional[bool] = None
|
||||
|
||||
deleted_wan: Optional[DeletedWan] = None
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["WanGetResponse", "Wan", "WanStaticAddressing"]
|
||||
|
||||
|
||||
class WanStaticAddressing(BaseModel):
|
||||
address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
gateway_address: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
secondary_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Wan(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
physport: Optional[int] = None
|
||||
|
||||
priority: Optional[int] = None
|
||||
"""Priority of WAN for traffic loadbalancing."""
|
||||
|
||||
site_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
static_addressing: Optional[WanStaticAddressing] = None
|
||||
"""(optional) if omitted, use DHCP.
|
||||
|
||||
Submit secondary_address when site is in high availability mode.
|
||||
"""
|
||||
|
||||
vlan_tag: Optional[int] = None
|
||||
"""VLAN port number."""
|
||||
|
||||
|
||||
class WanGetResponse(BaseModel):
|
||||
wan: Optional[Wan] = None
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["WanListResponse", "Wan", "WanStaticAddressing"]
|
||||
|
||||
|
||||
class WanStaticAddressing(BaseModel):
|
||||
address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
gateway_address: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
secondary_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Wan(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
physport: Optional[int] = None
|
||||
|
||||
priority: Optional[int] = None
|
||||
"""Priority of WAN for traffic loadbalancing."""
|
||||
|
||||
site_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
static_addressing: Optional[WanStaticAddressing] = None
|
||||
"""(optional) if omitted, use DHCP.
|
||||
|
||||
Submit secondary_address when site is in high availability mode.
|
||||
"""
|
||||
|
||||
vlan_tag: Optional[int] = None
|
||||
"""VLAN port number."""
|
||||
|
||||
|
||||
class WanListResponse(BaseModel):
|
||||
wans: Optional[List[Wan]] = None
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["WanUpdateParams", "Wan", "WanStaticAddressing"]
|
||||
|
||||
|
||||
class WanUpdateParams(TypedDict, total=False):
|
||||
account_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
site_identifier: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
wan: Wan
|
||||
|
||||
|
||||
class WanStaticAddressing(TypedDict, total=False):
|
||||
address: Required[str]
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
gateway_address: Required[str]
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
secondary_address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Wan(TypedDict, total=False):
|
||||
description: str
|
||||
|
||||
physport: int
|
||||
|
||||
priority: int
|
||||
|
||||
static_addressing: WanStaticAddressing
|
||||
"""(optional) if omitted, use DHCP.
|
||||
|
||||
Submit secondary_address when site is in high availability mode.
|
||||
"""
|
||||
|
||||
vlan_tag: int
|
||||
"""VLAN port number."""
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ...._models import BaseModel
|
||||
|
||||
__all__ = ["WanUpdateResponse", "Wan", "WanStaticAddressing"]
|
||||
|
||||
|
||||
class WanStaticAddressing(BaseModel):
|
||||
address: str
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
gateway_address: str
|
||||
"""A valid IPv4 address."""
|
||||
|
||||
secondary_address: Optional[str] = None
|
||||
"""A valid CIDR notation representing an IP range."""
|
||||
|
||||
|
||||
class Wan(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
description: Optional[str] = None
|
||||
|
||||
physport: Optional[int] = None
|
||||
|
||||
priority: Optional[int] = None
|
||||
"""Priority of WAN for traffic loadbalancing."""
|
||||
|
||||
site_id: Optional[str] = None
|
||||
"""Identifier"""
|
||||
|
||||
static_addressing: Optional[WanStaticAddressing] = None
|
||||
"""(optional) if omitted, use DHCP.
|
||||
|
||||
Submit secondary_address when site is in high availability mode.
|
||||
"""
|
||||
|
||||
vlan_tag: Optional[int] = None
|
||||
"""VLAN port number."""
|
||||
|
||||
|
||||
class WanUpdateResponse(BaseModel):
|
||||
wan: Optional[Wan] = None
|
||||
|
|
@ -1,726 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from cloudflare import Cloudflare, AsyncCloudflare
|
||||
from tests.utils import assert_matches_type
|
||||
from cloudflare.types.magic_transit.sites import (
|
||||
ACLGetResponse,
|
||||
ACLListResponse,
|
||||
ACLCreateResponse,
|
||||
ACLDeleteResponse,
|
||||
ACLUpdateResponse,
|
||||
)
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestACLs:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create(self, client: Cloudflare) -> None:
|
||||
acl = client.magic_transit.sites.acls.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(ACLCreateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
|
||||
acl = client.magic_transit.sites.acls.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
acl={
|
||||
"description": "Allows local traffic between PIN pads and cash register.",
|
||||
"lan_1": {
|
||||
"lan_id": "string",
|
||||
"lan_name": "string",
|
||||
"ports": [1, 1, 1],
|
||||
"subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"],
|
||||
},
|
||||
"lan_2": {
|
||||
"lan_id": "string",
|
||||
"lan_name": "string",
|
||||
"ports": [1, 1, 1],
|
||||
"subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"],
|
||||
},
|
||||
"name": "PIN Pad - Cash Register",
|
||||
"protocols": ["tcp", "udp", "icmp"],
|
||||
},
|
||||
)
|
||||
assert_matches_type(ACLCreateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.acls.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
acl = response.parse()
|
||||
assert_matches_type(ACLCreateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.acls.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
acl = response.parse()
|
||||
assert_matches_type(ACLCreateResponse, acl, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_create(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.create(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update(self, client: Cloudflare) -> None:
|
||||
acl = client.magic_transit.sites.acls.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(ACLUpdateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
|
||||
acl = client.magic_transit.sites.acls.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
acl={
|
||||
"description": "Allows local traffic between PIN pads and cash register.",
|
||||
"lan_1": {
|
||||
"lan_id": "string",
|
||||
"lan_name": "string",
|
||||
"ports": [1, 1, 1],
|
||||
"subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"],
|
||||
},
|
||||
"lan_2": {
|
||||
"lan_id": "string",
|
||||
"lan_name": "string",
|
||||
"ports": [1, 1, 1],
|
||||
"subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"],
|
||||
},
|
||||
"name": "PIN Pad - Cash Register",
|
||||
"protocols": ["tcp", "udp", "icmp"],
|
||||
},
|
||||
)
|
||||
assert_matches_type(ACLUpdateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_update(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.acls.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
acl = response.parse()
|
||||
assert_matches_type(ACLUpdateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_update(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.acls.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
acl = response.parse()
|
||||
assert_matches_type(ACLUpdateResponse, acl, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_update(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Cloudflare) -> None:
|
||||
acl = client.magic_transit.sites.acls.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(ACLListResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.acls.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
acl = response.parse()
|
||||
assert_matches_type(ACLListResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.acls.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
acl = response.parse()
|
||||
assert_matches_type(ACLListResponse, acl, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_list(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.list(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_delete(self, client: Cloudflare) -> None:
|
||||
acl = client.magic_transit.sites.acls.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(ACLDeleteResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.acls.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
acl = response.parse()
|
||||
assert_matches_type(ACLDeleteResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.acls.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
acl = response.parse()
|
||||
assert_matches_type(ACLDeleteResponse, acl, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_delete(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_get(self, client: Cloudflare) -> None:
|
||||
acl = client.magic_transit.sites.acls.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(ACLGetResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.acls.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
acl = response.parse()
|
||||
assert_matches_type(ACLGetResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.acls.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
acl = response.parse()
|
||||
assert_matches_type(ACLGetResponse, acl, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_get(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"):
|
||||
client.magic_transit.sites.acls.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
|
||||
class TestAsyncACLs:
|
||||
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
|
||||
acl = await async_client.magic_transit.sites.acls.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(ACLCreateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
acl = await async_client.magic_transit.sites.acls.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
acl={
|
||||
"description": "Allows local traffic between PIN pads and cash register.",
|
||||
"lan_1": {
|
||||
"lan_id": "string",
|
||||
"lan_name": "string",
|
||||
"ports": [1, 1, 1],
|
||||
"subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"],
|
||||
},
|
||||
"lan_2": {
|
||||
"lan_id": "string",
|
||||
"lan_name": "string",
|
||||
"ports": [1, 1, 1],
|
||||
"subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"],
|
||||
},
|
||||
"name": "PIN Pad - Cash Register",
|
||||
"protocols": ["tcp", "udp", "icmp"],
|
||||
},
|
||||
)
|
||||
assert_matches_type(ACLCreateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.acls.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
acl = await response.parse()
|
||||
assert_matches_type(ACLCreateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.acls.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
acl = await response.parse()
|
||||
assert_matches_type(ACLCreateResponse, acl, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.create(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
|
||||
acl = await async_client.magic_transit.sites.acls.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(ACLUpdateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
acl = await async_client.magic_transit.sites.acls.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
acl={
|
||||
"description": "Allows local traffic between PIN pads and cash register.",
|
||||
"lan_1": {
|
||||
"lan_id": "string",
|
||||
"lan_name": "string",
|
||||
"ports": [1, 1, 1],
|
||||
"subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"],
|
||||
},
|
||||
"lan_2": {
|
||||
"lan_id": "string",
|
||||
"lan_name": "string",
|
||||
"ports": [1, 1, 1],
|
||||
"subnets": ["192.0.2.1", "192.0.2.1", "192.0.2.1"],
|
||||
},
|
||||
"name": "PIN Pad - Cash Register",
|
||||
"protocols": ["tcp", "udp", "icmp"],
|
||||
},
|
||||
)
|
||||
assert_matches_type(ACLUpdateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.acls.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
acl = await response.parse()
|
||||
assert_matches_type(ACLUpdateResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.acls.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
acl = await response.parse()
|
||||
assert_matches_type(ACLUpdateResponse, acl, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
|
||||
acl = await async_client.magic_transit.sites.acls.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(ACLListResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.acls.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
acl = await response.parse()
|
||||
assert_matches_type(ACLListResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.acls.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
acl = await response.parse()
|
||||
assert_matches_type(ACLListResponse, acl, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.list(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
acl = await async_client.magic_transit.sites.acls.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(ACLDeleteResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.acls.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
acl = await response.parse()
|
||||
assert_matches_type(ACLDeleteResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.acls.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
acl = await response.parse()
|
||||
assert_matches_type(ACLDeleteResponse, acl, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
|
||||
acl = await async_client.magic_transit.sites.acls.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(ACLGetResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.acls.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
acl = await response.parse()
|
||||
assert_matches_type(ACLGetResponse, acl, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.acls.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
acl = await response.parse()
|
||||
assert_matches_type(ACLGetResponse, acl, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `acl_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.acls.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
|
@ -1,812 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from cloudflare import Cloudflare, AsyncCloudflare
|
||||
from tests.utils import assert_matches_type
|
||||
from cloudflare.types.magic_transit.sites import (
|
||||
LanGetResponse,
|
||||
LanListResponse,
|
||||
LanCreateResponse,
|
||||
LanDeleteResponse,
|
||||
LanUpdateResponse,
|
||||
)
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestLans:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create(self, client: Cloudflare) -> None:
|
||||
lan = client.magic_transit.sites.lans.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(LanCreateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
|
||||
lan = client.magic_transit.sites.lans.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
lan={
|
||||
"description": "string",
|
||||
"ha_link": True,
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"physport": 1,
|
||||
"routed_subnets": [
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
],
|
||||
"static_addressing": {
|
||||
"address": "192.0.2.0/24",
|
||||
"dhcp_relay": {"server_addresses": ["192.0.2.1", "192.0.2.1", "192.0.2.1"]},
|
||||
"dhcp_server": {
|
||||
"dhcp_pool_end": "192.0.2.1",
|
||||
"dhcp_pool_start": "192.0.2.1",
|
||||
"dns_server": "192.0.2.1",
|
||||
"reservations": {
|
||||
"00:11:22:33:44:55": "192.0.2.100",
|
||||
"AA:BB:CC:DD:EE:FF": "192.168.1.101",
|
||||
},
|
||||
},
|
||||
"secondary_address": "192.0.2.0/24",
|
||||
"virtual_address": "192.0.2.0/24",
|
||||
},
|
||||
"vlan_tag": 0,
|
||||
},
|
||||
)
|
||||
assert_matches_type(LanCreateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.lans.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
lan = response.parse()
|
||||
assert_matches_type(LanCreateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.lans.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
lan = response.parse()
|
||||
assert_matches_type(LanCreateResponse, lan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_create(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.create(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update(self, client: Cloudflare) -> None:
|
||||
lan = client.magic_transit.sites.lans.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(LanUpdateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
|
||||
lan = client.magic_transit.sites.lans.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
lan={
|
||||
"description": "string",
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"physport": 1,
|
||||
"routed_subnets": [
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
],
|
||||
"static_addressing": {
|
||||
"address": "192.0.2.0/24",
|
||||
"dhcp_relay": {"server_addresses": ["192.0.2.1", "192.0.2.1", "192.0.2.1"]},
|
||||
"dhcp_server": {
|
||||
"dhcp_pool_end": "192.0.2.1",
|
||||
"dhcp_pool_start": "192.0.2.1",
|
||||
"dns_server": "192.0.2.1",
|
||||
"reservations": {
|
||||
"00:11:22:33:44:55": "192.0.2.100",
|
||||
"AA:BB:CC:DD:EE:FF": "192.168.1.101",
|
||||
},
|
||||
},
|
||||
"secondary_address": "192.0.2.0/24",
|
||||
"virtual_address": "192.0.2.0/24",
|
||||
},
|
||||
"vlan_tag": 0,
|
||||
},
|
||||
)
|
||||
assert_matches_type(LanUpdateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_update(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.lans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
lan = response.parse()
|
||||
assert_matches_type(LanUpdateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_update(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.lans.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
lan = response.parse()
|
||||
assert_matches_type(LanUpdateResponse, lan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_update(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `lan_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Cloudflare) -> None:
|
||||
lan = client.magic_transit.sites.lans.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(LanListResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.lans.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
lan = response.parse()
|
||||
assert_matches_type(LanListResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.lans.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
lan = response.parse()
|
||||
assert_matches_type(LanListResponse, lan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_list(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.list(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_delete(self, client: Cloudflare) -> None:
|
||||
lan = client.magic_transit.sites.lans.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(LanDeleteResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.lans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
lan = response.parse()
|
||||
assert_matches_type(LanDeleteResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.lans.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
lan = response.parse()
|
||||
assert_matches_type(LanDeleteResponse, lan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_delete(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `lan_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_get(self, client: Cloudflare) -> None:
|
||||
lan = client.magic_transit.sites.lans.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(LanGetResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.lans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
lan = response.parse()
|
||||
assert_matches_type(LanGetResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.lans.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
lan = response.parse()
|
||||
assert_matches_type(LanGetResponse, lan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_get(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `lan_identifier` but received ''"):
|
||||
client.magic_transit.sites.lans.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
|
||||
class TestAsyncLans:
|
||||
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
|
||||
lan = await async_client.magic_transit.sites.lans.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(LanCreateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
lan = await async_client.magic_transit.sites.lans.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
lan={
|
||||
"description": "string",
|
||||
"ha_link": True,
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"physport": 1,
|
||||
"routed_subnets": [
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
],
|
||||
"static_addressing": {
|
||||
"address": "192.0.2.0/24",
|
||||
"dhcp_relay": {"server_addresses": ["192.0.2.1", "192.0.2.1", "192.0.2.1"]},
|
||||
"dhcp_server": {
|
||||
"dhcp_pool_end": "192.0.2.1",
|
||||
"dhcp_pool_start": "192.0.2.1",
|
||||
"dns_server": "192.0.2.1",
|
||||
"reservations": {
|
||||
"00:11:22:33:44:55": "192.0.2.100",
|
||||
"AA:BB:CC:DD:EE:FF": "192.168.1.101",
|
||||
},
|
||||
},
|
||||
"secondary_address": "192.0.2.0/24",
|
||||
"virtual_address": "192.0.2.0/24",
|
||||
},
|
||||
"vlan_tag": 0,
|
||||
},
|
||||
)
|
||||
assert_matches_type(LanCreateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.lans.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
lan = await response.parse()
|
||||
assert_matches_type(LanCreateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.lans.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
lan = await response.parse()
|
||||
assert_matches_type(LanCreateResponse, lan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.create(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
|
||||
lan = await async_client.magic_transit.sites.lans.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(LanUpdateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
lan = await async_client.magic_transit.sites.lans.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
lan={
|
||||
"description": "string",
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"physport": 1,
|
||||
"routed_subnets": [
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
{
|
||||
"nat": {"static_prefix": "192.0.2.0/24"},
|
||||
"next_hop": "192.0.2.1",
|
||||
"prefix": "192.0.2.0/24",
|
||||
},
|
||||
],
|
||||
"static_addressing": {
|
||||
"address": "192.0.2.0/24",
|
||||
"dhcp_relay": {"server_addresses": ["192.0.2.1", "192.0.2.1", "192.0.2.1"]},
|
||||
"dhcp_server": {
|
||||
"dhcp_pool_end": "192.0.2.1",
|
||||
"dhcp_pool_start": "192.0.2.1",
|
||||
"dns_server": "192.0.2.1",
|
||||
"reservations": {
|
||||
"00:11:22:33:44:55": "192.0.2.100",
|
||||
"AA:BB:CC:DD:EE:FF": "192.168.1.101",
|
||||
},
|
||||
},
|
||||
"secondary_address": "192.0.2.0/24",
|
||||
"virtual_address": "192.0.2.0/24",
|
||||
},
|
||||
"vlan_tag": 0,
|
||||
},
|
||||
)
|
||||
assert_matches_type(LanUpdateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.lans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
lan = await response.parse()
|
||||
assert_matches_type(LanUpdateResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.lans.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
lan = await response.parse()
|
||||
assert_matches_type(LanUpdateResponse, lan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `lan_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
|
||||
lan = await async_client.magic_transit.sites.lans.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(LanListResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.lans.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
lan = await response.parse()
|
||||
assert_matches_type(LanListResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.lans.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
lan = await response.parse()
|
||||
assert_matches_type(LanListResponse, lan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.list(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
lan = await async_client.magic_transit.sites.lans.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(LanDeleteResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.lans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
lan = await response.parse()
|
||||
assert_matches_type(LanDeleteResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.lans.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
lan = await response.parse()
|
||||
assert_matches_type(LanDeleteResponse, lan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `lan_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
|
||||
lan = await async_client.magic_transit.sites.lans.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(LanGetResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.lans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
lan = await response.parse()
|
||||
assert_matches_type(LanGetResponse, lan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.lans.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
lan = await response.parse()
|
||||
assert_matches_type(LanGetResponse, lan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `lan_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.lans.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
|
@ -1,702 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from cloudflare import Cloudflare, AsyncCloudflare
|
||||
from tests.utils import assert_matches_type
|
||||
from cloudflare.types.magic_transit.sites import (
|
||||
WanGetResponse,
|
||||
WanListResponse,
|
||||
WanCreateResponse,
|
||||
WanDeleteResponse,
|
||||
WanUpdateResponse,
|
||||
)
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestWans:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create(self, client: Cloudflare) -> None:
|
||||
wan = client.magic_transit.sites.wans.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(WanCreateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
|
||||
wan = client.magic_transit.sites.wans.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
wan={
|
||||
"description": "string",
|
||||
"physport": 1,
|
||||
"priority": 0,
|
||||
"static_addressing": {
|
||||
"address": "192.0.2.0/24",
|
||||
"gateway_address": "192.0.2.1",
|
||||
"secondary_address": "192.0.2.0/24",
|
||||
},
|
||||
"vlan_tag": 0,
|
||||
},
|
||||
)
|
||||
assert_matches_type(WanCreateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.wans.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
wan = response.parse()
|
||||
assert_matches_type(WanCreateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.wans.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
wan = response.parse()
|
||||
assert_matches_type(WanCreateResponse, wan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_create(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.create(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update(self, client: Cloudflare) -> None:
|
||||
wan = client.magic_transit.sites.wans.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(WanUpdateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
|
||||
wan = client.magic_transit.sites.wans.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
wan={
|
||||
"description": "string",
|
||||
"physport": 1,
|
||||
"priority": 0,
|
||||
"static_addressing": {
|
||||
"address": "192.0.2.0/24",
|
||||
"gateway_address": "192.0.2.1",
|
||||
"secondary_address": "192.0.2.0/24",
|
||||
},
|
||||
"vlan_tag": 0,
|
||||
},
|
||||
)
|
||||
assert_matches_type(WanUpdateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_update(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.wans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
wan = response.parse()
|
||||
assert_matches_type(WanUpdateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_update(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.wans.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
wan = response.parse()
|
||||
assert_matches_type(WanUpdateResponse, wan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_update(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `wan_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Cloudflare) -> None:
|
||||
wan = client.magic_transit.sites.wans.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(WanListResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.wans.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
wan = response.parse()
|
||||
assert_matches_type(WanListResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.wans.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
wan = response.parse()
|
||||
assert_matches_type(WanListResponse, wan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_list(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.list(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_delete(self, client: Cloudflare) -> None:
|
||||
wan = client.magic_transit.sites.wans.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(WanDeleteResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.wans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
wan = response.parse()
|
||||
assert_matches_type(WanDeleteResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.wans.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
wan = response.parse()
|
||||
assert_matches_type(WanDeleteResponse, wan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_delete(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `wan_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_get(self, client: Cloudflare) -> None:
|
||||
wan = client.magic_transit.sites.wans.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(WanGetResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.wans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
wan = response.parse()
|
||||
assert_matches_type(WanGetResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.wans.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
wan = response.parse()
|
||||
assert_matches_type(WanGetResponse, wan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_get(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `wan_identifier` but received ''"):
|
||||
client.magic_transit.sites.wans.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
|
||||
class TestAsyncWans:
|
||||
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
|
||||
wan = await async_client.magic_transit.sites.wans.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(WanCreateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
wan = await async_client.magic_transit.sites.wans.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
wan={
|
||||
"description": "string",
|
||||
"physport": 1,
|
||||
"priority": 0,
|
||||
"static_addressing": {
|
||||
"address": "192.0.2.0/24",
|
||||
"gateway_address": "192.0.2.1",
|
||||
"secondary_address": "192.0.2.0/24",
|
||||
},
|
||||
"vlan_tag": 0,
|
||||
},
|
||||
)
|
||||
assert_matches_type(WanCreateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.wans.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
wan = await response.parse()
|
||||
assert_matches_type(WanCreateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.wans.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
wan = await response.parse()
|
||||
assert_matches_type(WanCreateResponse, wan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.create(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
|
||||
wan = await async_client.magic_transit.sites.wans.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(WanUpdateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
wan = await async_client.magic_transit.sites.wans.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
wan={
|
||||
"description": "string",
|
||||
"physport": 1,
|
||||
"priority": 0,
|
||||
"static_addressing": {
|
||||
"address": "192.0.2.0/24",
|
||||
"gateway_address": "192.0.2.1",
|
||||
"secondary_address": "192.0.2.0/24",
|
||||
},
|
||||
"vlan_tag": 0,
|
||||
},
|
||||
)
|
||||
assert_matches_type(WanUpdateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.wans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
wan = await response.parse()
|
||||
assert_matches_type(WanUpdateResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.wans.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
wan = await response.parse()
|
||||
assert_matches_type(WanUpdateResponse, wan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `wan_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
|
||||
wan = await async_client.magic_transit.sites.wans.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(WanListResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.wans.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
wan = await response.parse()
|
||||
assert_matches_type(WanListResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.wans.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
wan = await response.parse()
|
||||
assert_matches_type(WanListResponse, wan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.list(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
wan = await async_client.magic_transit.sites.wans.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(WanDeleteResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.wans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
wan = await response.parse()
|
||||
assert_matches_type(WanDeleteResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.wans.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
wan = await response.parse()
|
||||
assert_matches_type(WanDeleteResponse, wan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `wan_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
|
||||
wan = await async_client.magic_transit.sites.wans.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(WanGetResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.wans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
wan = await response.parse()
|
||||
assert_matches_type(WanGetResponse, wan, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.wans.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
wan = await response.parse()
|
||||
assert_matches_type(WanGetResponse, wan, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `wan_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.wans.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
|
@ -1,356 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from cloudflare import Cloudflare, AsyncCloudflare
|
||||
from tests.utils import assert_matches_type
|
||||
from cloudflare.types.magic_transit import (
|
||||
CfInterconnectGetResponse,
|
||||
CfInterconnectListResponse,
|
||||
CfInterconnectUpdateResponse,
|
||||
)
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestCfInterconnects:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update(self, client: Cloudflare) -> None:
|
||||
cf_interconnect = client.magic_transit.cf_interconnects.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
|
||||
cf_interconnect = client.magic_transit.cf_interconnects.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
description="Tunnel for Interconnect to ORD",
|
||||
gre={"cloudflare_endpoint": "203.0.113.1"},
|
||||
health_check={
|
||||
"enabled": True,
|
||||
"rate": "low",
|
||||
"target": "203.0.113.1",
|
||||
"type": "request",
|
||||
},
|
||||
interface_address="192.0.2.0/31",
|
||||
mtu=0,
|
||||
)
|
||||
assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_update(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.cf_interconnects.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
cf_interconnect = response.parse()
|
||||
assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_update(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.cf_interconnects.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
cf_interconnect = response.parse()
|
||||
assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_update(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.cf_interconnects.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
client.magic_transit.cf_interconnects.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Cloudflare) -> None:
|
||||
cf_interconnect = client.magic_transit.cf_interconnects.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(CfInterconnectListResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.cf_interconnects.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
cf_interconnect = response.parse()
|
||||
assert_matches_type(CfInterconnectListResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.cf_interconnects.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
cf_interconnect = response.parse()
|
||||
assert_matches_type(CfInterconnectListResponse, cf_interconnect, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_list(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.cf_interconnects.with_raw_response.list(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_get(self, client: Cloudflare) -> None:
|
||||
cf_interconnect = client.magic_transit.cf_interconnects.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.cf_interconnects.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
cf_interconnect = response.parse()
|
||||
assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.cf_interconnects.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
cf_interconnect = response.parse()
|
||||
assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_get(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.cf_interconnects.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
client.magic_transit.cf_interconnects.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
|
||||
class TestAsyncCfInterconnects:
|
||||
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
|
||||
cf_interconnect = await async_client.magic_transit.cf_interconnects.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
cf_interconnect = await async_client.magic_transit.cf_interconnects.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
description="Tunnel for Interconnect to ORD",
|
||||
gre={"cloudflare_endpoint": "203.0.113.1"},
|
||||
health_check={
|
||||
"enabled": True,
|
||||
"rate": "low",
|
||||
"target": "203.0.113.1",
|
||||
"type": "request",
|
||||
},
|
||||
interface_address="192.0.2.0/31",
|
||||
mtu=0,
|
||||
)
|
||||
assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.cf_interconnects.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
cf_interconnect = await response.parse()
|
||||
assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.cf_interconnects.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
cf_interconnect = await response.parse()
|
||||
assert_matches_type(CfInterconnectUpdateResponse, cf_interconnect, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.cf_interconnects.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
await async_client.magic_transit.cf_interconnects.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
|
||||
cf_interconnect = await async_client.magic_transit.cf_interconnects.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(CfInterconnectListResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.cf_interconnects.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
cf_interconnect = await response.parse()
|
||||
assert_matches_type(CfInterconnectListResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.cf_interconnects.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
cf_interconnect = await response.parse()
|
||||
assert_matches_type(CfInterconnectListResponse, cf_interconnect, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.cf_interconnects.with_raw_response.list(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
|
||||
cf_interconnect = await async_client.magic_transit.cf_interconnects.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.cf_interconnects.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
cf_interconnect = await response.parse()
|
||||
assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.cf_interconnects.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
cf_interconnect = await response.parse()
|
||||
assert_matches_type(CfInterconnectGetResponse, cf_interconnect, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.cf_interconnects.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
await async_client.magic_transit.cf_interconnects.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
|
@ -1,602 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from cloudflare import Cloudflare, AsyncCloudflare
|
||||
from tests.utils import assert_matches_type
|
||||
from cloudflare.types.magic_transit import (
|
||||
GRETunnelGetResponse,
|
||||
GRETunnelListResponse,
|
||||
GRETunnelCreateResponse,
|
||||
GRETunnelDeleteResponse,
|
||||
GRETunnelUpdateResponse,
|
||||
)
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestGRETunnels:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create(self, client: Cloudflare) -> None:
|
||||
gre_tunnel = client.magic_transit.gre_tunnels.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
)
|
||||
assert_matches_type(GRETunnelCreateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.gre_tunnels.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
gre_tunnel = response.parse()
|
||||
assert_matches_type(GRETunnelCreateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.gre_tunnels.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
gre_tunnel = response.parse()
|
||||
assert_matches_type(GRETunnelCreateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_create(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.gre_tunnels.with_raw_response.create(
|
||||
"",
|
||||
body={},
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update(self, client: Cloudflare) -> None:
|
||||
gre_tunnel = client.magic_transit.gre_tunnels.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
)
|
||||
assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
|
||||
gre_tunnel = client.magic_transit.gre_tunnels.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
description="Tunnel for ISP X",
|
||||
health_check={
|
||||
"direction": "bidirectional",
|
||||
"enabled": True,
|
||||
"rate": "low",
|
||||
"target": "203.0.113.1",
|
||||
"type": "request",
|
||||
},
|
||||
mtu=0,
|
||||
ttl=0,
|
||||
)
|
||||
assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_update(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.gre_tunnels.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
gre_tunnel = response.parse()
|
||||
assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_update(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.gre_tunnels.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
gre_tunnel = response.parse()
|
||||
assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_update(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.gre_tunnels.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
client.magic_transit.gre_tunnels.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Cloudflare) -> None:
|
||||
gre_tunnel = client.magic_transit.gre_tunnels.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(GRETunnelListResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.gre_tunnels.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
gre_tunnel = response.parse()
|
||||
assert_matches_type(GRETunnelListResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.gre_tunnels.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
gre_tunnel = response.parse()
|
||||
assert_matches_type(GRETunnelListResponse, gre_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_list(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.gre_tunnels.with_raw_response.list(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_delete(self, client: Cloudflare) -> None:
|
||||
gre_tunnel = client.magic_transit.gre_tunnels.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.gre_tunnels.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
gre_tunnel = response.parse()
|
||||
assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.gre_tunnels.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
gre_tunnel = response.parse()
|
||||
assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_delete(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.gre_tunnels.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
client.magic_transit.gre_tunnels.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_get(self, client: Cloudflare) -> None:
|
||||
gre_tunnel = client.magic_transit.gre_tunnels.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.gre_tunnels.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
gre_tunnel = response.parse()
|
||||
assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.gre_tunnels.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
gre_tunnel = response.parse()
|
||||
assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_get(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.gre_tunnels.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
client.magic_transit.gre_tunnels.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
|
||||
class TestAsyncGRETunnels:
|
||||
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
|
||||
gre_tunnel = await async_client.magic_transit.gre_tunnels.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
)
|
||||
assert_matches_type(GRETunnelCreateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.gre_tunnels.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
gre_tunnel = await response.parse()
|
||||
assert_matches_type(GRETunnelCreateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.gre_tunnels.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
gre_tunnel = await response.parse()
|
||||
assert_matches_type(GRETunnelCreateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.gre_tunnels.with_raw_response.create(
|
||||
"",
|
||||
body={},
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
|
||||
gre_tunnel = await async_client.magic_transit.gre_tunnels.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
)
|
||||
assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
gre_tunnel = await async_client.magic_transit.gre_tunnels.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
description="Tunnel for ISP X",
|
||||
health_check={
|
||||
"direction": "bidirectional",
|
||||
"enabled": True,
|
||||
"rate": "low",
|
||||
"target": "203.0.113.1",
|
||||
"type": "request",
|
||||
},
|
||||
mtu=0,
|
||||
ttl=0,
|
||||
)
|
||||
assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.gre_tunnels.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
gre_tunnel = await response.parse()
|
||||
assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.gre_tunnels.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
gre_tunnel = await response.parse()
|
||||
assert_matches_type(GRETunnelUpdateResponse, gre_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.gre_tunnels.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
await async_client.magic_transit.gre_tunnels.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_gre_endpoint="203.0.113.1",
|
||||
customer_gre_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="GRE_1",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
|
||||
gre_tunnel = await async_client.magic_transit.gre_tunnels.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(GRETunnelListResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.gre_tunnels.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
gre_tunnel = await response.parse()
|
||||
assert_matches_type(GRETunnelListResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.gre_tunnels.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
gre_tunnel = await response.parse()
|
||||
assert_matches_type(GRETunnelListResponse, gre_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.gre_tunnels.with_raw_response.list(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
gre_tunnel = await async_client.magic_transit.gre_tunnels.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.gre_tunnels.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
gre_tunnel = await response.parse()
|
||||
assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.gre_tunnels.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
gre_tunnel = await response.parse()
|
||||
assert_matches_type(GRETunnelDeleteResponse, gre_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.gre_tunnels.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
await async_client.magic_transit.gre_tunnels.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
|
||||
gre_tunnel = await async_client.magic_transit.gre_tunnels.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.gre_tunnels.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
gre_tunnel = await response.parse()
|
||||
assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.gre_tunnels.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
gre_tunnel = await response.parse()
|
||||
assert_matches_type(GRETunnelGetResponse, gre_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.gre_tunnels.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
await async_client.magic_transit.gre_tunnels.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
|
@ -1,757 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from cloudflare import Cloudflare, AsyncCloudflare
|
||||
from tests.utils import assert_matches_type
|
||||
from cloudflare.types.magic_transit import (
|
||||
IPSECTunnelGetResponse,
|
||||
IPSECTunnelListResponse,
|
||||
IPSECTunnelCreateResponse,
|
||||
IPSECTunnelDeleteResponse,
|
||||
IPSECTunnelUpdateResponse,
|
||||
IPSECTunnelPSKGenerateResponse,
|
||||
)
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestIPSECTunnels:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create(self, client: Cloudflare) -> None:
|
||||
ipsec_tunnel = client.magic_transit.ipsec_tunnels.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelCreateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
|
||||
ipsec_tunnel = client.magic_transit.ipsec_tunnels.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
customer_endpoint="203.0.113.1",
|
||||
description="Tunnel for ISP X",
|
||||
health_check={
|
||||
"direction": "bidirectional",
|
||||
"enabled": True,
|
||||
"rate": "low",
|
||||
"target": "203.0.113.1",
|
||||
"type": "request",
|
||||
},
|
||||
psk="O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy",
|
||||
replay_protection=False,
|
||||
)
|
||||
assert_matches_type(IPSECTunnelCreateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.ipsec_tunnels.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelCreateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.ipsec_tunnels.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelCreateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_create(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.ipsec_tunnels.with_raw_response.create(
|
||||
"",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update(self, client: Cloudflare) -> None:
|
||||
ipsec_tunnel = client.magic_transit.ipsec_tunnels.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
|
||||
ipsec_tunnel = client.magic_transit.ipsec_tunnels.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
customer_endpoint="203.0.113.1",
|
||||
description="Tunnel for ISP X",
|
||||
health_check={
|
||||
"direction": "bidirectional",
|
||||
"enabled": True,
|
||||
"rate": "low",
|
||||
"target": "203.0.113.1",
|
||||
"type": "request",
|
||||
},
|
||||
psk="O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy",
|
||||
replay_protection=False,
|
||||
)
|
||||
assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_update(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.ipsec_tunnels.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_update(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.ipsec_tunnels.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_update(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.ipsec_tunnels.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
client.magic_transit.ipsec_tunnels.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Cloudflare) -> None:
|
||||
ipsec_tunnel = client.magic_transit.ipsec_tunnels.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelListResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.ipsec_tunnels.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelListResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.ipsec_tunnels.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelListResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_list(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.ipsec_tunnels.with_raw_response.list(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_delete(self, client: Cloudflare) -> None:
|
||||
ipsec_tunnel = client.magic_transit.ipsec_tunnels.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.ipsec_tunnels.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.ipsec_tunnels.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_delete(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.ipsec_tunnels.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
client.magic_transit.ipsec_tunnels.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_get(self, client: Cloudflare) -> None:
|
||||
ipsec_tunnel = client.magic_transit.ipsec_tunnels.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.ipsec_tunnels.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.ipsec_tunnels.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_get(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.ipsec_tunnels.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
client.magic_transit.ipsec_tunnels.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_psk_generate(self, client: Cloudflare) -> None:
|
||||
ipsec_tunnel = client.magic_transit.ipsec_tunnels.psk_generate(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_psk_generate(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_psk_generate(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.ipsec_tunnels.with_streaming_response.psk_generate(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = response.parse()
|
||||
assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_psk_generate(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
|
||||
class TestAsyncIPSECTunnels:
|
||||
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
|
||||
ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelCreateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
customer_endpoint="203.0.113.1",
|
||||
description="Tunnel for ISP X",
|
||||
health_check={
|
||||
"direction": "bidirectional",
|
||||
"enabled": True,
|
||||
"rate": "low",
|
||||
"target": "203.0.113.1",
|
||||
"type": "request",
|
||||
},
|
||||
psk="O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy",
|
||||
replay_protection=False,
|
||||
)
|
||||
assert_matches_type(IPSECTunnelCreateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelCreateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelCreateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.ipsec_tunnels.with_raw_response.create(
|
||||
"",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
|
||||
ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
customer_endpoint="203.0.113.1",
|
||||
description="Tunnel for ISP X",
|
||||
health_check={
|
||||
"direction": "bidirectional",
|
||||
"enabled": True,
|
||||
"rate": "low",
|
||||
"target": "203.0.113.1",
|
||||
"type": "request",
|
||||
},
|
||||
psk="O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy",
|
||||
replay_protection=False,
|
||||
)
|
||||
assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelUpdateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.ipsec_tunnels.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
await async_client.magic_transit.ipsec_tunnels.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
cloudflare_endpoint="203.0.113.1",
|
||||
interface_address="192.0.2.0/31",
|
||||
name="IPsec_1",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
|
||||
ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelListResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelListResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelListResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.ipsec_tunnels.with_raw_response.list(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelDeleteResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.ipsec_tunnels.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
await async_client.magic_transit.ipsec_tunnels.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
|
||||
ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelGetResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.ipsec_tunnels.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
await async_client.magic_transit.ipsec_tunnels.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_psk_generate(self, async_client: AsyncCloudflare) -> None:
|
||||
ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.psk_generate(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_psk_generate(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_psk_generate(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.psk_generate(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
ipsec_tunnel = await response.parse()
|
||||
assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_psk_generate(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"):
|
||||
await async_client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
|
@ -1,675 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from cloudflare import Cloudflare, AsyncCloudflare
|
||||
from tests.utils import assert_matches_type
|
||||
from cloudflare.types.magic_transit import (
|
||||
RouteGetResponse,
|
||||
RouteListResponse,
|
||||
RouteEmptyResponse,
|
||||
RouteCreateResponse,
|
||||
RouteDeleteResponse,
|
||||
RouteUpdateResponse,
|
||||
)
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestRoutes:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create(self, client: Cloudflare) -> None:
|
||||
route = client.magic_transit.routes.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
)
|
||||
assert_matches_type(RouteCreateResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.routes.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteCreateResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.routes.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteCreateResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_create(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.routes.with_raw_response.create(
|
||||
"",
|
||||
body={},
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update(self, client: Cloudflare) -> None:
|
||||
route = client.magic_transit.routes.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
)
|
||||
assert_matches_type(RouteUpdateResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
|
||||
route = client.magic_transit.routes.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
description="New route for new prefix 203.0.113.1",
|
||||
scope={
|
||||
"colo_names": ["den01", "den01", "den01"],
|
||||
"colo_regions": ["APAC", "APAC", "APAC"],
|
||||
},
|
||||
weight=0,
|
||||
)
|
||||
assert_matches_type(RouteUpdateResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_update(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.routes.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteUpdateResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_update(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.routes.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteUpdateResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_update(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.routes.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"):
|
||||
client.magic_transit.routes.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Cloudflare) -> None:
|
||||
route = client.magic_transit.routes.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(RouteListResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.routes.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteListResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.routes.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteListResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_list(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.routes.with_raw_response.list(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_delete(self, client: Cloudflare) -> None:
|
||||
route = client.magic_transit.routes.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(RouteDeleteResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.routes.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteDeleteResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.routes.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteDeleteResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_delete(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.routes.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"):
|
||||
client.magic_transit.routes.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_empty(self, client: Cloudflare) -> None:
|
||||
route = client.magic_transit.routes.empty(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
routes=[{}, {}, {}],
|
||||
)
|
||||
assert_matches_type(RouteEmptyResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_empty(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.routes.with_raw_response.empty(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
routes=[{}, {}, {}],
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteEmptyResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_empty(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.routes.with_streaming_response.empty(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
routes=[{}, {}, {}],
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteEmptyResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_empty(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.routes.with_raw_response.empty(
|
||||
"",
|
||||
routes=[{}, {}, {}],
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_get(self, client: Cloudflare) -> None:
|
||||
route = client.magic_transit.routes.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(RouteGetResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.routes.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteGetResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.routes.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = response.parse()
|
||||
assert_matches_type(RouteGetResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_get(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.routes.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"):
|
||||
client.magic_transit.routes.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
|
||||
class TestAsyncRoutes:
|
||||
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
|
||||
route = await async_client.magic_transit.routes.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
)
|
||||
assert_matches_type(RouteCreateResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.routes.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteCreateResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.routes.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
body={},
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteCreateResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.routes.with_raw_response.create(
|
||||
"",
|
||||
body={},
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
|
||||
route = await async_client.magic_transit.routes.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
)
|
||||
assert_matches_type(RouteUpdateResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
route = await async_client.magic_transit.routes.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
description="New route for new prefix 203.0.113.1",
|
||||
scope={
|
||||
"colo_names": ["den01", "den01", "den01"],
|
||||
"colo_regions": ["APAC", "APAC", "APAC"],
|
||||
},
|
||||
weight=0,
|
||||
)
|
||||
assert_matches_type(RouteUpdateResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.routes.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteUpdateResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.routes.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteUpdateResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.routes.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"):
|
||||
await async_client.magic_transit.routes.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
nexthop="203.0.113.1",
|
||||
prefix="192.0.2.0/24",
|
||||
priority=0,
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
|
||||
route = await async_client.magic_transit.routes.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(RouteListResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.routes.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteListResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.routes.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteListResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.routes.with_raw_response.list(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
route = await async_client.magic_transit.routes.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(RouteDeleteResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.routes.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteDeleteResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.routes.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteDeleteResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.routes.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"):
|
||||
await async_client.magic_transit.routes.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_empty(self, async_client: AsyncCloudflare) -> None:
|
||||
route = await async_client.magic_transit.routes.empty(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
routes=[{}, {}, {}],
|
||||
)
|
||||
assert_matches_type(RouteEmptyResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_empty(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.routes.with_raw_response.empty(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
routes=[{}, {}, {}],
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteEmptyResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_empty(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.routes.with_streaming_response.empty(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
routes=[{}, {}, {}],
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteEmptyResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_empty(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.routes.with_raw_response.empty(
|
||||
"",
|
||||
routes=[{}, {}, {}],
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
|
||||
route = await async_client.magic_transit.routes.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(RouteGetResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.routes.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteGetResponse, route, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.routes.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
route = await response.parse()
|
||||
assert_matches_type(RouteGetResponse, route, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.routes.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_identifier` but received ''"):
|
||||
await async_client.magic_transit.routes.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
|
@ -1,584 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
|
||||
from cloudflare import Cloudflare, AsyncCloudflare
|
||||
from tests.utils import assert_matches_type
|
||||
from cloudflare.types.magic_transit import (
|
||||
SiteGetResponse,
|
||||
SiteListResponse,
|
||||
SiteCreateResponse,
|
||||
SiteDeleteResponse,
|
||||
SiteUpdateResponse,
|
||||
)
|
||||
|
||||
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
||||
|
||||
|
||||
class TestSites:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create(self, client: Cloudflare) -> None:
|
||||
site = client.magic_transit.sites.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(SiteCreateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
|
||||
site = client.magic_transit.sites.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site={
|
||||
"connector_id": "ac60d3d0435248289d446cedd870bcf4",
|
||||
"description": "string",
|
||||
"ha_mode": True,
|
||||
"location": {
|
||||
"lat": "string",
|
||||
"lon": "string",
|
||||
},
|
||||
"name": "site_1",
|
||||
"secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482",
|
||||
},
|
||||
)
|
||||
assert_matches_type(SiteCreateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
site = response.parse()
|
||||
assert_matches_type(SiteCreateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
site = response.parse()
|
||||
assert_matches_type(SiteCreateResponse, site, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_create(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.with_raw_response.create(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update(self, client: Cloudflare) -> None:
|
||||
site = client.magic_transit.sites.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(SiteUpdateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
|
||||
site = client.magic_transit.sites.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site={
|
||||
"connector_id": "ac60d3d0435248289d446cedd870bcf4",
|
||||
"description": "string",
|
||||
"location": {
|
||||
"lat": "string",
|
||||
"lon": "string",
|
||||
},
|
||||
"name": "site_1",
|
||||
"secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482",
|
||||
},
|
||||
)
|
||||
assert_matches_type(SiteUpdateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_update(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
site = response.parse()
|
||||
assert_matches_type(SiteUpdateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_update(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
site = response.parse()
|
||||
assert_matches_type(SiteUpdateResponse, site, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_update(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_list(self, client: Cloudflare) -> None:
|
||||
site = client.magic_transit.sites.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(SiteListResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
site = response.parse()
|
||||
assert_matches_type(SiteListResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
site = response.parse()
|
||||
assert_matches_type(SiteListResponse, site, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_list(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.with_raw_response.list(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_delete(self, client: Cloudflare) -> None:
|
||||
site = client.magic_transit.sites.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(SiteDeleteResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
site = response.parse()
|
||||
assert_matches_type(SiteDeleteResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
site = response.parse()
|
||||
assert_matches_type(SiteDeleteResponse, site, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_delete(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_method_get(self, client: Cloudflare) -> None:
|
||||
site = client.magic_transit.sites.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(SiteGetResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Cloudflare) -> None:
|
||||
response = client.magic_transit.sites.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
site = response.parse()
|
||||
assert_matches_type(SiteGetResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Cloudflare) -> None:
|
||||
with client.magic_transit.sites.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
site = response.parse()
|
||||
assert_matches_type(SiteGetResponse, site, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
def test_path_params_get(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
client.magic_transit.sites.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
client.magic_transit.sites.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
|
||||
class TestAsyncSites:
|
||||
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
|
||||
site = await async_client.magic_transit.sites.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(SiteCreateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
site = await async_client.magic_transit.sites.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site={
|
||||
"connector_id": "ac60d3d0435248289d446cedd870bcf4",
|
||||
"description": "string",
|
||||
"ha_mode": True,
|
||||
"location": {
|
||||
"lat": "string",
|
||||
"lon": "string",
|
||||
},
|
||||
"name": "site_1",
|
||||
"secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482",
|
||||
},
|
||||
)
|
||||
assert_matches_type(SiteCreateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
site = await response.parse()
|
||||
assert_matches_type(SiteCreateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
site = await response.parse()
|
||||
assert_matches_type(SiteCreateResponse, site, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.with_raw_response.create(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
|
||||
site = await async_client.magic_transit.sites.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(SiteUpdateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
site = await async_client.magic_transit.sites.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
site={
|
||||
"connector_id": "ac60d3d0435248289d446cedd870bcf4",
|
||||
"description": "string",
|
||||
"location": {
|
||||
"lat": "string",
|
||||
"lon": "string",
|
||||
},
|
||||
"name": "site_1",
|
||||
"secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482",
|
||||
},
|
||||
)
|
||||
assert_matches_type(SiteUpdateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
site = await response.parse()
|
||||
assert_matches_type(SiteUpdateResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.with_streaming_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
site = await response.parse()
|
||||
assert_matches_type(SiteUpdateResponse, site, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.with_raw_response.update(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.with_raw_response.update(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
|
||||
site = await async_client.magic_transit.sites.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(SiteListResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.with_raw_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
site = await response.parse()
|
||||
assert_matches_type(SiteListResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.with_streaming_response.list(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
site = await response.parse()
|
||||
assert_matches_type(SiteListResponse, site, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.with_raw_response.list(
|
||||
"",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
site = await async_client.magic_transit.sites.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(SiteDeleteResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
site = await response.parse()
|
||||
assert_matches_type(SiteDeleteResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.with_streaming_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
site = await response.parse()
|
||||
assert_matches_type(SiteDeleteResponse, site, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.with_raw_response.delete(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.with_raw_response.delete(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
|
||||
site = await async_client.magic_transit.sites.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(SiteGetResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.magic_transit.sites.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
site = await response.parse()
|
||||
assert_matches_type(SiteGetResponse, site, path=["response"])
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.magic_transit.sites.with_streaming_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
site = await response.parse()
|
||||
assert_matches_type(SiteGetResponse, site, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip()
|
||||
@parametrize
|
||||
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.with_raw_response.get(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
account_identifier="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `site_identifier` but received ''"):
|
||||
await async_client.magic_transit.sites.with_raw_response.get(
|
||||
"",
|
||||
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
Loading…
Add table
Reference in a new issue