Skip to content

Commit

Permalink
feat: OpenAPI spec update via Stainless API (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Feb 20, 2024
1 parent 1f3b59b commit 7609e84
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1111
configured_endpoints: 1110
8 changes: 0 additions & 8 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -802,14 +802,6 @@ Methods:

# Cache

Types:

- <code><a href="./src/resources/cache/cache.ts">CachePurgeResponse</a></code>

Methods:

- <code title="post /zones/{identifier}/purge_cache">client.cache.<a href="./src/resources/cache/cache.ts">purge</a>(identifier, { ...params }) -> CachePurgeResponse | null</code>

## CacheReserves

Types:
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,6 @@ export namespace Cloudflare {
export import DNSAnalytics = API.DNSAnalytics;

export import Cache = API.Cache;
export import CachePurgeResponse = API.CachePurgeResponse;
export import CachePurgeParams = API.CachePurgeParams;

export import SSL = API.SSL;

Expand Down
84 changes: 0 additions & 84 deletions src/resources/cache/cache.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// File generated from our OpenAPI spec by Stainless.

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as CacheAPI from 'cloudflare/resources/cache/cache';
import * as CacheReservesAPI from 'cloudflare/resources/cache/cache-reserves';
import * as RegionalTieredCacheAPI from 'cloudflare/resources/cache/regional-tiered-cache';
import * as TieredCacheSmartTopologyAPI from 'cloudflare/resources/cache/tiered-cache-smart-topology';
Expand All @@ -15,91 +13,9 @@ export class Cache extends APIResource {
variants: VariantsAPI.Variants = new VariantsAPI.Variants(this._client);
regionalTieredCache: RegionalTieredCacheAPI.RegionalTieredCache =
new RegionalTieredCacheAPI.RegionalTieredCache(this._client);

/**
* ### Purge All Cached Content
*
* Removes ALL files from Cloudflare's cache. All tiers can purge everything.
*
* ### Purge Cached Content by URL
*
* Granularly removes one or more files from Cloudflare's cache by specifying URLs.
* All tiers can purge by URL.
*
* To purge files with custom cache keys, include the headers used to compute the
* cache key as in the example. If you have a device type or geo in your cache key,
* you will need to include the CF-Device-Type or CF-IPCountry headers. If you have
* lang in your cache key, you will need to include the Accept-Language header.
*
* **NB:** When including the Origin header, be sure to include the **scheme** and
* **hostname**. The port number can be omitted if it is the default port (80 for
* http, 443 for https), but must be included otherwise.
*
* ### Purge Cached Content by Tag, Host or Prefix
*
* Granularly removes one or more files from Cloudflare's cache either by
* specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise
* customers are permitted to purge by Tag, Host or Prefix.
*
* **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000
* purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or
* prefixes in one API call. This rate limit can be raised for customers who need
* to purge at higher volume.
*/
purge(
identifier: string,
body: CachePurgeParams,
options?: Core.RequestOptions,
): Core.APIPromise<CachePurgeResponse | null> {
return (
this._client.post(`/zones/${identifier}/purge_cache`, { body, ...options }) as Core.APIPromise<{
result: CachePurgeResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export interface CachePurgeResponse {
/**
* Identifier
*/
id: string;
}

export type CachePurgeParams =
| CachePurgeParams.Qepy7bYeFlex
| CachePurgeParams.Qepy7bYeEverything
| CachePurgeParams.Qepy7bYeFiles;

export namespace CachePurgeParams {
export interface Qepy7bYeFlex {
hosts?: Array<string>;

prefixes?: Array<string>;

tags?: Array<string>;
}

export interface Qepy7bYeEverything {
purge_everything?: boolean;
}

export interface Qepy7bYeFiles {
files?: Array<string | CachePurgeParams.Qepy7bYeFiles.Qepy7bYeURLAndHeaders>;
}

export namespace Qepy7bYeFiles {
export interface Qepy7bYeURLAndHeaders {
headers?: unknown;

url?: string;
}
}
}

export namespace Cache {
export import CachePurgeResponse = CacheAPI.CachePurgeResponse;
export import CachePurgeParams = CacheAPI.CachePurgeParams;
export import CacheReserves = CacheReservesAPI.CacheReserves;
export import CacheReserveUpdateResponse = CacheReservesAPI.CacheReserveUpdateResponse;
export import CacheReserveListResponse = CacheReservesAPI.CacheReserveListResponse;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/cache/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.

export { CachePurgeResponse, CachePurgeParams, Cache } from './cache';
export { Cache } from './cache';
export {
CacheReserveUpdateResponse,
CacheReserveListResponse,
Expand Down
2 changes: 1 addition & 1 deletion src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export {
BotManagement,
} from './bot-management';
export { BrandProtection } from './brand-protection/brand-protection';
export { CachePurgeResponse, CachePurgeParams, Cache } from './cache/cache';
export { Cache } from './cache/cache';
export { CacheReserveCreateResponse, CacheReserveGetResponse, CacheReserve } from './cache-reserve';
export {
CallCreateResponse,
Expand Down
62 changes: 31 additions & 31 deletions src/resources/pcaps/pcaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ export class Pcaps extends APIResource {
}

export type PcapCreateResponse =
| PcapCreateResponse.PgpenC68PcapsResponseSimple
| PcapCreateResponse.PgpenC68PcapsResponseFull;
| PcapCreateResponse.EErxb5cBPcapsResponseSimple
| PcapCreateResponse.EErxb5cBPcapsResponseFull;

export namespace PcapCreateResponse {
export interface PgpenC68PcapsResponseSimple {
export interface EErxb5cBPcapsResponseSimple {
/**
* The ID for the packet capture.
*/
Expand All @@ -66,7 +66,7 @@ export namespace PcapCreateResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: PgpenC68PcapsResponseSimple.FilterV1;
filter_v1?: EErxb5cBPcapsResponseSimple.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -103,7 +103,7 @@ export namespace PcapCreateResponse {
type?: 'simple' | 'full';
}

export namespace PgpenC68PcapsResponseSimple {
export namespace EErxb5cBPcapsResponseSimple {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -135,7 +135,7 @@ export namespace PcapCreateResponse {
}
}

export interface PgpenC68PcapsResponseFull {
export interface EErxb5cBPcapsResponseFull {
/**
* The ID for the packet capture.
*/
Expand Down Expand Up @@ -168,7 +168,7 @@ export namespace PcapCreateResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: PgpenC68PcapsResponseFull.FilterV1;
filter_v1?: EErxb5cBPcapsResponseFull.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -205,7 +205,7 @@ export namespace PcapCreateResponse {
type?: 'simple' | 'full';
}

export namespace PgpenC68PcapsResponseFull {
export namespace EErxb5cBPcapsResponseFull {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -239,11 +239,11 @@ export namespace PcapCreateResponse {
}

export type PcapListResponse = Array<
PcapListResponse.PgpenC68PcapsResponseSimple | PcapListResponse.PgpenC68PcapsResponseFull
PcapListResponse.EErxb5cBPcapsResponseSimple | PcapListResponse.EErxb5cBPcapsResponseFull
>;

export namespace PcapListResponse {
export interface PgpenC68PcapsResponseSimple {
export interface EErxb5cBPcapsResponseSimple {
/**
* The ID for the packet capture.
*/
Expand All @@ -252,7 +252,7 @@ export namespace PcapListResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: PgpenC68PcapsResponseSimple.FilterV1;
filter_v1?: EErxb5cBPcapsResponseSimple.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -289,7 +289,7 @@ export namespace PcapListResponse {
type?: 'simple' | 'full';
}

export namespace PgpenC68PcapsResponseSimple {
export namespace EErxb5cBPcapsResponseSimple {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -321,7 +321,7 @@ export namespace PcapListResponse {
}
}

export interface PgpenC68PcapsResponseFull {
export interface EErxb5cBPcapsResponseFull {
/**
* The ID for the packet capture.
*/
Expand Down Expand Up @@ -354,7 +354,7 @@ export namespace PcapListResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: PgpenC68PcapsResponseFull.FilterV1;
filter_v1?: EErxb5cBPcapsResponseFull.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -391,7 +391,7 @@ export namespace PcapListResponse {
type?: 'simple' | 'full';
}

export namespace PgpenC68PcapsResponseFull {
export namespace EErxb5cBPcapsResponseFull {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -425,11 +425,11 @@ export namespace PcapListResponse {
}

export type PcapGetResponse =
| PcapGetResponse.PgpenC68PcapsResponseSimple
| PcapGetResponse.PgpenC68PcapsResponseFull;
| PcapGetResponse.EErxb5cBPcapsResponseSimple
| PcapGetResponse.EErxb5cBPcapsResponseFull;

export namespace PcapGetResponse {
export interface PgpenC68PcapsResponseSimple {
export interface EErxb5cBPcapsResponseSimple {
/**
* The ID for the packet capture.
*/
Expand All @@ -438,7 +438,7 @@ export namespace PcapGetResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: PgpenC68PcapsResponseSimple.FilterV1;
filter_v1?: EErxb5cBPcapsResponseSimple.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -475,7 +475,7 @@ export namespace PcapGetResponse {
type?: 'simple' | 'full';
}

export namespace PgpenC68PcapsResponseSimple {
export namespace EErxb5cBPcapsResponseSimple {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -507,7 +507,7 @@ export namespace PcapGetResponse {
}
}

export interface PgpenC68PcapsResponseFull {
export interface EErxb5cBPcapsResponseFull {
/**
* The ID for the packet capture.
*/
Expand Down Expand Up @@ -540,7 +540,7 @@ export namespace PcapGetResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: PgpenC68PcapsResponseFull.FilterV1;
filter_v1?: EErxb5cBPcapsResponseFull.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -577,7 +577,7 @@ export namespace PcapGetResponse {
type?: 'simple' | 'full';
}

export namespace PgpenC68PcapsResponseFull {
export namespace EErxb5cBPcapsResponseFull {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -611,11 +611,11 @@ export namespace PcapGetResponse {
}

export type PcapCreateParams =
| PcapCreateParams.PgpenC68PcapsRequestSimple
| PcapCreateParams.PgpenC68PcapsRequestFull;
| PcapCreateParams.EErxb5cBPcapsRequestSimple
| PcapCreateParams.EErxb5cBPcapsRequestFull;

export namespace PcapCreateParams {
export interface PgpenC68PcapsRequestSimple {
export interface EErxb5cBPcapsRequestSimple {
/**
* The limit of packets contained in a packet capture.
*/
Expand All @@ -640,10 +640,10 @@ export namespace PcapCreateParams {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: PcapCreateParams.PgpenC68PcapsRequestSimple.FilterV1;
filter_v1?: PcapCreateParams.EErxb5cBPcapsRequestSimple.FilterV1;
}

export namespace PgpenC68PcapsRequestSimple {
export namespace EErxb5cBPcapsRequestSimple {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -675,7 +675,7 @@ export namespace PcapCreateParams {
}
}

export interface PgpenC68PcapsRequestFull {
export interface EErxb5cBPcapsRequestFull {
/**
* The name of the data center used for the packet capture. This can be a specific
* colo (ord02) or a multi-colo name (ORD). This field only applies to `full`
Expand Down Expand Up @@ -713,15 +713,15 @@ export namespace PcapCreateParams {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: PcapCreateParams.PgpenC68PcapsRequestFull.FilterV1;
filter_v1?: PcapCreateParams.EErxb5cBPcapsRequestFull.FilterV1;

/**
* The limit of packets contained in a packet capture.
*/
packet_limit?: number;
}

export namespace PgpenC68PcapsRequestFull {
export namespace EErxb5cBPcapsRequestFull {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down
Loading

0 comments on commit 7609e84

Please sign in to comment.