Skip to content

Commit

Permalink
feat: update via SDK Studio (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Feb 21, 2024
1 parent a8b3440 commit fef83d3
Show file tree
Hide file tree
Showing 75 changed files with 6,135 additions and 815 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1168
configured_endpoints: 1209
233 changes: 202 additions & 31 deletions api.md

Large diffs are not rendered by default.

96 changes: 96 additions & 0 deletions src/resources/cache/cache-reserve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ export class CacheReserve extends APIResource {
)._thenUnwrap((obj) => obj.result);
}

/**
* You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
* disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
* You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
* that you cannot undo or cancel this operation.
*/
clear(zoneId: string, options?: Core.RequestOptions): Core.APIPromise<CacheReserveClearResponse> {
return (
this._client.post(`/zones/${zoneId}/cache/cache_reserve_clear`, options) as Core.APIPromise<{
result: CacheReserveClearResponse;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Increase cache lifetimes by automatically storing all cacheable files into
* Cloudflare's persistent object storage buckets. Requires Cache Reserve
Expand All @@ -40,6 +54,20 @@ export class CacheReserve extends APIResource {
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
* disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
* You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
* that you cannot undo or cancel this operation.
*/
status(zoneId: string, options?: Core.RequestOptions): Core.APIPromise<CacheReserveStatusResponse> {
return (
this._client.get(`/zones/${zoneId}/cache/cache_reserve_clear`, options) as Core.APIPromise<{
result: CacheReserveStatusResponse;
}>
)._thenUnwrap((obj) => obj.result);
}
}

/**
Expand Down Expand Up @@ -67,6 +95,39 @@ export interface CacheReserveListResponse {
value: 'on' | 'off';
}

/**
* You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
* disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
* You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
* that you cannot undo or cancel this operation.
*/
export interface CacheReserveClearResponse {
/**
* ID of the zone setting.
*/
id: 'cache_reserve_clear';

/**
* last time this setting was modified.
*/
modified_on: string | null;

/**
* The time that the latest Cache Reserve Clear operation started.
*/
start_ts: string;

/**
* The current state of the Cache Reserve Clear operation.
*/
state: 'In-progress' | 'Completed';

/**
* The time that the latest Cache Reserve Clear operation completed.
*/
end_ts?: string;
}

/**
* Increase cache lifetimes by automatically storing all cacheable files into
* Cloudflare's persistent object storage buckets. Requires Cache Reserve
Expand All @@ -92,6 +153,39 @@ export interface CacheReserveEditResponse {
value: 'on' | 'off';
}

/**
* You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
* disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
* You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
* that you cannot undo or cancel this operation.
*/
export interface CacheReserveStatusResponse {
/**
* ID of the zone setting.
*/
id: 'cache_reserve_clear';

/**
* last time this setting was modified.
*/
modified_on: string | null;

/**
* The time that the latest Cache Reserve Clear operation started.
*/
start_ts: string;

/**
* The current state of the Cache Reserve Clear operation.
*/
state: 'In-progress' | 'Completed';

/**
* The time that the latest Cache Reserve Clear operation completed.
*/
end_ts?: string;
}

export interface CacheReserveEditParams {
/**
* Value of the Cache Reserve zone setting.
Expand All @@ -101,6 +195,8 @@ export interface CacheReserveEditParams {

export namespace CacheReserve {
export import CacheReserveListResponse = CacheReserveAPI.CacheReserveListResponse;
export import CacheReserveClearResponse = CacheReserveAPI.CacheReserveClearResponse;
export import CacheReserveEditResponse = CacheReserveAPI.CacheReserveEditResponse;
export import CacheReserveStatusResponse = CacheReserveAPI.CacheReserveStatusResponse;
export import CacheReserveEditParams = CacheReserveAPI.CacheReserveEditParams;
}
2 changes: 2 additions & 0 deletions src/resources/cache/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ export namespace Cache {
export import CachePurgeParams = CacheAPI.CachePurgeParams;
export import CacheReserve = CacheReserveAPI.CacheReserve;
export import CacheReserveListResponse = CacheReserveAPI.CacheReserveListResponse;
export import CacheReserveClearResponse = CacheReserveAPI.CacheReserveClearResponse;
export import CacheReserveEditResponse = CacheReserveAPI.CacheReserveEditResponse;
export import CacheReserveStatusResponse = CacheReserveAPI.CacheReserveStatusResponse;
export import CacheReserveEditParams = CacheReserveAPI.CacheReserveEditParams;
export import TieredCacheSmartTopology = TieredCacheSmartTopologyAPI.TieredCacheSmartTopology;
export import TieredCacheSmartTopologyDeleteResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyDeleteResponse;
Expand Down
2 changes: 2 additions & 0 deletions src/resources/cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
export { CachePurgeResponse, CachePurgeParams, Cache } from './cache';
export {
CacheReserveListResponse,
CacheReserveClearResponse,
CacheReserveEditResponse,
CacheReserveStatusResponse,
CacheReserveEditParams,
CacheReserve,
} from './cache-reserve';
Expand Down
2 changes: 2 additions & 0 deletions src/resources/radar/annotations/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export class Annotations extends APIResource {

export namespace Annotations {
export import Outages = OutagesAPI.Outages;
export import OutageGetResponse = OutagesAPI.OutageGetResponse;
export import OutageLocationsResponse = OutagesAPI.OutageLocationsResponse;
export import OutageGetParams = OutagesAPI.OutageGetParams;
export import OutageLocationsParams = OutagesAPI.OutageLocationsParams;
}
8 changes: 7 additions & 1 deletion src/resources/radar/annotations/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// File generated from our OpenAPI spec by Stainless.

export { Annotations } from './annotations';
export { OutageLocationsResponse, OutageLocationsParams, Outages } from './outages';
export {
OutageGetResponse,
OutageLocationsResponse,
OutageGetParams,
OutageLocationsParams,
Outages,
} from './outages';
143 changes: 143 additions & 0 deletions src/resources/radar/annotations/outages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ import { isRequestOptions } from 'cloudflare/core';
import * as OutagesAPI from 'cloudflare/resources/radar/annotations/outages';

export class Outages extends APIResource {
/**
* Get latest Internet outages and anomalies.
*/
get(query?: OutageGetParams, options?: Core.RequestOptions): Core.APIPromise<OutageGetResponse>;
get(options?: Core.RequestOptions): Core.APIPromise<OutageGetResponse>;
get(
query: OutageGetParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<OutageGetResponse> {
if (isRequestOptions(query)) {
return this.get({}, query);
}
return (
this._client.get('/radar/annotations/outages', { query, ...options }) as Core.APIPromise<{
result: OutageGetResponse;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Get the number of outages for locations.
*/
Expand All @@ -29,6 +48,70 @@ export class Outages extends APIResource {
}
}

export interface OutageGetResponse {
annotations: Array<OutageGetResponse.Annotation>;
}

export namespace OutageGetResponse {
export interface Annotation {
id: string;

asns: Array<number>;

asnsDetails: Array<Annotation.AsnsDetail>;

dataSource: string;

eventType: string;

locations: Array<string>;

locationsDetails: Array<Annotation.LocationsDetail>;

outage: Annotation.Outage;

startDate: string;

description?: string;

endDate?: string;

linkedUrl?: string;

scope?: string;
}

export namespace Annotation {
export interface AsnsDetail {
asn: string;

name: string;

locations?: AsnsDetail.Locations;
}

export namespace AsnsDetail {
export interface Locations {
code: string;

name: string;
}
}

export interface LocationsDetail {
code: string;

name: string;
}

export interface Outage {
outageCause: string;

outageType: string;
}
}
}

export interface OutageLocationsResponse {
annotations: Array<OutageLocationsResponse.Annotation>;
}
Expand All @@ -43,6 +126,64 @@ export namespace OutageLocationsResponse {
}
}

export interface OutageGetParams {
/**
* Single ASN as integer.
*/
asn?: number;

/**
* End of the date range (inclusive).
*/
dateEnd?: string;

/**
* Shorthand date ranges for the last X days - use when you don't need specific
* start and end dates.
*/
dateRange?:
| '1d'
| '2d'
| '7d'
| '14d'
| '28d'
| '12w'
| '24w'
| '52w'
| '1dControl'
| '2dControl'
| '7dControl'
| '14dControl'
| '28dControl'
| '12wControl'
| '24wControl';

/**
* Start of the date range (inclusive).
*/
dateStart?: string;

/**
* Format results are returned in.
*/
format?: 'JSON' | 'CSV';

/**
* Limit the number of objects in the response.
*/
limit?: number;

/**
* Location Alpha2 code.
*/
location?: string;

/**
* Number of objects to skip before grabbing results.
*/
offset?: number;
}

export interface OutageLocationsParams {
/**
* End of the date range (inclusive).
Expand Down Expand Up @@ -87,6 +228,8 @@ export interface OutageLocationsParams {
}

export namespace Outages {
export import OutageGetResponse = OutagesAPI.OutageGetResponse;
export import OutageLocationsResponse = OutagesAPI.OutageLocationsResponse;
export import OutageGetParams = OutagesAPI.OutageGetParams;
export import OutageLocationsParams = OutagesAPI.OutageLocationsParams;
}
32 changes: 16 additions & 16 deletions src/resources/radar/attacks/layer7/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@

export { Layer7TimeseriesResponse, Layer7TimeseriesParams, Layer7 } from './layer7';
export {
SummaryBitrateResponse,
SummaryDurationResponse,
SummaryGetResponse,
SummaryHTTPMethodResponse,
SummaryHTTPVersionResponse,
SummaryIPVersionResponse,
SummaryProtocolResponse,
SummaryVectorResponse,
SummaryBitrateParams,
SummaryDurationParams,
SummaryManagedRulesResponse,
SummaryMitigationProductResponse,
SummaryGetParams,
SummaryHTTPMethodParams,
SummaryHTTPVersionParams,
SummaryIPVersionParams,
SummaryProtocolParams,
SummaryVectorParams,
SummaryManagedRulesParams,
SummaryMitigationProductParams,
Summary,
} from './summary';
export {
TimeseriesGroupBitrateResponse,
TimeseriesGroupDurationResponse,
TimeseriesGroupGetResponse,
TimeseriesGroupHTTPMethodResponse,
TimeseriesGroupHTTPVersionResponse,
TimeseriesGroupIndustryResponse,
TimeseriesGroupIPVersionResponse,
TimeseriesGroupProtocolResponse,
TimeseriesGroupVectorResponse,
TimeseriesGroupManagedRulesResponse,
TimeseriesGroupMitigationProductResponse,
TimeseriesGroupVerticalResponse,
TimeseriesGroupBitrateParams,
TimeseriesGroupDurationParams,
TimeseriesGroupGetParams,
TimeseriesGroupHTTPMethodParams,
TimeseriesGroupHTTPVersionParams,
TimeseriesGroupIndustryParams,
TimeseriesGroupIPVersionParams,
TimeseriesGroupProtocolParams,
TimeseriesGroupVectorParams,
TimeseriesGroupManagedRulesParams,
TimeseriesGroupMitigationProductParams,
TimeseriesGroupVerticalParams,
TimeseriesGroups,
} from './timeseries-groups';
Expand Down
Loading

0 comments on commit fef83d3

Please sign in to comment.