-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): update via SDK Studio (#501)
- Loading branch information
1 parent
aca5e19
commit c2185e1
Showing
18 changed files
with
944 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.