Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 19, 2024
1 parent 0bdd105 commit a63f145
Show file tree
Hide file tree
Showing 21 changed files with 782 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1259
configured_endpoints: 1266
65 changes: 59 additions & 6 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3807,15 +3807,34 @@ Methods:

Types:

- <code><a href="./src/resources/stream/captions.ts">Caption</a></code>
- <code><a href="./src/resources/stream/captions.ts">CaptionDeleteResponse</a></code>
- <code><a href="./src/resources/stream/captions.ts">CaptionGetResponse</a></code>
- <code><a href="./src/resources/stream/captions/captions.ts">Caption</a></code>
- <code><a href="./src/resources/stream/captions/captions.ts">CaptionGetResponse</a></code>

Methods:

- <code title="put /accounts/{account_id}/stream/{identifier}/captions/{language}">client.stream.captions.<a href="./src/resources/stream/captions.ts">update</a>(identifier, language, { ...params }) -> Caption</code>
- <code title="delete /accounts/{account_id}/stream/{identifier}/captions/{language}">client.stream.captions.<a href="./src/resources/stream/captions.ts">delete</a>(identifier, language, { ...params }) -> CaptionDeleteResponse</code>
- <code title="get /accounts/{account_id}/stream/{identifier}/captions">client.stream.captions.<a href="./src/resources/stream/captions.ts">get</a>(identifier, { ...params }) -> CaptionGetResponse</code>
- <code title="get /accounts/{account_id}/stream/{identifier}/captions">client.stream.captions.<a href="./src/resources/stream/captions/captions.ts">get</a>(identifier, { ...params }) -> CaptionGetResponse</code>

### Language

Types:

- <code><a href="./src/resources/stream/captions/language/language.ts">LanguageDeleteResponse</a></code>

Methods:

- <code title="put /accounts/{account_id}/stream/{identifier}/captions/{language}">client.stream.captions.language.<a href="./src/resources/stream/captions/language/language.ts">update</a>(identifier, language, { ...params }) -> Caption</code>
- <code title="delete /accounts/{account_id}/stream/{identifier}/captions/{language}">client.stream.captions.language.<a href="./src/resources/stream/captions/language/language.ts">delete</a>(identifier, language, { ...params }) -> LanguageDeleteResponse</code>
- <code title="get /accounts/{account_id}/stream/{identifier}/captions/{language}">client.stream.captions.language.<a href="./src/resources/stream/captions/language/language.ts">get</a>(identifier, language, { ...params }) -> Caption</code>

#### Vtt

Types:

- <code><a href="./src/resources/stream/captions/language/vtt.ts">VttGetResponse</a></code>

Methods:

- <code title="get /accounts/{account_id}/stream/{identifier}/captions/{language}/vtt">client.stream.captions.language.vtt.<a href="./src/resources/stream/captions/language/vtt.ts">get</a>(identifier, language, { ...params }) -> string</code>

## Downloads

Expand Down Expand Up @@ -5110,6 +5129,40 @@ Methods:
- <code title="delete /accounts/{account_id}/teamnet/virtual_networks/{virtual_network_id}">client.zeroTrust.networks.virtualNetworks.<a href="./src/resources/zero-trust/networks/virtual-networks.ts">delete</a>(virtualNetworkId, { ...params }) -> VirtualNetworkDeleteResponse</code>
- <code title="patch /accounts/{account_id}/teamnet/virtual_networks/{virtual_network_id}">client.zeroTrust.networks.virtualNetworks.<a href="./src/resources/zero-trust/networks/virtual-networks.ts">edit</a>(virtualNetworkId, { ...params }) -> VirtualNetworkEditResponse</code>

## RiskScoring

Types:

- <code><a href="./src/resources/zero-trust/risk-scoring/risk-scoring.ts">RiskScoringGetResponse</a></code>
- <code><a href="./src/resources/zero-trust/risk-scoring/risk-scoring.ts">RiskScoringResetResponse</a></code>

Methods:

- <code title="get /accounts/{account_identifier}/zt_risk_scoring/{user_id}">client.zeroTrust.riskScoring.<a href="./src/resources/zero-trust/risk-scoring/risk-scoring.ts">get</a>(accountIdentifier, userId, { ...params }) -> RiskScoringGetResponse</code>
- <code title="post /accounts/{account_identifier}/zt_risk_scoring/{user_id}/reset">client.zeroTrust.riskScoring.<a href="./src/resources/zero-trust/risk-scoring/risk-scoring.ts">reset</a>(accountIdentifier, userId) -> RiskScoringResetResponse</code>

### Behaviours

Types:

- <code><a href="./src/resources/zero-trust/risk-scoring/behaviours.ts">BehaviourUpdateResponse</a></code>
- <code><a href="./src/resources/zero-trust/risk-scoring/behaviours.ts">BehaviourGetResponse</a></code>

Methods:

- <code title="put /accounts/{account_identifier}/zt_risk_scoring/behaviors">client.zeroTrust.riskScoring.behaviours.<a href="./src/resources/zero-trust/risk-scoring/behaviours.ts">update</a>(accountIdentifier, { ...params }) -> BehaviourUpdateResponse</code>
- <code title="get /accounts/{account_identifier}/zt_risk_scoring/behaviors">client.zeroTrust.riskScoring.behaviours.<a href="./src/resources/zero-trust/risk-scoring/behaviours.ts">get</a>(accountIdentifier) -> BehaviourGetResponse</code>

### Summary

Types:

- <code><a href="./src/resources/zero-trust/risk-scoring/summary.ts">SummaryGetResponse</a></code>

Methods:

- <code title="get /accounts/{account_identifier}/zt_risk_scoring/summary">client.zeroTrust.riskScoring.summary.<a href="./src/resources/zero-trust/risk-scoring/summary.ts">get</a>(accountIdentifier, { ...params }) -> SummaryGetResponse</code>

# Challenges

## Widgets
Expand Down
58 changes: 58 additions & 0 deletions src/resources/stream/captions/captions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// 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 CaptionsAPI from 'cloudflare/resources/stream/captions/captions';
import * as LanguageAPI from 'cloudflare/resources/stream/captions/language/language';

export class Captions extends APIResource {
language: LanguageAPI.Language = new LanguageAPI.Language(this._client);

/**
* Lists the available captions or subtitles for a specific video.
*/
get(
identifier: string,
params: CaptionGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<CaptionGetResponse> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}/stream/${identifier}/captions`, options) as Core.APIPromise<{
result: CaptionGetResponse;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export interface Caption {
/**
* The language label displayed in the native language to users.
*/
label?: string;

/**
* The language tag in BCP 47 format.
*/
language?: string;
}

export type CaptionGetResponse = Array<Caption>;

export interface CaptionGetParams {
/**
* Identifier
*/
account_id: string;
}

export namespace Captions {
export import Caption = CaptionsAPI.Caption;
export import CaptionGetResponse = CaptionsAPI.CaptionGetResponse;
export import CaptionGetParams = CaptionsAPI.CaptionGetParams;
export import Language = LanguageAPI.Language;
export import LanguageDeleteResponse = LanguageAPI.LanguageDeleteResponse;
export import LanguageUpdateParams = LanguageAPI.LanguageUpdateParams;
export import LanguageDeleteParams = LanguageAPI.LanguageDeleteParams;
export import LanguageGetParams = LanguageAPI.LanguageGetParams;
}
10 changes: 10 additions & 0 deletions src/resources/stream/captions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { Caption, CaptionGetResponse, CaptionGetParams, Captions } from './captions';
export {
LanguageDeleteResponse,
LanguageUpdateParams,
LanguageDeleteParams,
LanguageGetParams,
Language,
} from './language/index';
10 changes: 10 additions & 0 deletions src/resources/stream/captions/language/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export {
LanguageDeleteResponse,
LanguageUpdateParams,
LanguageDeleteParams,
LanguageGetParams,
Language,
} from './language';
export { VttGetResponse, VttGetParams, Vtt } from './vtt';
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,30 @@

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as CaptionsAPI from 'cloudflare/resources/stream/captions';
import * as LanguageAPI from 'cloudflare/resources/stream/captions/language/language';
import * as CaptionsAPI from 'cloudflare/resources/stream/captions/captions';
import * as VttAPI from 'cloudflare/resources/stream/captions/language/vtt';
import { multipartFormRequestOptions } from 'cloudflare/core';

export class Captions extends APIResource {
export class Language extends APIResource {
vtt: VttAPI.Vtt = new VttAPI.Vtt(this._client);

/**
* Uploads the caption or subtitle file to the endpoint for a specific BCP47
* language. One caption or subtitle file per language is allowed.
*/
update(
identifier: string,
language: string,
params: CaptionUpdateParams,
params: LanguageUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<Caption> {
): Core.APIPromise<CaptionsAPI.Caption> {
const { account_id, ...body } = params;
return (
this._client.put(
`/accounts/${account_id}/stream/${identifier}/captions/${language}`,
multipartFormRequestOptions({ body, ...options }),
) as Core.APIPromise<{ result: Caption }>
) as Core.APIPromise<{ result: CaptionsAPI.Caption }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -31,52 +35,40 @@ export class Captions extends APIResource {
delete(
identifier: string,
language: string,
params: CaptionDeleteParams,
params: LanguageDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise<CaptionDeleteResponse> {
): Core.APIPromise<LanguageDeleteResponse> {
const { account_id, body } = params;
return (
this._client.delete(`/accounts/${account_id}/stream/${identifier}/captions/${language}`, {
body: body,
...options,
}) as Core.APIPromise<{ result: CaptionDeleteResponse }>
}) as Core.APIPromise<{ result: LanguageDeleteResponse }>
)._thenUnwrap((obj) => obj.result);
}

/**
* Lists the available captions or subtitles for a specific video.
* Lists the captions or subtitles for provided language.
*/
get(
identifier: string,
params: CaptionGetParams,
language: string,
params: LanguageGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<CaptionGetResponse> {
): Core.APIPromise<CaptionsAPI.Caption> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}/stream/${identifier}/captions`, options) as Core.APIPromise<{
result: CaptionGetResponse;
}>
this._client.get(
`/accounts/${account_id}/stream/${identifier}/captions/${language}`,
options,
) as Core.APIPromise<{ result: CaptionsAPI.Caption }>
)._thenUnwrap((obj) => obj.result);
}
}

export interface Caption {
/**
* The language label displayed in the native language to users.
*/
label?: string;

/**
* The language tag in BCP 47 format.
*/
language?: string;
}

export type CaptionDeleteResponse = string;

export type CaptionGetResponse = Array<Caption>;
export type LanguageDeleteResponse = string;

export interface CaptionUpdateParams {
export interface LanguageUpdateParams {
/**
* Path param: Identifier
*/
Expand All @@ -88,7 +80,7 @@ export interface CaptionUpdateParams {
file: string;
}

export interface CaptionDeleteParams {
export interface LanguageDeleteParams {
/**
* Path param: Identifier
*/
Expand All @@ -100,18 +92,19 @@ export interface CaptionDeleteParams {
body: unknown;
}

export interface CaptionGetParams {
export interface LanguageGetParams {
/**
* Identifier
*/
account_id: string;
}

export namespace Captions {
export import Caption = CaptionsAPI.Caption;
export import CaptionDeleteResponse = CaptionsAPI.CaptionDeleteResponse;
export import CaptionGetResponse = CaptionsAPI.CaptionGetResponse;
export import CaptionUpdateParams = CaptionsAPI.CaptionUpdateParams;
export import CaptionDeleteParams = CaptionsAPI.CaptionDeleteParams;
export import CaptionGetParams = CaptionsAPI.CaptionGetParams;
export namespace Language {
export import LanguageDeleteResponse = LanguageAPI.LanguageDeleteResponse;
export import LanguageUpdateParams = LanguageAPI.LanguageUpdateParams;
export import LanguageDeleteParams = LanguageAPI.LanguageDeleteParams;
export import LanguageGetParams = LanguageAPI.LanguageGetParams;
export import Vtt = VttAPI.Vtt;
export import VttGetResponse = VttAPI.VttGetResponse;
export import VttGetParams = VttAPI.VttGetParams;
}
43 changes: 43 additions & 0 deletions src/resources/stream/captions/language/vtt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// 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 VttAPI from 'cloudflare/resources/stream/captions/language/vtt';

export class Vtt extends APIResource {
/**
* Return WebVTT captions for a provided language.
*/
get(
identifier: string,
language: string,
params: VttGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<string> {
const { account_id, body } = params;
return this._client.get(`/accounts/${account_id}/stream/${identifier}/captions/${language}/vtt`, {
body: body,
...options,
headers: { Accept: 'text/vtt', ...options?.headers },
});
}
}

export type VttGetResponse = string;

export interface VttGetParams {
/**
* Path param: Identifier
*/
account_id: string;

/**
* Body param:
*/
body: unknown;
}

export namespace Vtt {
export import VttGetResponse = VttAPI.VttGetResponse;
export import VttGetParams = VttAPI.VttGetParams;
}
10 changes: 1 addition & 9 deletions src/resources/stream/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@ export {
AudioTrackGetParams,
AudioTracks,
} from './audio-tracks';
export {
Caption,
CaptionDeleteResponse,
CaptionGetResponse,
CaptionUpdateParams,
CaptionDeleteParams,
CaptionGetParams,
Captions,
} from './captions';
export { Caption, CaptionGetResponse, CaptionGetParams, Captions } from './captions/index';
export { Clip, ClipCreateParams, ClipResource } from './clip';
export { CopyCreateParams, Copy } from './copy';
export { DirectUploadCreateResponse, DirectUploadCreateParams, DirectUpload } from './direct-upload';
Expand Down
5 changes: 1 addition & 4 deletions src/resources/stream/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as AudioTracksAPI from 'cloudflare/resources/stream/audio-tracks';
import * as CaptionsAPI from 'cloudflare/resources/stream/captions';
import * as ClipAPI from 'cloudflare/resources/stream/clip';
import * as CopyAPI from 'cloudflare/resources/stream/copy';
import * as DirectUploadAPI from 'cloudflare/resources/stream/direct-upload';
Expand All @@ -14,6 +13,7 @@ import * as TokenAPI from 'cloudflare/resources/stream/token';
import * as VideosAPI from 'cloudflare/resources/stream/videos';
import * as WatermarksAPI from 'cloudflare/resources/stream/watermarks';
import * as WebhooksAPI from 'cloudflare/resources/stream/webhooks';
import * as CaptionsAPI from 'cloudflare/resources/stream/captions/captions';
import * as LiveInputsAPI from 'cloudflare/resources/stream/live-inputs/live-inputs';
import { SinglePage } from 'cloudflare/pagination';

Expand Down Expand Up @@ -450,10 +450,7 @@ export namespace Stream {
export import WebhookGetParams = WebhooksAPI.WebhookGetParams;
export import Captions = CaptionsAPI.Captions;
export import Caption = CaptionsAPI.Caption;
export import CaptionDeleteResponse = CaptionsAPI.CaptionDeleteResponse;
export import CaptionGetResponse = CaptionsAPI.CaptionGetResponse;
export import CaptionUpdateParams = CaptionsAPI.CaptionUpdateParams;
export import CaptionDeleteParams = CaptionsAPI.CaptionDeleteParams;
export import CaptionGetParams = CaptionsAPI.CaptionGetParams;
export import Downloads = DownloadsAPI.Downloads;
export import DownloadCreateResponse = DownloadsAPI.DownloadCreateResponse;
Expand Down
Loading

0 comments on commit a63f145

Please sign in to comment.