Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 7, 2024
1 parent 72c9a7a commit a114625
Show file tree
Hide file tree
Showing 18 changed files with 182 additions and 726 deletions.
6 changes: 6 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Types:
- <code><a href="./src/resources/shared.ts">ResponseInfo</a></code>
- <code><a href="./src/resources/shared.ts">Result</a></code>
- <code><a href="./src/resources/shared.ts">Role</a></code>
- <code><a href="./src/resources/shared.ts">SortDirection</a></code>

# Accounts

Expand Down Expand Up @@ -240,6 +241,7 @@ Methods:

Types:

- <code><a href="./src/resources/zones/zones.ts">Type</a></code>
- <code><a href="./src/resources/zones/zones.ts">Zone</a></code>
- <code><a href="./src/resources/zones/zones.ts">ZoneDeleteResponse</a></code>

Expand Down Expand Up @@ -994,6 +996,7 @@ Methods:

Types:

- <code><a href="./src/resources/load-balancers/regions.ts">RegionID</a></code>
- <code><a href="./src/resources/load-balancers/regions.ts">RegionListResponse</a></code>
- <code><a href="./src/resources/load-balancers/regions.ts">RegionGetResponse</a></code>

Expand Down Expand Up @@ -1028,6 +1031,7 @@ Types:

- <code><a href="./src/resources/cache/cache-reserve.ts">CacheReserve</a></code>
- <code><a href="./src/resources/cache/cache-reserve.ts">CacheReserveClear</a></code>
- <code><a href="./src/resources/cache/cache-reserve.ts">State</a></code>
- <code><a href="./src/resources/cache/cache-reserve.ts">CacheReserveClearResponse</a></code>
- <code><a href="./src/resources/cache/cache-reserve.ts">CacheReserveEditResponse</a></code>
- <code><a href="./src/resources/cache/cache-reserve.ts">CacheReserveGetResponse</a></code>
Expand Down Expand Up @@ -2603,6 +2607,8 @@ Methods:

Types:

- <code><a href="./src/resources/rulesets/rulesets.ts">Kind</a></code>
- <code><a href="./src/resources/rulesets/rulesets.ts">Phase</a></code>
- <code><a href="./src/resources/rulesets/rulesets.ts">Ruleset</a></code>
- <code><a href="./src/resources/rulesets/rulesets.ts">RulesetCreateResponse</a></code>
- <code><a href="./src/resources/rulesets/rulesets.ts">RulesetUpdateResponse</a></code>
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ export namespace Cloudflare {
export import ResponseInfo = API.ResponseInfo;
export import Result = API.Result;
export import Role = API.Role;
export import SortDirection = API.SortDirection;
}

export default Cloudflare;
10 changes: 8 additions & 2 deletions src/resources/cache/cache-reserve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ export type CacheReserve = 'cache_reserve';
*/
export type CacheReserveClear = 'cache_reserve_clear';

/**
* The current state of the Cache Reserve Clear operation.
*/
export type State = 'In-progress' | 'Completed';

/**
* 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.
Expand All @@ -118,7 +123,7 @@ export interface CacheReserveClearResponse {
/**
* The current state of the Cache Reserve Clear operation.
*/
state: 'In-progress' | 'Completed';
state: State;

/**
* The time that the latest Cache Reserve Clear operation completed.
Expand Down Expand Up @@ -201,7 +206,7 @@ export interface CacheReserveStatusResponse {
/**
* The current state of the Cache Reserve Clear operation.
*/
state: 'In-progress' | 'Completed';
state: State;

/**
* The time that the latest Cache Reserve Clear operation completed.
Expand Down Expand Up @@ -250,6 +255,7 @@ export interface CacheReserveStatusParams {
export namespace CacheReserveResource {
export import CacheReserve = CacheReserveAPI.CacheReserve;
export import CacheReserveClear = CacheReserveAPI.CacheReserveClear;
export import State = CacheReserveAPI.State;
export import CacheReserveClearResponse = CacheReserveAPI.CacheReserveClearResponse;
export import CacheReserveEditResponse = CacheReserveAPI.CacheReserveEditResponse;
export import CacheReserveGetResponse = CacheReserveAPI.CacheReserveGetResponse;
Expand Down
1 change: 1 addition & 0 deletions src/resources/cache/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export namespace Cache {
export import CacheReserveResource = CacheReserveAPI.CacheReserveResource;
export import CacheReserve = CacheReserveAPI.CacheReserve;
export import CacheReserveClear = CacheReserveAPI.CacheReserveClear;
export import State = CacheReserveAPI.State;
export import CacheReserveClearResponse = CacheReserveAPI.CacheReserveClearResponse;
export import CacheReserveEditResponse = CacheReserveAPI.CacheReserveEditResponse;
export import CacheReserveGetResponse = CacheReserveAPI.CacheReserveGetResponse;
Expand Down
1 change: 1 addition & 0 deletions src/resources/cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export { Cache } from './cache';
export {
CacheReserve,
CacheReserveClear,
State,
CacheReserveClearResponse,
CacheReserveEditResponse,
CacheReserveGetResponse,
Expand Down
3 changes: 2 additions & 1 deletion src/resources/dns/records.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as RecordsAPI from 'cloudflare/resources/dns/records';
import * as Shared from 'cloudflare/resources/shared';
import { multipartFormRequestOptions } from 'cloudflare/core';
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination';

Expand Down Expand Up @@ -4850,7 +4851,7 @@ export interface RecordListParams extends V4PagePaginationArrayParams {
/**
* Query param: Direction to order DNS records in.
*/
direction?: 'asc' | 'desc';
direction?: Shared.SortDirectionParam;

/**
* Query param: Whether to match all search requirements or at least one (any). If
Expand Down
9 changes: 8 additions & 1 deletion src/resources/load-balancers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,12 @@ export {
Pools,
} from './pools/index';
export { PreviewGetResponse, PreviewGetParams, Previews } from './previews';
export { RegionListResponse, RegionGetResponse, RegionListParams, RegionGetParams, Regions } from './regions';
export {
RegionID,
RegionListResponse,
RegionGetResponse,
RegionListParams,
RegionGetParams,
Regions,
} from './regions';
export { SearchGetResponse, SearchGetParams, Searches } from './searches';
1 change: 1 addition & 0 deletions src/resources/load-balancers/load-balancers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,7 @@ export namespace LoadBalancers {
export import PreviewGetResponse = PreviewsAPI.PreviewGetResponse;
export import PreviewGetParams = PreviewsAPI.PreviewGetParams;
export import Regions = RegionsAPI.Regions;
export import RegionID = RegionsAPI.RegionID;
export import RegionListResponse = RegionsAPI.RegionListResponse;
export import RegionGetResponse = RegionsAPI.RegionGetResponse;
export import RegionListParams = RegionsAPI.RegionListParams;
Expand Down
7 changes: 4 additions & 3 deletions src/resources/load-balancers/pools/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as PoolsAPI from 'cloudflare/resources/load-balancers/pools/pools';
import * as LoadBalancersAPI from 'cloudflare/resources/load-balancers/load-balancers';
import * as RegionsAPI from 'cloudflare/resources/load-balancers/regions';
import * as HealthAPI from 'cloudflare/resources/load-balancers/pools/health';
import * as ReferencesAPI from 'cloudflare/resources/load-balancers/pools/references';
import { SinglePage } from 'cloudflare/pagination';
Expand Down Expand Up @@ -101,7 +102,7 @@ export interface Pool {
* A list of regions from which to run health checks. Null means every Cloudflare
* data center.
*/
check_regions?: Array<LoadBalancersAPI.CheckRegion> | null;
check_regions?: RegionsAPI.RegionID | null;

created_on?: string;

Expand Down Expand Up @@ -299,7 +300,7 @@ export interface PoolUpdateParams {
* Body param: A list of regions from which to run health checks. Null means every
* Cloudflare data center.
*/
check_regions?: Array<LoadBalancersAPI.CheckRegionParam> | null;
check_regions?: RegionsAPI.RegionIDParam | null;

/**
* Body param: A human-readable description of the pool.
Expand Down Expand Up @@ -395,7 +396,7 @@ export interface PoolEditParams {
* Body param: A list of regions from which to run health checks. Null means every
* Cloudflare data center.
*/
check_regions?: Array<LoadBalancersAPI.CheckRegionParam> | null;
check_regions?: RegionsAPI.RegionIDParam | null;

/**
* Body param: A human-readable description of the pool.
Expand Down
14 changes: 14 additions & 0 deletions src/resources/load-balancers/regions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as RegionsAPI from 'cloudflare/resources/load-balancers/regions';
import * as LoadBalancersAPI from 'cloudflare/resources/load-balancers/load-balancers';

export class Regions extends APIResource {
/**
Expand Down Expand Up @@ -49,6 +50,18 @@ export class Regions extends APIResource {
}
}

/**
* A list of regions from which to run health checks. Null means every Cloudflare
* data center.
*/
export type RegionID = Array<LoadBalancersAPI.CheckRegion>;

/**
* A list of regions from which to run health checks. Null means every Cloudflare
* data center.
*/
export type RegionIDParam = Array<LoadBalancersAPI.CheckRegionParam>;

export type RegionListResponse = unknown | string | null;

/**
Expand Down Expand Up @@ -86,6 +99,7 @@ export interface RegionGetParams {
}

export namespace Regions {
export import RegionID = RegionsAPI.RegionID;
export import RegionListResponse = RegionsAPI.RegionListResponse;
export import RegionGetResponse = RegionsAPI.RegionGetResponse;
export import RegionListParams = RegionsAPI.RegionListParams;
Expand Down
Loading

0 comments on commit a114625

Please sign in to comment.