Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 10, 2024
1 parent aca5e19 commit c2185e1
Show file tree
Hide file tree
Showing 18 changed files with 944 additions and 10 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: 1274
configured_endpoints: 1281
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-30337a7cd5a7e8751f3555fa711c1c25aebf6791bfa5daced9765f9b234d1a05.yml
56 changes: 48 additions & 8 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5991,6 +5991,16 @@ Methods:

- <code title="get /radar/http/top/locations/tls_version/{tls_version}">client.radar.http.locations.tlsVersion.<a href="./src/resources/radar/http/locations/tls-version.ts">get</a>(tlsVersion, { ...params }) -> TLSVersionGetResponse</code>

#### BrowserFamily

Types:

- <code><a href="./src/resources/radar/http/locations/browser-family.ts">BrowserFamilyGetResponse</a></code>

Methods:

- <code title="get /radar/http/top/locations/browser_family/{browser_family}">client.radar.http.locations.browserFamily.<a href="./src/resources/radar/http/locations/browser-family.ts">get</a>(browserFamily, { ...params }) -> BrowserFamilyGetResponse</code>

### Ases

Types:
Expand Down Expand Up @@ -6071,6 +6081,16 @@ Methods:

- <code title="get /radar/http/top/ases/tls_version/{tls_version}">client.radar.http.ases.tlsVersion.<a href="./src/resources/radar/http/ases/tls-version.ts">get</a>(tlsVersion, { ...params }) -> TLSVersionGetResponse</code>

#### BrowserFamily

Types:

- <code><a href="./src/resources/radar/http/ases/browser-family.ts">BrowserFamilyGetResponse</a></code>

Methods:

- <code title="get /radar/http/top/ases/browser_family/{browser_family}">client.radar.http.ases.browserFamily.<a href="./src/resources/radar/http/ases/browser-family.ts">get</a>(browserFamily, { ...params }) -> BrowserFamilyGetResponse</code>

### Summary

Types:
Expand Down Expand Up @@ -6356,17 +6376,37 @@ Methods:

Types:

- <code><a href="./src/resources/calls.ts">CallsApp</a></code>
- <code><a href="./src/resources/calls.ts">CallsAppWithSecret</a></code>
- <code><a href="./src/resources/calls.ts">CallListResponse</a></code>
- <code><a href="./src/resources/calls/calls.ts">CallsApp</a></code>
- <code><a href="./src/resources/calls/calls.ts">CallsAppWithSecret</a></code>
- <code><a href="./src/resources/calls/calls.ts">CallListResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/calls/apps">client.calls.<a href="./src/resources/calls/calls.ts">create</a>({ ...params }) -> CallsAppWithSecret</code>
- <code title="put /accounts/{account_id}/calls/apps/{app_id}">client.calls.<a href="./src/resources/calls/calls.ts">update</a>(appId, { ...params }) -> CallsApp</code>
- <code title="get /accounts/{account_id}/calls/apps">client.calls.<a href="./src/resources/calls/calls.ts">list</a>({ ...params }) -> CallListResponsesSinglePage</code>
- <code title="delete /accounts/{account_id}/calls/apps/{app_id}">client.calls.<a href="./src/resources/calls/calls.ts">delete</a>(appId, { ...params }) -> CallsApp</code>
- <code title="get /accounts/{account_id}/calls/apps/{app_id}">client.calls.<a href="./src/resources/calls/calls.ts">get</a>(appId, { ...params }) -> CallsApp</code>

## Turn

### Keys

Types:

- <code><a href="./src/resources/calls/turn/keys.ts">KeyCreateResponse</a></code>
- <code><a href="./src/resources/calls/turn/keys.ts">KeyUpdateResponse</a></code>
- <code><a href="./src/resources/calls/turn/keys.ts">KeyListResponse</a></code>
- <code><a href="./src/resources/calls/turn/keys.ts">KeyDeleteResponse</a></code>
- <code><a href="./src/resources/calls/turn/keys.ts">KeyGetResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/calls/apps">client.calls.<a href="./src/resources/calls.ts">create</a>({ ...params }) -> CallsAppWithSecret</code>
- <code title="put /accounts/{account_id}/calls/apps/{app_id}">client.calls.<a href="./src/resources/calls.ts">update</a>(appId, { ...params }) -> CallsApp</code>
- <code title="get /accounts/{account_id}/calls/apps">client.calls.<a href="./src/resources/calls.ts">list</a>({ ...params }) -> CallListResponsesSinglePage</code>
- <code title="delete /accounts/{account_id}/calls/apps/{app_id}">client.calls.<a href="./src/resources/calls.ts">delete</a>(appId, { ...params }) -> CallsApp</code>
- <code title="get /accounts/{account_id}/calls/apps/{app_id}">client.calls.<a href="./src/resources/calls.ts">get</a>(appId, { ...params }) -> CallsApp</code>
- <code title="post /accounts/{account_id}/calls/turn_keys">client.calls.turn.keys.<a href="./src/resources/calls/turn/keys.ts">create</a>({ ...params }) -> KeyCreateResponse</code>
- <code title="put /accounts/{account_id}/calls/turn_keys/{key_id}">client.calls.turn.keys.<a href="./src/resources/calls/turn/keys.ts">update</a>(keyId, { ...params }) -> KeyUpdateResponse</code>
- <code title="get /accounts/{account_id}/calls/turn_keys">client.calls.turn.keys.<a href="./src/resources/calls/turn/keys.ts">list</a>({ ...params }) -> KeyListResponsesSinglePage</code>
- <code title="delete /accounts/{account_id}/calls/turn_keys/{key_id}">client.calls.turn.keys.<a href="./src/resources/calls/turn/keys.ts">delete</a>(keyId, { ...params }) -> KeyDeleteResponse</code>
- <code title="get /accounts/{account_id}/calls/turn_keys/{key_id}">client.calls.turn.keys.<a href="./src/resources/calls/turn/keys.ts">get</a>(keyId, { ...params }) -> KeyGetResponse</code>

# CloudforceOne

Expand Down
7 changes: 7 additions & 0 deletions src/resources/calls.ts → src/resources/calls/calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as TurnAPI from 'cloudflare/resources/calls/turn/turn';
import { SinglePage } from 'cloudflare/pagination';

export class Calls extends APIResource {
turn: TurnAPI.Turn = new TurnAPI.Turn(this._client);

/**
* Creates a new Cloudflare calls app. An app is an unique enviroment where each
* Session can access all Tracks within the app.
Expand Down Expand Up @@ -171,3 +174,7 @@ export interface CallGetParams {
*/
account_id: string;
}

export namespace Calls {
export import Turn = TurnAPI.Turn;
}
4 changes: 4 additions & 0 deletions src/resources/calls/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { Calls } from './calls';
export { Turn } from './turn/index';
17 changes: 17 additions & 0 deletions src/resources/calls/turn/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export {
KeyCreateResponse,
KeyUpdateResponse,
KeyListResponse,
KeyDeleteResponse,
KeyGetResponse,
KeyCreateParams,
KeyUpdateParams,
KeyListParams,
KeyDeleteParams,
KeyGetParams,
KeyListResponsesSinglePage,
Keys,
} from './keys';
export { Turn } from './turn';
184 changes: 184 additions & 0 deletions src/resources/calls/turn/keys.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as KeysAPI from 'cloudflare/resources/calls/turn/keys';
import { SinglePage } from 'cloudflare/pagination';

export class Keys extends APIResource {
/**
* Creates a new Cloudflare Calls TURN key.
*/
create(params: KeyCreateParams, options?: Core.RequestOptions): Core.APIPromise<KeyCreateResponse> {
const { account_id, ...body } = params;
return this._client.post(`/accounts/${account_id}/calls/turn_keys`, { body, ...options });
}

/**
* Edit details for a single TURN key.
*/
update(
keyId: string,
params: KeyUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<KeyUpdateResponse> {
const { account_id, ...body } = params;
return (
this._client.put(`/accounts/${account_id}/calls/turn_keys/${keyId}`, {
body,
...options,
}) as Core.APIPromise<{ result: KeyUpdateResponse }>
)._thenUnwrap((obj) => obj.result);
}

/**
* Lists all TURN keys in the Cloudflare account
*/
list(
params: KeyListParams,
options?: Core.RequestOptions,
): Core.PagePromise<KeyListResponsesSinglePage, KeyListResponse> {
const { account_id } = params;
return this._client.getAPIList(
`/accounts/${account_id}/calls/turn_keys`,
KeyListResponsesSinglePage,
options,
);
}

/**
* Deletes a TURN key from Cloudflare Calls
*/
delete(
keyId: string,
params: KeyDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise<KeyDeleteResponse> {
const { account_id } = params;
return (
this._client.delete(`/accounts/${account_id}/calls/turn_keys/${keyId}`, options) as Core.APIPromise<{
result: KeyDeleteResponse;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Fetches details for a single TURN key.
*/
get(keyId: string, params: KeyGetParams, options?: Core.RequestOptions): Core.APIPromise<KeyGetResponse> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}/calls/turn_keys/${keyId}`, options) as Core.APIPromise<{
result: KeyGetResponse;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export class KeyListResponsesSinglePage extends SinglePage<KeyListResponse> {}

export interface KeyCreateResponse {
/**
* The date and time the item was created.
*/
created?: string;

/**
* Bearer token
*/
key?: string;

/**
* The date and time the item was last modified.
*/
modified?: string;

/**
* A short description of a TURN key, not shown to end users.
*/
name?: string;

/**
* A Cloudflare-generated unique identifier for a item.
*/
uid?: string;
}

/**
* Bearer token
*/
export type KeyUpdateResponse = string;

/**
* Bearer token
*/
export type KeyListResponse = string;

/**
* Bearer token
*/
export type KeyDeleteResponse = string;

/**
* Bearer token
*/
export type KeyGetResponse = string;

export interface KeyCreateParams {
/**
* Path param: The account identifier tag.
*/
account_id: string;

/**
* Body param: A short description of a TURN key, not shown to end users.
*/
name?: string;
}

export interface KeyUpdateParams {
/**
* Path param: The account identifier tag.
*/
account_id: string;

/**
* Body param: A short description of a TURN key, not shown to end users.
*/
name?: string;
}

export interface KeyListParams {
/**
* The account identifier tag.
*/
account_id: string;
}

export interface KeyDeleteParams {
/**
* The account identifier tag.
*/
account_id: string;
}

export interface KeyGetParams {
/**
* The account identifier tag.
*/
account_id: string;
}

export namespace Keys {
export import KeyCreateResponse = KeysAPI.KeyCreateResponse;
export import KeyUpdateResponse = KeysAPI.KeyUpdateResponse;
export import KeyListResponse = KeysAPI.KeyListResponse;
export import KeyDeleteResponse = KeysAPI.KeyDeleteResponse;
export import KeyGetResponse = KeysAPI.KeyGetResponse;
export import KeyListResponsesSinglePage = KeysAPI.KeyListResponsesSinglePage;
export import KeyCreateParams = KeysAPI.KeyCreateParams;
export import KeyUpdateParams = KeysAPI.KeyUpdateParams;
export import KeyListParams = KeysAPI.KeyListParams;
export import KeyDeleteParams = KeysAPI.KeyDeleteParams;
export import KeyGetParams = KeysAPI.KeyGetParams;
}
23 changes: 23 additions & 0 deletions src/resources/calls/turn/turn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from 'cloudflare/resource';
import * as KeysAPI from 'cloudflare/resources/calls/turn/keys';

export class Turn extends APIResource {
keys: KeysAPI.Keys = new KeysAPI.Keys(this._client);
}

export namespace Turn {
export import Keys = KeysAPI.Keys;
export import KeyCreateResponse = KeysAPI.KeyCreateResponse;
export import KeyUpdateResponse = KeysAPI.KeyUpdateResponse;
export import KeyListResponse = KeysAPI.KeyListResponse;
export import KeyDeleteResponse = KeysAPI.KeyDeleteResponse;
export import KeyGetResponse = KeysAPI.KeyGetResponse;
export import KeyListResponsesSinglePage = KeysAPI.KeyListResponsesSinglePage;
export import KeyCreateParams = KeysAPI.KeyCreateParams;
export import KeyUpdateParams = KeysAPI.KeyUpdateParams;
export import KeyListParams = KeysAPI.KeyListParams;
export import KeyDeleteParams = KeysAPI.KeyDeleteParams;
export import KeyGetParams = KeysAPI.KeyGetParams;
}
2 changes: 1 addition & 1 deletion src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export { Billing } from './billing/billing';
export { BotManagement } from './bot-management';
export { BrandProtection } from './brand-protection';
export { Cache } from './cache/cache';
export { Calls } from './calls';
export { Calls } from './calls/calls';
export { CertificateAuthorities } from './certificate-authorities/certificate-authorities';
export { Challenges } from './challenges/challenges';
export { ClientCertificates } from './client-certificates';
Expand Down
5 changes: 5 additions & 0 deletions src/resources/radar/http/ases/ases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as AsesAPI from 'cloudflare/resources/radar/http/ases/ases';
import * as BotClassAPI from 'cloudflare/resources/radar/http/ases/bot-class';
import * as BrowserFamilyAPI from 'cloudflare/resources/radar/http/ases/browser-family';
import * as DeviceTypeAPI from 'cloudflare/resources/radar/http/ases/device-type';
import * as HTTPMethodAPI from 'cloudflare/resources/radar/http/ases/http-method';
import * as HTTPProtocolAPI from 'cloudflare/resources/radar/http/ases/http-protocol';
Expand All @@ -20,6 +21,7 @@ export class Ases extends APIResource {
ipVersion: IPVersionAPI.IPVersion = new IPVersionAPI.IPVersion(this._client);
os: OSAPI.OS = new OSAPI.OS(this._client);
tlsVersion: TLSVersionAPI.TLSVersion = new TLSVersionAPI.TLSVersion(this._client);
browserFamily: BrowserFamilyAPI.BrowserFamily = new BrowserFamilyAPI.BrowserFamily(this._client);

/**
* Get the top autonomous systems by HTTP traffic. Values are a percentage out of
Expand Down Expand Up @@ -240,4 +242,7 @@ export namespace Ases {
export import TLSVersion = TLSVersionAPI.TLSVersion;
export import TLSVersionGetResponse = TLSVersionAPI.TLSVersionGetResponse;
export import TLSVersionGetParams = TLSVersionAPI.TLSVersionGetParams;
export import BrowserFamily = BrowserFamilyAPI.BrowserFamily;
export import BrowserFamilyGetResponse = BrowserFamilyAPI.BrowserFamilyGetResponse;
export import BrowserFamilyGetParams = BrowserFamilyAPI.BrowserFamilyGetParams;
}

0 comments on commit c2185e1

Please sign in to comment.