Skip to content

Commit 6887c81

Browse files
feat(api): OpenAPI spec update via Stainless API (#426)
1 parent 34cf334 commit 6887c81

File tree

5 files changed

+117
-13
lines changed

5 files changed

+117
-13
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 97
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-6aab47a3857727b9d53429d9b367c0fbd1e7d86e42e4c59335bab5770907d18c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-b1c7a231d90814e227c4a339a6760d1b05b04b874ffc7763affbad6a2c11d418.yml

src/resources/video/assets.ts

Lines changed: 74 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,13 @@ export namespace Asset {
565565
}
566566

567567
export interface AssetOptions {
568+
/**
569+
* An array of playback policy objects that you want applied to this asset and
570+
* available through `playback_ids`. `advanced_playback_policy` must be used
571+
* instead of `playback_policy` when creating a DRM playback ID.
572+
*/
573+
advanced_playback_policy?: Array<AssetOptions.AdvancedPlaybackPolicy>;
574+
568575
/**
569576
* The encoding tier informs the cost, quality, and available platform features for
570577
* the asset. By default the `smart` encoding tier is used.
@@ -642,12 +649,14 @@ export interface AssetOptions {
642649

643650
/**
644651
* An array of playback policy names that you want applied to this asset and
645-
* available through `playback_ids`. Options include: `"public"` (anyone with the
646-
* playback URL can stream the asset). And `"signed"` (an additional access token
647-
* is required to play the asset). If no playback_policy is set, the asset will
648-
* have no playback IDs and will therefore not be playable. For simplicity, a
649-
* single string name can be used in place of the array in the case of only one
650-
* playback policy.
652+
* available through `playback_ids`. Options include:
653+
*
654+
* - `"public"` (anyone with the playback URL can stream the asset).
655+
* - `"signed"` (an additional access token is required to play the asset).
656+
*
657+
* If no `playback_policy` is set, the asset will have no playback IDs and will
658+
* therefore not be playable. For simplicity, a single string name can be used in
659+
* place of the array in the case of only one playback policy.
651660
*/
652661
playback_policy?: Array<Shared.PlaybackPolicy>;
653662

@@ -661,6 +670,25 @@ export interface AssetOptions {
661670
}
662671

663672
export namespace AssetOptions {
673+
export interface AdvancedPlaybackPolicy {
674+
/**
675+
* The DRM configuration used by this playback ID. Must only be set when `policy`
676+
* is set to `drm`.
677+
*/
678+
drm_configuration_id?: string;
679+
680+
/**
681+
* - `public` playback IDs are accessible by constructing an HLS URL like
682+
* `https://stream.mux.com/${PLAYBACK_ID}`
683+
*
684+
* - `signed` playback IDs should be used with tokens
685+
* `https://stream.mux.com/${PLAYBACK_ID}?token={TOKEN}`. See
686+
* [Secure video playback](https://docs.mux.com/guides/secure-video-playback) for
687+
* details about creating tokens.
688+
*/
689+
policy?: Shared.PlaybackPolicy;
690+
}
691+
664692
/**
665693
* An array of objects that each describe an input file to be used to create the
666694
* asset. As a shortcut, `input` can also be a string URL for a file when only one
@@ -1264,6 +1292,13 @@ export interface AssetCreateParams {
12641292
*/
12651293
input: Array<AssetCreateParams.Input>;
12661294

1295+
/**
1296+
* An array of playback policy objects that you want applied to this asset and
1297+
* available through `playback_ids`. `advanced_playback_policy` must be used
1298+
* instead of `playback_policy` when creating a DRM playback ID.
1299+
*/
1300+
advanced_playback_policy?: Array<AssetCreateParams.AdvancedPlaybackPolicy>;
1301+
12671302
/**
12681303
* The encoding tier informs the cost, quality, and available platform features for
12691304
* the asset. By default the `smart` encoding tier is used.
@@ -1331,12 +1366,14 @@ export interface AssetCreateParams {
13311366

13321367
/**
13331368
* An array of playback policy names that you want applied to this asset and
1334-
* available through `playback_ids`. Options include: `"public"` (anyone with the
1335-
* playback URL can stream the asset). And `"signed"` (an additional access token
1336-
* is required to play the asset). If no playback_policy is set, the asset will
1337-
* have no playback IDs and will therefore not be playable. For simplicity, a
1338-
* single string name can be used in place of the array in the case of only one
1339-
* playback policy.
1369+
* available through `playback_ids`. Options include:
1370+
*
1371+
* - `"public"` (anyone with the playback URL can stream the asset).
1372+
* - `"signed"` (an additional access token is required to play the asset).
1373+
*
1374+
* If no `playback_policy` is set, the asset will have no playback IDs and will
1375+
* therefore not be playable. For simplicity, a single string name can be used in
1376+
* place of the array in the case of only one playback policy.
13401377
*/
13411378
playback_policy?: Array<Shared.PlaybackPolicy>;
13421379

@@ -1562,6 +1599,25 @@ export namespace AssetCreateParams {
15621599
width?: string;
15631600
}
15641601
}
1602+
1603+
export interface AdvancedPlaybackPolicy {
1604+
/**
1605+
* The DRM configuration used by this playback ID. Must only be set when `policy`
1606+
* is set to `drm`.
1607+
*/
1608+
drm_configuration_id?: string;
1609+
1610+
/**
1611+
* - `public` playback IDs are accessible by constructing an HLS URL like
1612+
* `https://stream.mux.com/${PLAYBACK_ID}`
1613+
*
1614+
* - `signed` playback IDs should be used with tokens
1615+
* `https://stream.mux.com/${PLAYBACK_ID}?token={TOKEN}`. See
1616+
* [Secure video playback](https://docs.mux.com/guides/secure-video-playback) for
1617+
* details about creating tokens.
1618+
*/
1619+
policy?: Shared.PlaybackPolicy;
1620+
}
15651621
}
15661622

15671623
export interface AssetUpdateParams {
@@ -1585,6 +1641,12 @@ export interface AssetListParams extends BasePageParams {
15851641
}
15861642

15871643
export interface AssetCreatePlaybackIDParams {
1644+
/**
1645+
* The DRM configuration used by this playback ID. Must only be set when `policy`
1646+
* is set to `drm`.
1647+
*/
1648+
drm_configuration_id?: string;
1649+
15881650
/**
15891651
* - `public` playback IDs are accessible by constructing an HLS URL like
15901652
* `https://stream.mux.com/${PLAYBACK_ID}`

src/resources/video/live-streams.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,13 @@ export interface SimulcastTarget {
571571
}
572572

573573
export interface LiveStreamCreateParams {
574+
/**
575+
* An array of playback policy objects that you want applied to this asset and
576+
* available through `playback_ids`. `advanced_playback_policy` must be used
577+
* instead of `playback_policy` when creating a DRM playback ID.
578+
*/
579+
advanced_playback_policy?: Array<LiveStreamCreateParams.AdvancedPlaybackPolicy>;
580+
574581
/**
575582
* Force the live stream to only process the audio track when the value is set to
576583
* true. Mux drops the video track if broadcasted.
@@ -683,6 +690,25 @@ export interface LiveStreamCreateParams {
683690
}
684691

685692
export namespace LiveStreamCreateParams {
693+
export interface AdvancedPlaybackPolicy {
694+
/**
695+
* The DRM configuration used by this playback ID. Must only be set when `policy`
696+
* is set to `drm`.
697+
*/
698+
drm_configuration_id?: string;
699+
700+
/**
701+
* - `public` playback IDs are accessible by constructing an HLS URL like
702+
* `https://stream.mux.com/${PLAYBACK_ID}`
703+
*
704+
* - `signed` playback IDs should be used with tokens
705+
* `https://stream.mux.com/${PLAYBACK_ID}?token={TOKEN}`. See
706+
* [Secure video playback](https://docs.mux.com/guides/secure-video-playback) for
707+
* details about creating tokens.
708+
*/
709+
policy?: Shared.PlaybackPolicy;
710+
}
711+
686712
export interface EmbeddedSubtitle {
687713
/**
688714
* CEA-608 caption channel to read data from.
@@ -867,6 +893,12 @@ export interface LiveStreamListParams extends BasePageParams {
867893
}
868894

869895
export interface LiveStreamCreatePlaybackIDParams {
896+
/**
897+
* The DRM configuration used by this playback ID. Must only be set when `policy`
898+
* is set to `drm`.
899+
*/
900+
drm_configuration_id?: string;
901+
870902
/**
871903
* - `public` playback IDs are accessible by constructing an HLS URL like
872904
* `https://stream.mux.com/${PLAYBACK_ID}`

tests/api-resources/video/assets.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ describe('resource assets', () => {
5050
passthrough: 'string',
5151
},
5252
],
53+
advanced_playback_policy: [
54+
{ policy: 'public', drm_configuration_id: 'string' },
55+
{ policy: 'public', drm_configuration_id: 'string' },
56+
{ policy: 'public', drm_configuration_id: 'string' },
57+
],
5358
encoding_tier: 'baseline',
5459
master_access: 'none',
5560
max_resolution_tier: '1080p',

tests/api-resources/video/uploads.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ describe('resource uploads', () => {
103103
},
104104
],
105105
playback_policy: ['public'],
106+
advanced_playback_policy: [
107+
{ policy: 'public', drm_configuration_id: 'string' },
108+
{ policy: 'public', drm_configuration_id: 'string' },
109+
{ policy: 'public', drm_configuration_id: 'string' },
110+
],
106111
per_title_encode: true,
107112
passthrough: 'string',
108113
mp4_support: 'capped-1080p',

0 commit comments

Comments
 (0)