Skip to content

Commit

Permalink
[video] video_quality as a replacement for encoding_tier (#303) (#472)
Browse files Browse the repository at this point in the history
* Draft changes

* detabbify

* Address Phil's review comments
  • Loading branch information
Stainless Bot committed Sep 5, 2024
1 parent a464948 commit 6f2dae4
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 88
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-ecba5336919fc9783537b0901d6822cbcb49e160371c348a404bfcc748d09719.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-603174c84ed6d06302f3843b95c5281fa79df1e7428eb8d475525fb27fa48b38.yml
45 changes: 36 additions & 9 deletions src/resources/video/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,10 @@ export interface Asset {
created_at: string;

/**
* The encoding tier informs the cost, quality, and available platform features for
* the asset. By default the `smart` encoding tier is used.
* [See the guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
* @deprecated: This field is deprecated. Please use `video_quality` instead. The
* encoding tier informs the cost, quality, and available platform features for the
* asset. By default the `smart` encoding tier is used.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
encoding_tier: 'smart' | 'baseline';

Expand Down Expand Up @@ -384,6 +385,14 @@ export interface Asset {
* when the asset is created from a direct upload.
*/
upload_id?: string;

/**
* The video quality controls the cost, quality, and available platform features
* for the asset. By default the `plus` video quality is used. This field replaces
* the deprecated `encoding_tier` value.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
video_quality?: 'basic' | 'plus';
}

export namespace Asset {
Expand Down Expand Up @@ -573,9 +582,10 @@ export interface AssetOptions {
advanced_playback_policies?: 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.
* [See the guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
* @deprecated: This field is deprecated. Please use `video_quality` instead. The
* encoding tier informs the cost, quality, and available platform features for the
* asset. By default the `smart` encoding tier is used.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
encoding_tier?: 'smart' | 'baseline';

Expand Down Expand Up @@ -667,6 +677,14 @@ export interface AssetOptions {
* limited to 10 seconds, deleted after 24 hrs.
*/
test?: boolean;

/**
* The video quality controls the cost, quality, and available platform features
* for the asset. By default the `plus` video quality is used. This field replaces
* the deprecated `encoding_tier` value.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
video_quality?: 'basic' | 'plus';
}

export namespace AssetOptions {
Expand Down Expand Up @@ -1303,9 +1321,10 @@ export interface AssetCreateParams {
advanced_playback_policies?: 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.
* [See the guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
* This field is deprecated. Please use `video_quality` instead. The encoding tier
* informs the cost, quality, and available platform features for the asset. By
* default the `smart` encoding tier is used.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
encoding_tier?: 'smart' | 'baseline';

Expand Down Expand Up @@ -1387,6 +1406,14 @@ export interface AssetCreateParams {
* limited to 10 seconds, deleted after 24 hrs.
*/
test?: boolean;

/**
* The video quality controls the cost, quality, and available platform features
* for the asset. By default the `plus` video quality is used. This field replaces
* the deprecated `encoding_tier` value.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
video_quality?: 'basic' | 'plus';
}

export namespace AssetCreateParams {
Expand Down
10 changes: 9 additions & 1 deletion src/resources/video/delivery-usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ export interface DeliveryReport {
asset_duration: number;

/**
* @deprecated: This field is deprecated. Please use `asset_video_quality` instead.
* The encoding tier that the asset was ingested at.
* [See the encoding tiers guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
asset_encoding_tier: 'smart' | 'baseline';

Expand Down Expand Up @@ -76,6 +77,13 @@ export interface DeliveryReport {
*/
delivered_seconds_by_resolution: DeliveryReport.DeliveredSecondsByResolution;

/**
* The video quality that the asset was ingested at. This field replaces
* `asset_encoding_tier`.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
asset_video_quality?: 'basic' | 'plus';

/**
* If exists, time at which the asset was deleted. Measured in seconds since the
* Unix epoch.
Expand Down
14 changes: 14 additions & 0 deletions src/resources/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,13 @@ export namespace VideoDeliveryHighTrafficWebhookEvent {
*/
asset_duration?: number;

/**
* @deprecated: This field is deprecated. Please use `asset_video_quality` instead.
* The encoding tier that the asset was ingested at.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
asset_encoding_tier?: 'smart' | 'baseline';

/**
* Unique identifier for the asset.
*/
Expand All @@ -552,6 +559,13 @@ export namespace VideoDeliveryHighTrafficWebhookEvent {
*/
asset_state?: 'ready' | 'errored' | 'deleted';

/**
* The video quality that the asset was ingested at. This field replaces
* `asset_encoding_tier`.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
asset_video_quality?: 'basic' | 'plus';

/**
* Time at which the asset was created. Measured in seconds since the Unix epoch.
*/
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/video/assets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ describe('resource assets', () => {
per_title_encode: true,
playback_policy: ['public'],
test: true,
video_quality: 'basic',
});
});

Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/video/uploads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ describe('resource uploads', () => {
per_title_encode: true,
playback_policy: ['public'],
test: true,
video_quality: 'basic',
},
test: true,
timeout: 60,
Expand Down

0 comments on commit 6f2dae4

Please sign in to comment.