Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 15, 2024
1 parent 7c82074 commit 1a7e407
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 19 deletions.
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
1 change: 0 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4773,7 +4773,6 @@ Methods:
Types:

- <code><a href="./src/resources/zero-trust/gateway/locations.ts">Location</a></code>
- <code><a href="./src/resources/zero-trust/gateway/locations.ts">LocationNetwork</a></code>
- <code><a href="./src/resources/zero-trust/gateway/locations.ts">LocationDeleteResponse</a></code>

Methods:
Expand Down
1 change: 0 additions & 1 deletion src/resources/zero-trust/gateway/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export namespace Gateway {
export import ListGetParams = ListsAPI.ListGetParams;
export import Locations = LocationsAPI.Locations;
export import Location = LocationsAPI.Location;
export import LocationNetwork = LocationsAPI.LocationNetwork;
export import LocationDeleteResponse = LocationsAPI.LocationDeleteResponse;
export import LocationsSinglePage = LocationsAPI.LocationsSinglePage;
export import LocationCreateParams = LocationsAPI.LocationCreateParams;
Expand Down
1 change: 0 additions & 1 deletion src/resources/zero-trust/gateway/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export {
} from './audit-ssh-settings';
export {
Location,
LocationNetwork,
LocationDeleteResponse,
LocationCreateParams,
LocationUpdateParams,
Expand Down
188 changes: 173 additions & 15 deletions src/resources/zero-trust/gateway/locations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ export interface Location {

created_at?: string;

/**
* The identifier of the pair of IPv4 addresses assigned to this location.
*/
dns_destination_ips_id?: string;

/**
* The DNS over HTTPS domain to send DNS requests to. This field is auto-generated
* by Gateway.
Expand All @@ -105,38 +110,154 @@ export interface Location {
*/
ecs_support?: boolean;

/**
* 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.
*/
endpoints?: Location.Endpoints;

/**
* 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.
*/
ip?: string;

/**
* The primary destination IPv4 address from the pair identified by the
* dns_destination_ips_id. This field is read-only.
*/
ipv4_destination?: string;

/**
* The backup destination IPv4 address from the pair identified by the
* dns_destination_ips_id. This field is read-only.
*/
ipv4_destination_backup?: string;

/**
* The name of the location.
*/
name?: string;

/**
* 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.
*/
networks?: Array<LocationNetwork>;
networks?: Array<Location.Network>;

updated_at?: string;
}

export interface LocationNetwork {
export namespace Location {
/**
* The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.
* 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.
*/
network: string;
}
export interface Endpoints {
doh?: Endpoints.Doh;

export interface LocationNetworkParam {
/**
* The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.
*/
network: string;
dot?: Endpoints.Dot;

ipv4?: Endpoints.IPV4;

ipv6?: Endpoints.IPV6;
}

export namespace Endpoints {
export interface Doh {
/**
* True if the endpoint is enabled for this location.
*/
enabled?: boolean;

/**
* 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.
*/
networks?: Array<Doh.Network>;

/**
* 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.
*/
require_token?: boolean;
}

export namespace Doh {
export interface Network {
/**
* The IP address or IP CIDR.
*/
network: string;
}
}

export interface Dot {
/**
* True if the endpoint is enabled for this location.
*/
enabled?: boolean;

/**
* 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.
*/
networks?: Array<Dot.Network>;
}

export namespace Dot {
export interface Network {
/**
* The IP address or IP CIDR.
*/
network: string;
}
}

export interface IPV4 {
/**
* True if the endpoint is enabled for this location.
*/
enabled?: boolean;
}

export interface IPV6 {
/**
* True if the endpoint is enabled for this location.
*/
enabled?: boolean;

/**
* 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.
*/
networks?: Array<IPV6.Network>;
}

export namespace IPV6 {
export interface Network {
/**
* The IPv6 address or IPv6 CIDR.
*/
network: string;
}
}
}

export interface Network {
/**
* The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.
*/
network: string;
}
}

export type LocationDeleteResponse = unknown | string | null;
Expand All @@ -157,16 +278,35 @@ export interface LocationCreateParams {
*/
client_default?: boolean;

/**
* Body param: 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.
*/
dns_destination_ips_id?: string;

/**
* Body param: True if the location needs to resolve EDNS queries.
*/
ecs_support?: boolean;

/**
* Body param: A list of network ranges that requests from this location would
* originate from.
* originate from. A non-empty list is only effective if the ipv4 endpoint is
* enabled for this location.
*/
networks?: Array<LocationNetworkParam>;
networks?: Array<LocationCreateParams.Network>;
}

export namespace LocationCreateParams {
export interface Network {
/**
* The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.
*/
network: string;
}
}

export interface LocationUpdateParams {
Expand All @@ -185,16 +325,35 @@ export interface LocationUpdateParams {
*/
client_default?: boolean;

/**
* Body param: 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.
*/
dns_destination_ips_id?: string;

/**
* Body param: True if the location needs to resolve EDNS queries.
*/
ecs_support?: boolean;

/**
* Body param: A list of network ranges that requests from this location would
* originate from.
* originate from. A non-empty list is only effective if the ipv4 endpoint is
* enabled for this location.
*/
networks?: Array<LocationNetworkParam>;
networks?: Array<LocationUpdateParams.Network>;
}

export namespace LocationUpdateParams {
export interface Network {
/**
* The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.
*/
network: string;
}
}

export interface LocationListParams {
Expand All @@ -211,7 +370,6 @@ export interface LocationGetParams {

export namespace Locations {
export import Location = LocationsAPI.Location;
export import LocationNetwork = LocationsAPI.LocationNetwork;
export import LocationDeleteResponse = LocationsAPI.LocationDeleteResponse;
export import LocationsSinglePage = LocationsAPI.LocationsSinglePage;
export import LocationCreateParams = LocationsAPI.LocationCreateParams;
Expand Down
2 changes: 2 additions & 0 deletions tests/api-resources/zero-trust/gateway/locations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('resource locations', () => {
account_id: '699d98642c564d2e855e9661899b7252',
name: 'Austin Office Location',
client_default: false,
dns_destination_ips_id: '0e4a32c6-6fb8-4858-9296-98f51631e8e6',
ecs_support: false,
networks: [{ network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }],
});
Expand All @@ -53,6 +54,7 @@ describe('resource locations', () => {
account_id: '699d98642c564d2e855e9661899b7252',
name: 'Austin Office Location',
client_default: false,
dns_destination_ips_id: '0e4a32c6-6fb8-4858-9296-98f51631e8e6',
ecs_support: false,
networks: [{ network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }],
});
Expand Down

0 comments on commit 1a7e407

Please sign in to comment.