Skip to content

Commit 328ca5b

Browse files
feat(api): update via SDK Studio (#357)
1 parent f62c337 commit 328ca5b

File tree

21 files changed

+782
-80
lines changed

21 files changed

+782
-80
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 1259
1+
configured_endpoints: 1266

api.md

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,15 +3807,34 @@ Methods:
38073807

38083808
Types:
38093809

3810-
- <code><a href="./src/resources/stream/captions.ts">Caption</a></code>
3811-
- <code><a href="./src/resources/stream/captions.ts">CaptionDeleteResponse</a></code>
3812-
- <code><a href="./src/resources/stream/captions.ts">CaptionGetResponse</a></code>
3810+
- <code><a href="./src/resources/stream/captions/captions.ts">Caption</a></code>
3811+
- <code><a href="./src/resources/stream/captions/captions.ts">CaptionGetResponse</a></code>
38133812

38143813
Methods:
38153814

3816-
- <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>
3817-
- <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>
3818-
- <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>
3815+
- <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>
3816+
3817+
### Language
3818+
3819+
Types:
3820+
3821+
- <code><a href="./src/resources/stream/captions/language/language.ts">LanguageDeleteResponse</a></code>
3822+
3823+
Methods:
3824+
3825+
- <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>
3826+
- <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>
3827+
- <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>
3828+
3829+
#### Vtt
3830+
3831+
Types:
3832+
3833+
- <code><a href="./src/resources/stream/captions/language/vtt.ts">VttGetResponse</a></code>
3834+
3835+
Methods:
3836+
3837+
- <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>
38193838

38203839
## Downloads
38213840

@@ -5110,6 +5129,40 @@ Methods:
51105129
- <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>
51115130
- <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>
51125131

5132+
## RiskScoring
5133+
5134+
Types:
5135+
5136+
- <code><a href="./src/resources/zero-trust/risk-scoring/risk-scoring.ts">RiskScoringGetResponse</a></code>
5137+
- <code><a href="./src/resources/zero-trust/risk-scoring/risk-scoring.ts">RiskScoringResetResponse</a></code>
5138+
5139+
Methods:
5140+
5141+
- <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>
5142+
- <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>
5143+
5144+
### Behaviours
5145+
5146+
Types:
5147+
5148+
- <code><a href="./src/resources/zero-trust/risk-scoring/behaviours.ts">BehaviourUpdateResponse</a></code>
5149+
- <code><a href="./src/resources/zero-trust/risk-scoring/behaviours.ts">BehaviourGetResponse</a></code>
5150+
5151+
Methods:
5152+
5153+
- <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>
5154+
- <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>
5155+
5156+
### Summary
5157+
5158+
Types:
5159+
5160+
- <code><a href="./src/resources/zero-trust/risk-scoring/summary.ts">SummaryGetResponse</a></code>
5161+
5162+
Methods:
5163+
5164+
- <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>
5165+
51135166
# Challenges
51145167

51155168
## Widgets
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import * as Core from 'cloudflare/core';
4+
import { APIResource } from 'cloudflare/resource';
5+
import * as CaptionsAPI from 'cloudflare/resources/stream/captions/captions';
6+
import * as LanguageAPI from 'cloudflare/resources/stream/captions/language/language';
7+
8+
export class Captions extends APIResource {
9+
language: LanguageAPI.Language = new LanguageAPI.Language(this._client);
10+
11+
/**
12+
* Lists the available captions or subtitles for a specific video.
13+
*/
14+
get(
15+
identifier: string,
16+
params: CaptionGetParams,
17+
options?: Core.RequestOptions,
18+
): Core.APIPromise<CaptionGetResponse> {
19+
const { account_id } = params;
20+
return (
21+
this._client.get(`/accounts/${account_id}/stream/${identifier}/captions`, options) as Core.APIPromise<{
22+
result: CaptionGetResponse;
23+
}>
24+
)._thenUnwrap((obj) => obj.result);
25+
}
26+
}
27+
28+
export interface Caption {
29+
/**
30+
* The language label displayed in the native language to users.
31+
*/
32+
label?: string;
33+
34+
/**
35+
* The language tag in BCP 47 format.
36+
*/
37+
language?: string;
38+
}
39+
40+
export type CaptionGetResponse = Array<Caption>;
41+
42+
export interface CaptionGetParams {
43+
/**
44+
* Identifier
45+
*/
46+
account_id: string;
47+
}
48+
49+
export namespace Captions {
50+
export import Caption = CaptionsAPI.Caption;
51+
export import CaptionGetResponse = CaptionsAPI.CaptionGetResponse;
52+
export import CaptionGetParams = CaptionsAPI.CaptionGetParams;
53+
export import Language = LanguageAPI.Language;
54+
export import LanguageDeleteResponse = LanguageAPI.LanguageDeleteResponse;
55+
export import LanguageUpdateParams = LanguageAPI.LanguageUpdateParams;
56+
export import LanguageDeleteParams = LanguageAPI.LanguageDeleteParams;
57+
export import LanguageGetParams = LanguageAPI.LanguageGetParams;
58+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export { Caption, CaptionGetResponse, CaptionGetParams, Captions } from './captions';
4+
export {
5+
LanguageDeleteResponse,
6+
LanguageUpdateParams,
7+
LanguageDeleteParams,
8+
LanguageGetParams,
9+
Language,
10+
} from './language/index';
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export {
4+
LanguageDeleteResponse,
5+
LanguageUpdateParams,
6+
LanguageDeleteParams,
7+
LanguageGetParams,
8+
Language,
9+
} from './language';
10+
export { VttGetResponse, VttGetParams, Vtt } from './vtt';

src/resources/stream/captions.ts renamed to src/resources/stream/captions/language/language.ts

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,30 @@
22

33
import * as Core from 'cloudflare/core';
44
import { APIResource } from 'cloudflare/resource';
5-
import * as CaptionsAPI from 'cloudflare/resources/stream/captions';
5+
import * as LanguageAPI from 'cloudflare/resources/stream/captions/language/language';
6+
import * as CaptionsAPI from 'cloudflare/resources/stream/captions/captions';
7+
import * as VttAPI from 'cloudflare/resources/stream/captions/language/vtt';
68
import { multipartFormRequestOptions } from 'cloudflare/core';
79

8-
export class Captions extends APIResource {
10+
export class Language extends APIResource {
11+
vtt: VttAPI.Vtt = new VttAPI.Vtt(this._client);
12+
913
/**
1014
* Uploads the caption or subtitle file to the endpoint for a specific BCP47
1115
* language. One caption or subtitle file per language is allowed.
1216
*/
1317
update(
1418
identifier: string,
1519
language: string,
16-
params: CaptionUpdateParams,
20+
params: LanguageUpdateParams,
1721
options?: Core.RequestOptions,
18-
): Core.APIPromise<Caption> {
22+
): Core.APIPromise<CaptionsAPI.Caption> {
1923
const { account_id, ...body } = params;
2024
return (
2125
this._client.put(
2226
`/accounts/${account_id}/stream/${identifier}/captions/${language}`,
2327
multipartFormRequestOptions({ body, ...options }),
24-
) as Core.APIPromise<{ result: Caption }>
28+
) as Core.APIPromise<{ result: CaptionsAPI.Caption }>
2529
)._thenUnwrap((obj) => obj.result);
2630
}
2731

@@ -31,52 +35,40 @@ export class Captions extends APIResource {
3135
delete(
3236
identifier: string,
3337
language: string,
34-
params: CaptionDeleteParams,
38+
params: LanguageDeleteParams,
3539
options?: Core.RequestOptions,
36-
): Core.APIPromise<CaptionDeleteResponse> {
40+
): Core.APIPromise<LanguageDeleteResponse> {
3741
const { account_id, body } = params;
3842
return (
3943
this._client.delete(`/accounts/${account_id}/stream/${identifier}/captions/${language}`, {
4044
body: body,
4145
...options,
42-
}) as Core.APIPromise<{ result: CaptionDeleteResponse }>
46+
}) as Core.APIPromise<{ result: LanguageDeleteResponse }>
4347
)._thenUnwrap((obj) => obj.result);
4448
}
4549

4650
/**
47-
* Lists the available captions or subtitles for a specific video.
51+
* Lists the captions or subtitles for provided language.
4852
*/
4953
get(
5054
identifier: string,
51-
params: CaptionGetParams,
55+
language: string,
56+
params: LanguageGetParams,
5257
options?: Core.RequestOptions,
53-
): Core.APIPromise<CaptionGetResponse> {
58+
): Core.APIPromise<CaptionsAPI.Caption> {
5459
const { account_id } = params;
5560
return (
56-
this._client.get(`/accounts/${account_id}/stream/${identifier}/captions`, options) as Core.APIPromise<{
57-
result: CaptionGetResponse;
58-
}>
61+
this._client.get(
62+
`/accounts/${account_id}/stream/${identifier}/captions/${language}`,
63+
options,
64+
) as Core.APIPromise<{ result: CaptionsAPI.Caption }>
5965
)._thenUnwrap((obj) => obj.result);
6066
}
6167
}
6268

63-
export interface Caption {
64-
/**
65-
* The language label displayed in the native language to users.
66-
*/
67-
label?: string;
68-
69-
/**
70-
* The language tag in BCP 47 format.
71-
*/
72-
language?: string;
73-
}
74-
75-
export type CaptionDeleteResponse = string;
76-
77-
export type CaptionGetResponse = Array<Caption>;
69+
export type LanguageDeleteResponse = string;
7870

79-
export interface CaptionUpdateParams {
71+
export interface LanguageUpdateParams {
8072
/**
8173
* Path param: Identifier
8274
*/
@@ -88,7 +80,7 @@ export interface CaptionUpdateParams {
8880
file: string;
8981
}
9082

91-
export interface CaptionDeleteParams {
83+
export interface LanguageDeleteParams {
9284
/**
9385
* Path param: Identifier
9486
*/
@@ -100,18 +92,19 @@ export interface CaptionDeleteParams {
10092
body: unknown;
10193
}
10294

103-
export interface CaptionGetParams {
95+
export interface LanguageGetParams {
10496
/**
10597
* Identifier
10698
*/
10799
account_id: string;
108100
}
109101

110-
export namespace Captions {
111-
export import Caption = CaptionsAPI.Caption;
112-
export import CaptionDeleteResponse = CaptionsAPI.CaptionDeleteResponse;
113-
export import CaptionGetResponse = CaptionsAPI.CaptionGetResponse;
114-
export import CaptionUpdateParams = CaptionsAPI.CaptionUpdateParams;
115-
export import CaptionDeleteParams = CaptionsAPI.CaptionDeleteParams;
116-
export import CaptionGetParams = CaptionsAPI.CaptionGetParams;
102+
export namespace Language {
103+
export import LanguageDeleteResponse = LanguageAPI.LanguageDeleteResponse;
104+
export import LanguageUpdateParams = LanguageAPI.LanguageUpdateParams;
105+
export import LanguageDeleteParams = LanguageAPI.LanguageDeleteParams;
106+
export import LanguageGetParams = LanguageAPI.LanguageGetParams;
107+
export import Vtt = VttAPI.Vtt;
108+
export import VttGetResponse = VttAPI.VttGetResponse;
109+
export import VttGetParams = VttAPI.VttGetParams;
117110
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import * as Core from 'cloudflare/core';
4+
import { APIResource } from 'cloudflare/resource';
5+
import * as VttAPI from 'cloudflare/resources/stream/captions/language/vtt';
6+
7+
export class Vtt extends APIResource {
8+
/**
9+
* Return WebVTT captions for a provided language.
10+
*/
11+
get(
12+
identifier: string,
13+
language: string,
14+
params: VttGetParams,
15+
options?: Core.RequestOptions,
16+
): Core.APIPromise<string> {
17+
const { account_id, body } = params;
18+
return this._client.get(`/accounts/${account_id}/stream/${identifier}/captions/${language}/vtt`, {
19+
body: body,
20+
...options,
21+
headers: { Accept: 'text/vtt', ...options?.headers },
22+
});
23+
}
24+
}
25+
26+
export type VttGetResponse = string;
27+
28+
export interface VttGetParams {
29+
/**
30+
* Path param: Identifier
31+
*/
32+
account_id: string;
33+
34+
/**
35+
* Body param:
36+
*/
37+
body: unknown;
38+
}
39+
40+
export namespace Vtt {
41+
export import VttGetResponse = VttAPI.VttGetResponse;
42+
export import VttGetParams = VttAPI.VttGetParams;
43+
}

src/resources/stream/index.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,7 @@ export {
1010
AudioTrackGetParams,
1111
AudioTracks,
1212
} from './audio-tracks';
13-
export {
14-
Caption,
15-
CaptionDeleteResponse,
16-
CaptionGetResponse,
17-
CaptionUpdateParams,
18-
CaptionDeleteParams,
19-
CaptionGetParams,
20-
Captions,
21-
} from './captions';
13+
export { Caption, CaptionGetResponse, CaptionGetParams, Captions } from './captions/index';
2214
export { Clip, ClipCreateParams, ClipResource } from './clip';
2315
export { CopyCreateParams, Copy } from './copy';
2416
export { DirectUploadCreateResponse, DirectUploadCreateParams, DirectUpload } from './direct-upload';

src/resources/stream/stream.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import * as Core from 'cloudflare/core';
44
import { APIResource } from 'cloudflare/resource';
55
import * as AudioTracksAPI from 'cloudflare/resources/stream/audio-tracks';
6-
import * as CaptionsAPI from 'cloudflare/resources/stream/captions';
76
import * as ClipAPI from 'cloudflare/resources/stream/clip';
87
import * as CopyAPI from 'cloudflare/resources/stream/copy';
98
import * as DirectUploadAPI from 'cloudflare/resources/stream/direct-upload';
@@ -14,6 +13,7 @@ import * as TokenAPI from 'cloudflare/resources/stream/token';
1413
import * as VideosAPI from 'cloudflare/resources/stream/videos';
1514
import * as WatermarksAPI from 'cloudflare/resources/stream/watermarks';
1615
import * as WebhooksAPI from 'cloudflare/resources/stream/webhooks';
16+
import * as CaptionsAPI from 'cloudflare/resources/stream/captions/captions';
1717
import * as LiveInputsAPI from 'cloudflare/resources/stream/live-inputs/live-inputs';
1818
import { SinglePage } from 'cloudflare/pagination';
1919

@@ -450,10 +450,7 @@ export namespace Stream {
450450
export import WebhookGetParams = WebhooksAPI.WebhookGetParams;
451451
export import Captions = CaptionsAPI.Captions;
452452
export import Caption = CaptionsAPI.Caption;
453-
export import CaptionDeleteResponse = CaptionsAPI.CaptionDeleteResponse;
454453
export import CaptionGetResponse = CaptionsAPI.CaptionGetResponse;
455-
export import CaptionUpdateParams = CaptionsAPI.CaptionUpdateParams;
456-
export import CaptionDeleteParams = CaptionsAPI.CaptionDeleteParams;
457454
export import CaptionGetParams = CaptionsAPI.CaptionGetParams;
458455
export import Downloads = DownloadsAPI.Downloads;
459456
export import DownloadCreateResponse = DownloadsAPI.DownloadCreateResponse;

0 commit comments

Comments
 (0)