Skip to content

feat(api): OpenAPI spec update via Stainless API #426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-6aab47a3857727b9d53429d9b367c0fbd1e7d86e42e4c59335bab5770907d18c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-b1c7a231d90814e227c4a339a6760d1b05b04b874ffc7763affbad6a2c11d418.yml
86 changes: 74 additions & 12 deletions src/resources/video/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,13 @@ export namespace Asset {
}

export interface AssetOptions {
/**
* An array of playback policy objects that you want applied to this asset and
* available through `playback_ids`. `advanced_playback_policy` must be used
* instead of `playback_policy` when creating a DRM playback ID.
*/
advanced_playback_policy?: Array<AssetOptions.AdvancedPlaybackPolicy>;

/**
* The encoding tier informs the cost, quality, and available platform features for
* the asset. By default the `smart` encoding tier is used.
Expand Down Expand Up @@ -642,12 +649,14 @@ export interface AssetOptions {

/**
* An array of playback policy names that you want applied to this asset and
* available through `playback_ids`. Options include: `"public"` (anyone with the
* playback URL can stream the asset). And `"signed"` (an additional access token
* is required to play the asset). If no playback_policy is set, the asset will
* have no playback IDs and will therefore not be playable. For simplicity, a
* single string name can be used in place of the array in the case of only one
* playback policy.
* available through `playback_ids`. Options include:
*
* - `"public"` (anyone with the playback URL can stream the asset).
* - `"signed"` (an additional access token is required to play the asset).
*
* If no `playback_policy` is set, the asset will have no playback IDs and will
* therefore not be playable. For simplicity, a single string name can be used in
* place of the array in the case of only one playback policy.
*/
playback_policy?: Array<Shared.PlaybackPolicy>;

Expand All @@ -661,6 +670,25 @@ export interface AssetOptions {
}

export namespace AssetOptions {
export interface AdvancedPlaybackPolicy {
/**
* The DRM configuration used by this playback ID. Must only be set when `policy`
* is set to `drm`.
*/
drm_configuration_id?: string;

/**
* - `public` playback IDs are accessible by constructing an HLS URL like
* `https://stream.mux.com/${PLAYBACK_ID}`
*
* - `signed` playback IDs should be used with tokens
* `https://stream.mux.com/${PLAYBACK_ID}?token={TOKEN}`. See
* [Secure video playback](https://docs.mux.com/guides/secure-video-playback) for
* details about creating tokens.
*/
policy?: Shared.PlaybackPolicy;
}

/**
* An array of objects that each describe an input file to be used to create the
* asset. As a shortcut, `input` can also be a string URL for a file when only one
Expand Down Expand Up @@ -1264,6 +1292,13 @@ export interface AssetCreateParams {
*/
input: Array<AssetCreateParams.Input>;

/**
* An array of playback policy objects that you want applied to this asset and
* available through `playback_ids`. `advanced_playback_policy` must be used
* instead of `playback_policy` when creating a DRM playback ID.
*/
advanced_playback_policy?: Array<AssetCreateParams.AdvancedPlaybackPolicy>;

/**
* The encoding tier informs the cost, quality, and available platform features for
* the asset. By default the `smart` encoding tier is used.
Expand Down Expand Up @@ -1331,12 +1366,14 @@ export interface AssetCreateParams {

/**
* An array of playback policy names that you want applied to this asset and
* available through `playback_ids`. Options include: `"public"` (anyone with the
* playback URL can stream the asset). And `"signed"` (an additional access token
* is required to play the asset). If no playback_policy is set, the asset will
* have no playback IDs and will therefore not be playable. For simplicity, a
* single string name can be used in place of the array in the case of only one
* playback policy.
* available through `playback_ids`. Options include:
*
* - `"public"` (anyone with the playback URL can stream the asset).
* - `"signed"` (an additional access token is required to play the asset).
*
* If no `playback_policy` is set, the asset will have no playback IDs and will
* therefore not be playable. For simplicity, a single string name can be used in
* place of the array in the case of only one playback policy.
*/
playback_policy?: Array<Shared.PlaybackPolicy>;

Expand Down Expand Up @@ -1562,6 +1599,25 @@ export namespace AssetCreateParams {
width?: string;
}
}

export interface AdvancedPlaybackPolicy {
/**
* The DRM configuration used by this playback ID. Must only be set when `policy`
* is set to `drm`.
*/
drm_configuration_id?: string;

/**
* - `public` playback IDs are accessible by constructing an HLS URL like
* `https://stream.mux.com/${PLAYBACK_ID}`
*
* - `signed` playback IDs should be used with tokens
* `https://stream.mux.com/${PLAYBACK_ID}?token={TOKEN}`. See
* [Secure video playback](https://docs.mux.com/guides/secure-video-playback) for
* details about creating tokens.
*/
policy?: Shared.PlaybackPolicy;
}
}

export interface AssetUpdateParams {
Expand All @@ -1585,6 +1641,12 @@ export interface AssetListParams extends BasePageParams {
}

export interface AssetCreatePlaybackIDParams {
/**
* The DRM configuration used by this playback ID. Must only be set when `policy`
* is set to `drm`.
*/
drm_configuration_id?: string;

/**
* - `public` playback IDs are accessible by constructing an HLS URL like
* `https://stream.mux.com/${PLAYBACK_ID}`
Expand Down
32 changes: 32 additions & 0 deletions src/resources/video/live-streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,13 @@ export interface SimulcastTarget {
}

export interface LiveStreamCreateParams {
/**
* An array of playback policy objects that you want applied to this asset and
* available through `playback_ids`. `advanced_playback_policy` must be used
* instead of `playback_policy` when creating a DRM playback ID.
*/
advanced_playback_policy?: Array<LiveStreamCreateParams.AdvancedPlaybackPolicy>;

/**
* Force the live stream to only process the audio track when the value is set to
* true. Mux drops the video track if broadcasted.
Expand Down Expand Up @@ -683,6 +690,25 @@ export interface LiveStreamCreateParams {
}

export namespace LiveStreamCreateParams {
export interface AdvancedPlaybackPolicy {
/**
* The DRM configuration used by this playback ID. Must only be set when `policy`
* is set to `drm`.
*/
drm_configuration_id?: string;

/**
* - `public` playback IDs are accessible by constructing an HLS URL like
* `https://stream.mux.com/${PLAYBACK_ID}`
*
* - `signed` playback IDs should be used with tokens
* `https://stream.mux.com/${PLAYBACK_ID}?token={TOKEN}`. See
* [Secure video playback](https://docs.mux.com/guides/secure-video-playback) for
* details about creating tokens.
*/
policy?: Shared.PlaybackPolicy;
}

export interface EmbeddedSubtitle {
/**
* CEA-608 caption channel to read data from.
Expand Down Expand Up @@ -867,6 +893,12 @@ export interface LiveStreamListParams extends BasePageParams {
}

export interface LiveStreamCreatePlaybackIDParams {
/**
* The DRM configuration used by this playback ID. Must only be set when `policy`
* is set to `drm`.
*/
drm_configuration_id?: string;

/**
* - `public` playback IDs are accessible by constructing an HLS URL like
* `https://stream.mux.com/${PLAYBACK_ID}`
Expand Down
5 changes: 5 additions & 0 deletions tests/api-resources/video/assets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ describe('resource assets', () => {
passthrough: 'string',
},
],
advanced_playback_policy: [
{ policy: 'public', drm_configuration_id: 'string' },
{ policy: 'public', drm_configuration_id: 'string' },
{ policy: 'public', drm_configuration_id: 'string' },
],
encoding_tier: 'baseline',
master_access: 'none',
max_resolution_tier: '1080p',
Expand Down
5 changes: 5 additions & 0 deletions tests/api-resources/video/uploads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ describe('resource uploads', () => {
},
],
playback_policy: ['public'],
advanced_playback_policy: [
{ policy: 'public', drm_configuration_id: 'string' },
{ policy: 'public', drm_configuration_id: 'string' },
{ policy: 'public', drm_configuration_id: 'string' },
],
per_title_encode: true,
passthrough: 'string',
mp4_support: 'capped-1080p',
Expand Down