Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #1184

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1256
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba6989e092ceb9b2700a5005e1b79d3de9fb5a8abf6d73406bece08a7662171c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-376cc25a50d22c4ac996448cf4e073f8b1065424b312a46422d1eb663491e28a.yml
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5496,7 +5496,7 @@ Methods:
Types:

```python
from cloudflare.types.zero_trust.gateway import Location, LocationNetwork, LocationDeleteResponse
from cloudflare.types.zero_trust.gateway import Location, LocationDeleteResponse
```

Methods:
Expand Down
49 changes: 44 additions & 5 deletions src/cloudflare/resources/zero_trust/gateway/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from ...._base_client import AsyncPaginator, make_request_options
from ....types.zero_trust.gateway import location_create_params, location_update_params
from ....types.zero_trust.gateway.location import Location
from ....types.zero_trust.gateway.location_network_param import LocationNetworkParam
from ....types.zero_trust.gateway.location_delete_response import LocationDeleteResponse

__all__ = ["LocationsResource", "AsyncLocationsResource"]
Expand All @@ -45,8 +44,9 @@ def create(
account_id: str,
name: str,
client_default: bool | NotGiven = NOT_GIVEN,
dns_destination_ips_id: str | NotGiven = NOT_GIVEN,
ecs_support: bool | NotGiven = NOT_GIVEN,
networks: Iterable[LocationNetworkParam] | NotGiven = NOT_GIVEN,
networks: Iterable[location_create_params.Network] | 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,
Expand All @@ -62,9 +62,17 @@ def create(

client_default: True if the location is the default location.

dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When
creating a location, if this field is absent or set with null, the pair of
shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned.
When updating a location, if the field is absent or set with null, the
pre-assigned pair remains unchanged.

ecs_support: True if the location needs to resolve EDNS queries.

networks: A list of network ranges that requests from this location would originate from.
A non-empty list is only effective if the ipv4 endpoint is enabled for this
location.

extra_headers: Send extra headers

Expand All @@ -82,6 +90,7 @@ def create(
{
"name": name,
"client_default": client_default,
"dns_destination_ips_id": dns_destination_ips_id,
"ecs_support": ecs_support,
"networks": networks,
},
Expand All @@ -104,8 +113,9 @@ def update(
account_id: str,
name: str,
client_default: bool | NotGiven = NOT_GIVEN,
dns_destination_ips_id: str | NotGiven = NOT_GIVEN,
ecs_support: bool | NotGiven = NOT_GIVEN,
networks: Iterable[LocationNetworkParam] | NotGiven = NOT_GIVEN,
networks: Iterable[location_update_params.Network] | 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,
Expand All @@ -121,9 +131,17 @@ def update(

client_default: True if the location is the default location.

dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When
creating a location, if this field is absent or set with null, the pair of
shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned.
When updating a location, if the field is absent or set with null, the
pre-assigned pair remains unchanged.

ecs_support: True if the location needs to resolve EDNS queries.

networks: A list of network ranges that requests from this location would originate from.
A non-empty list is only effective if the ipv4 endpoint is enabled for this
location.

extra_headers: Send extra headers

Expand All @@ -143,6 +161,7 @@ def update(
{
"name": name,
"client_default": client_default,
"dns_destination_ips_id": dns_destination_ips_id,
"ecs_support": ecs_support,
"networks": networks,
},
Expand Down Expand Up @@ -293,8 +312,9 @@ async def create(
account_id: str,
name: str,
client_default: bool | NotGiven = NOT_GIVEN,
dns_destination_ips_id: str | NotGiven = NOT_GIVEN,
ecs_support: bool | NotGiven = NOT_GIVEN,
networks: Iterable[LocationNetworkParam] | NotGiven = NOT_GIVEN,
networks: Iterable[location_create_params.Network] | 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,
Expand All @@ -310,9 +330,17 @@ async def create(

client_default: True if the location is the default location.

dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When
creating a location, if this field is absent or set with null, the pair of
shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned.
When updating a location, if the field is absent or set with null, the
pre-assigned pair remains unchanged.

ecs_support: True if the location needs to resolve EDNS queries.

networks: A list of network ranges that requests from this location would originate from.
A non-empty list is only effective if the ipv4 endpoint is enabled for this
location.

extra_headers: Send extra headers

Expand All @@ -330,6 +358,7 @@ async def create(
{
"name": name,
"client_default": client_default,
"dns_destination_ips_id": dns_destination_ips_id,
"ecs_support": ecs_support,
"networks": networks,
},
Expand All @@ -352,8 +381,9 @@ async def update(
account_id: str,
name: str,
client_default: bool | NotGiven = NOT_GIVEN,
dns_destination_ips_id: str | NotGiven = NOT_GIVEN,
ecs_support: bool | NotGiven = NOT_GIVEN,
networks: Iterable[LocationNetworkParam] | NotGiven = NOT_GIVEN,
networks: Iterable[location_update_params.Network] | 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,
Expand All @@ -369,9 +399,17 @@ async def update(

client_default: True if the location is the default location.

dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When
creating a location, if this field is absent or set with null, the pair of
shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned.
When updating a location, if the field is absent or set with null, the
pre-assigned pair remains unchanged.

ecs_support: True if the location needs to resolve EDNS queries.

networks: A list of network ranges that requests from this location would originate from.
A non-empty list is only effective if the ipv4 endpoint is enabled for this
location.

extra_headers: Send extra headers

Expand All @@ -391,6 +429,7 @@ async def update(
{
"name": name,
"client_default": client_default,
"dns_destination_ips_id": dns_destination_ips_id,
"ecs_support": ecs_support,
"networks": networks,
},
Expand Down
2 changes: 0 additions & 2 deletions src/cloudflare/types/zero_trust/gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from .gateway_settings import GatewaySettings as GatewaySettings
from .list_edit_params import ListEditParams as ListEditParams
from .list_list_params import ListListParams as ListListParams
from .location_network import LocationNetwork as LocationNetwork
from .gateway_item_param import GatewayItemParam as GatewayItemParam
from .list_create_params import ListCreateParams as ListCreateParams
from .list_update_params import ListUpdateParams as ListUpdateParams
Expand All @@ -40,7 +39,6 @@
from .notification_settings import NotificationSettings as NotificationSettings
from .body_scanning_settings import BodyScanningSettings as BodyScanningSettings
from .location_create_params import LocationCreateParams as LocationCreateParams
from .location_network_param import LocationNetworkParam as LocationNetworkParam
from .location_update_params import LocationUpdateParams as LocationUpdateParams
from .extended_email_matching import ExtendedEmailMatching as ExtendedEmailMatching
from .certificate_get_response import CertificateGetResponse as CertificateGetResponse
Expand Down
122 changes: 118 additions & 4 deletions src/cloudflare/types/zero_trust/gateway/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,97 @@
from datetime import datetime

from ...._models import BaseModel
from .location_network import LocationNetwork

__all__ = ["Location"]
__all__ = [
"Location",
"Endpoints",
"EndpointsDoh",
"EndpointsDohNetwork",
"EndpointsDot",
"EndpointsDotNetwork",
"EndpointsIPV4",
"EndpointsIPV6",
"EndpointsIPV6Network",
"Network",
]


class EndpointsDohNetwork(BaseModel):
network: str
"""The IP address or IP CIDR."""


class EndpointsDoh(BaseModel):
enabled: Optional[bool] = None
"""True if the endpoint is enabled for this location."""

networks: Optional[List[EndpointsDohNetwork]] = None
"""A list of allowed source IP network ranges for this endpoint.

When empty, all source IPs are allowed. A non-empty list is only effective if
the endpoint is enabled for this location.
"""

require_token: Optional[bool] = None
"""
True if the endpoint requires
[user identity](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/agentless/dns/dns-over-https/#filter-doh-requests-by-user)
authentication.
"""


class EndpointsDotNetwork(BaseModel):
network: str
"""The IP address or IP CIDR."""


class EndpointsDot(BaseModel):
enabled: Optional[bool] = None
"""True if the endpoint is enabled for this location."""

networks: Optional[List[EndpointsDotNetwork]] = None
"""A list of allowed source IP network ranges for this endpoint.

When empty, all source IPs are allowed. A non-empty list is only effective if
the endpoint is enabled for this location.
"""


class EndpointsIPV4(BaseModel):
enabled: Optional[bool] = None
"""True if the endpoint is enabled for this location."""


class EndpointsIPV6Network(BaseModel):
network: str
"""The IPv6 address or IPv6 CIDR."""


class EndpointsIPV6(BaseModel):
enabled: Optional[bool] = None
"""True if the endpoint is enabled for this location."""

networks: Optional[List[EndpointsIPV6Network]] = None
"""A list of allowed source IPv6 network ranges for this endpoint.

When empty, all source IPs are allowed. A non-empty list is only effective if
the endpoint is enabled for this location.
"""


class Endpoints(BaseModel):
doh: Optional[EndpointsDoh] = None

dot: Optional[EndpointsDot] = None

ipv4: Optional[EndpointsIPV4] = None

ipv6: Optional[EndpointsIPV6] = None


class Network(BaseModel):
network: str
"""The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24."""


class Location(BaseModel):
Expand All @@ -17,6 +105,9 @@ class Location(BaseModel):

created_at: Optional[datetime] = None

dns_destination_ips_id: Optional[str] = None
"""The identifier of the pair of IPv4 addresses assigned to this location."""

doh_subdomain: Optional[str] = None
"""The DNS over HTTPS domain to send DNS requests to.

Expand All @@ -26,17 +117,40 @@ class Location(BaseModel):
ecs_support: Optional[bool] = None
"""True if the location needs to resolve EDNS queries."""

endpoints: Optional[Endpoints] = None
"""The destination endpoints configured for this location.

When updating a location, if this field is absent or set with null, the
endpoints configuration remains unchanged.
"""

ip: Optional[str] = None
"""IPV6 destination ip assigned to this location.

DNS requests sent to this IP will counted as the request under this location.
This field is auto-generated by Gateway.
"""

ipv4_destination: Optional[str] = None
"""
The primary destination IPv4 address from the pair identified by the
dns_destination_ips_id. This field is read-only.
"""

ipv4_destination_backup: Optional[str] = None
"""
The backup destination IPv4 address from the pair identified by the
dns_destination_ips_id. This field is read-only.
"""

name: Optional[str] = None
"""The name of the location."""

networks: Optional[List[LocationNetwork]] = None
"""A list of network ranges that requests from this location would originate from."""
networks: Optional[List[Network]] = None
"""A list of network ranges that requests from this location would originate from.

A non-empty list is only effective if the ipv4 endpoint is enabled for this
location.
"""

updated_at: Optional[datetime] = None
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
from typing import Iterable
from typing_extensions import Required, TypedDict

from .location_network_param import LocationNetworkParam

__all__ = ["LocationCreateParams"]
__all__ = ["LocationCreateParams", "Network"]


class LocationCreateParams(TypedDict, total=False):
Expand All @@ -19,8 +17,26 @@ class LocationCreateParams(TypedDict, total=False):
client_default: bool
"""True if the location is the default location."""

dns_destination_ips_id: str
"""The identifier of the pair of IPv4 addresses assigned to this location.

When creating a location, if this field is absent or set with null, the pair of
shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned.
When updating a location, if the field is absent or set with null, the
pre-assigned pair remains unchanged.
"""

ecs_support: bool
"""True if the location needs to resolve EDNS queries."""

networks: Iterable[LocationNetworkParam]
"""A list of network ranges that requests from this location would originate from."""
networks: Iterable[Network]
"""A list of network ranges that requests from this location would originate from.

A non-empty list is only effective if the ipv4 endpoint is enabled for this
location.
"""


class Network(TypedDict, total=False):
network: Required[str]
"""The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24."""
12 changes: 0 additions & 12 deletions src/cloudflare/types/zero_trust/gateway/location_network.py

This file was deleted.

Loading