Skip to content

Commit db231d0

Browse files
chore(examples): minor formatting changes (#469)
1 parent 4b34b4e commit db231d0

File tree

4 files changed

+96
-96
lines changed

4 files changed

+96
-96
lines changed

tests/api-resources/data/metrics.test.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('resource metrics', () => {
4545
});
4646

4747
test('getInsights', async () => {
48-
const responsePromise = client.data.metrics.getInsights('video_startup_time');
48+
const responsePromise = client.data.metrics.getInsights('aggregate_startup_time');
4949
const rawResponse = await responsePromise.asResponse();
5050
expect(rawResponse).toBeInstanceOf(Response);
5151
const response = await responsePromise;
@@ -58,15 +58,15 @@ describe('resource metrics', () => {
5858
test('getInsights: request options instead of params are passed correctly', async () => {
5959
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
6060
await expect(
61-
client.data.metrics.getInsights('video_startup_time', { path: '/_stainless_unknown_path' }),
61+
client.data.metrics.getInsights('aggregate_startup_time', { path: '/_stainless_unknown_path' }),
6262
).rejects.toThrow(Mux.NotFoundError);
6363
});
6464

6565
test('getInsights: request options and params are passed correctly', async () => {
6666
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
6767
await expect(
6868
client.data.metrics.getInsights(
69-
'video_startup_time',
69+
'aggregate_startup_time',
7070
{
7171
filters: ['string', 'string', 'string'],
7272
measurement: '95th',
@@ -80,7 +80,7 @@ describe('resource metrics', () => {
8080
});
8181

8282
test('getOverallValues', async () => {
83-
const responsePromise = client.data.metrics.getOverallValues('video_startup_time');
83+
const responsePromise = client.data.metrics.getOverallValues('aggregate_startup_time');
8484
const rawResponse = await responsePromise.asResponse();
8585
expect(rawResponse).toBeInstanceOf(Response);
8686
const response = await responsePromise;
@@ -93,15 +93,15 @@ describe('resource metrics', () => {
9393
test('getOverallValues: request options instead of params are passed correctly', async () => {
9494
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
9595
await expect(
96-
client.data.metrics.getOverallValues('video_startup_time', { path: '/_stainless_unknown_path' }),
96+
client.data.metrics.getOverallValues('aggregate_startup_time', { path: '/_stainless_unknown_path' }),
9797
).rejects.toThrow(Mux.NotFoundError);
9898
});
9999

100100
test('getOverallValues: request options and params are passed correctly', async () => {
101101
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
102102
await expect(
103103
client.data.metrics.getOverallValues(
104-
'video_startup_time',
104+
'aggregate_startup_time',
105105
{
106106
filters: ['string', 'string', 'string'],
107107
measurement: '95th',
@@ -114,7 +114,7 @@ describe('resource metrics', () => {
114114
});
115115

116116
test('getTimeseries', async () => {
117-
const responsePromise = client.data.metrics.getTimeseries('video_startup_time');
117+
const responsePromise = client.data.metrics.getTimeseries('aggregate_startup_time');
118118
const rawResponse = await responsePromise.asResponse();
119119
expect(rawResponse).toBeInstanceOf(Response);
120120
const response = await responsePromise;
@@ -127,15 +127,15 @@ describe('resource metrics', () => {
127127
test('getTimeseries: request options instead of params are passed correctly', async () => {
128128
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
129129
await expect(
130-
client.data.metrics.getTimeseries('video_startup_time', { path: '/_stainless_unknown_path' }),
130+
client.data.metrics.getTimeseries('aggregate_startup_time', { path: '/_stainless_unknown_path' }),
131131
).rejects.toThrow(Mux.NotFoundError);
132132
});
133133

134134
test('getTimeseries: request options and params are passed correctly', async () => {
135135
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
136136
await expect(
137137
client.data.metrics.getTimeseries(
138-
'video_startup_time',
138+
'aggregate_startup_time',
139139
{
140140
filters: ['string', 'string', 'string'],
141141
group_by: 'minute',
@@ -150,7 +150,7 @@ describe('resource metrics', () => {
150150
});
151151

152152
test('listBreakdownValues', async () => {
153-
const responsePromise = client.data.metrics.listBreakdownValues('video_startup_time');
153+
const responsePromise = client.data.metrics.listBreakdownValues('aggregate_startup_time');
154154
const rawResponse = await responsePromise.asResponse();
155155
expect(rawResponse).toBeInstanceOf(Response);
156156
const response = await responsePromise;
@@ -163,15 +163,15 @@ describe('resource metrics', () => {
163163
test('listBreakdownValues: request options instead of params are passed correctly', async () => {
164164
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
165165
await expect(
166-
client.data.metrics.listBreakdownValues('video_startup_time', { path: '/_stainless_unknown_path' }),
166+
client.data.metrics.listBreakdownValues('aggregate_startup_time', { path: '/_stainless_unknown_path' }),
167167
).rejects.toThrow(Mux.NotFoundError);
168168
});
169169

170170
test('listBreakdownValues: request options and params are passed correctly', async () => {
171171
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
172172
await expect(
173173
client.data.metrics.listBreakdownValues(
174-
'video_startup_time',
174+
'aggregate_startup_time',
175175
{
176176
filters: ['string', 'string', 'string'],
177177
group_by: 'asn',

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

+23-23
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,37 @@ describe('resource assets', () => {
2525
const response = await client.video.assets.create({
2626
input: [
2727
{
28-
url: 'https://muxed.s3.amazonaws.com/leds.mp4',
28+
closed_captions: true,
29+
end_time: 0,
30+
generated_subtitles: [
31+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
32+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
33+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
34+
],
35+
language_code: 'language_code',
36+
name: 'name',
2937
overlay_settings: {
30-
vertical_align: 'top',
31-
vertical_margin: 'vertical_margin',
38+
height: 'height',
3239
horizontal_align: 'left',
3340
horizontal_margin: 'horizontal_margin',
34-
width: 'width',
35-
height: 'height',
3641
opacity: 'opacity',
42+
vertical_align: 'top',
43+
vertical_margin: 'vertical_margin',
44+
width: 'width',
3745
},
38-
generated_subtitles: [
39-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
40-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
41-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
42-
],
46+
passthrough: 'passthrough',
4347
start_time: 0,
44-
end_time: 0,
45-
type: 'video',
4648
text_type: 'subtitles',
47-
language_code: 'language_code',
48-
name: 'name',
49-
closed_captions: true,
50-
passthrough: 'passthrough',
49+
type: 'video',
50+
url: 'https://muxed.s3.amazonaws.com/leds.mp4',
5151
},
5252
],
5353
advanced_playback_policies: [
54-
{ policy: 'public', drm_configuration_id: 'drm_configuration_id' },
55-
{ policy: 'public', drm_configuration_id: 'drm_configuration_id' },
56-
{ policy: 'public', drm_configuration_id: 'drm_configuration_id' },
54+
{ drm_configuration_id: 'drm_configuration_id', policy: 'public' },
55+
{ drm_configuration_id: 'drm_configuration_id', policy: 'public' },
56+
{ drm_configuration_id: 'drm_configuration_id', policy: 'public' },
5757
],
58-
encoding_tier: 'baseline',
58+
encoding_tier: 'smart',
5959
master_access: 'none',
6060
max_resolution_tier: '1080p',
6161
mp4_support: 'none',
@@ -232,7 +232,7 @@ describe('resource assets', () => {
232232
test('generateSubtitles: required and optional params', async () => {
233233
const response = await client.video.assets.generateSubtitles('ASSET_ID', 'TRACK_ID', {
234234
generated_subtitles: [
235-
{ name: 'English (generated)', passthrough: 'English (generated)', language_code: 'en' },
235+
{ language_code: 'en', name: 'English (generated)', passthrough: 'English (generated)' },
236236
],
237237
});
238238
});
@@ -291,7 +291,7 @@ describe('resource assets', () => {
291291
});
292292

293293
test('updateMP4Support: only required params', async () => {
294-
const responsePromise = client.video.assets.updateMP4Support('ASSET_ID', { mp4_support: 'capped-1080p' });
294+
const responsePromise = client.video.assets.updateMP4Support('ASSET_ID', { mp4_support: 'standard' });
295295
const rawResponse = await responsePromise.asResponse();
296296
expect(rawResponse).toBeInstanceOf(Response);
297297
const response = await responsePromise;
@@ -302,6 +302,6 @@ describe('resource assets', () => {
302302
});
303303

304304
test('updateMP4Support: required and optional params', async () => {
305-
const response = await client.video.assets.updateMP4Support('ASSET_ID', { mp4_support: 'capped-1080p' });
305+
const response = await client.video.assets.updateMP4Support('ASSET_ID', { mp4_support: 'standard' });
306306
});
307307
});

tests/api-resources/video/playback-restrictions.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('resource playbackRestrictions', () => {
2727
test('create: required and optional params', async () => {
2828
const response = await client.video.playbackRestrictions.create({
2929
referrer: { allowed_domains: ['*.example.com'], allow_no_referrer: true },
30-
user_agent: { allow_no_user_agent: false, allow_high_risk_user_agent: false },
30+
user_agent: { allow_high_risk_user_agent: false, allow_no_user_agent: false },
3131
});
3232
});
3333

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

+60-60
Original file line numberDiff line numberDiff line change
@@ -25,97 +25,97 @@ describe('resource uploads', () => {
2525
const response = await client.video.uploads.create({
2626
cors_origin: 'https://example.com/',
2727
new_asset_settings: {
28+
advanced_playback_policies: [
29+
{ drm_configuration_id: 'drm_configuration_id', policy: 'public' },
30+
{ drm_configuration_id: 'drm_configuration_id', policy: 'public' },
31+
{ drm_configuration_id: 'drm_configuration_id', policy: 'public' },
32+
],
33+
encoding_tier: 'smart',
2834
input: [
2935
{
30-
url: 'url',
36+
closed_captions: true,
37+
end_time: 0,
38+
generated_subtitles: [
39+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
40+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
41+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
42+
],
43+
language_code: 'language_code',
44+
name: 'name',
3145
overlay_settings: {
32-
vertical_align: 'top',
33-
vertical_margin: 'vertical_margin',
46+
height: 'height',
3447
horizontal_align: 'left',
3548
horizontal_margin: 'horizontal_margin',
36-
width: 'width',
37-
height: 'height',
3849
opacity: 'opacity',
50+
vertical_align: 'top',
51+
vertical_margin: 'vertical_margin',
52+
width: 'width',
3953
},
40-
generated_subtitles: [
41-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
42-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
43-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
44-
],
54+
passthrough: 'passthrough',
4555
start_time: 0,
46-
end_time: 0,
47-
type: 'video',
4856
text_type: 'subtitles',
49-
language_code: 'language_code',
50-
name: 'name',
51-
closed_captions: true,
52-
passthrough: 'passthrough',
57+
type: 'video',
58+
url: 'url',
5359
},
5460
{
55-
url: 'url',
61+
closed_captions: true,
62+
end_time: 0,
63+
generated_subtitles: [
64+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
65+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
66+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
67+
],
68+
language_code: 'language_code',
69+
name: 'name',
5670
overlay_settings: {
57-
vertical_align: 'top',
58-
vertical_margin: 'vertical_margin',
71+
height: 'height',
5972
horizontal_align: 'left',
6073
horizontal_margin: 'horizontal_margin',
61-
width: 'width',
62-
height: 'height',
6374
opacity: 'opacity',
75+
vertical_align: 'top',
76+
vertical_margin: 'vertical_margin',
77+
width: 'width',
6478
},
65-
generated_subtitles: [
66-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
67-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
68-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
69-
],
79+
passthrough: 'passthrough',
7080
start_time: 0,
71-
end_time: 0,
72-
type: 'video',
7381
text_type: 'subtitles',
74-
language_code: 'language_code',
75-
name: 'name',
76-
closed_captions: true,
77-
passthrough: 'passthrough',
82+
type: 'video',
83+
url: 'url',
7884
},
7985
{
80-
url: 'url',
86+
closed_captions: true,
87+
end_time: 0,
88+
generated_subtitles: [
89+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
90+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
91+
{ language_code: 'en', name: 'name', passthrough: 'passthrough' },
92+
],
93+
language_code: 'language_code',
94+
name: 'name',
8195
overlay_settings: {
82-
vertical_align: 'top',
83-
vertical_margin: 'vertical_margin',
96+
height: 'height',
8497
horizontal_align: 'left',
8598
horizontal_margin: 'horizontal_margin',
86-
width: 'width',
87-
height: 'height',
8899
opacity: 'opacity',
100+
vertical_align: 'top',
101+
vertical_margin: 'vertical_margin',
102+
width: 'width',
89103
},
90-
generated_subtitles: [
91-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
92-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
93-
{ name: 'name', passthrough: 'passthrough', language_code: 'en' },
94-
],
104+
passthrough: 'passthrough',
95105
start_time: 0,
96-
end_time: 0,
97-
type: 'video',
98106
text_type: 'subtitles',
99-
language_code: 'language_code',
100-
name: 'name',
101-
closed_captions: true,
102-
passthrough: 'passthrough',
107+
type: 'video',
108+
url: 'url',
103109
},
104110
],
105-
playback_policy: ['public'],
106-
advanced_playback_policies: [
107-
{ policy: 'public', drm_configuration_id: 'drm_configuration_id' },
108-
{ policy: 'public', drm_configuration_id: 'drm_configuration_id' },
109-
{ policy: 'public', drm_configuration_id: 'drm_configuration_id' },
110-
],
111-
per_title_encode: true,
112-
passthrough: 'passthrough',
113-
mp4_support: 'capped-1080p',
114-
normalize_audio: true,
115111
master_access: 'none',
116-
test: true,
117112
max_resolution_tier: '1080p',
118-
encoding_tier: 'smart',
113+
mp4_support: 'none',
114+
normalize_audio: true,
115+
passthrough: 'passthrough',
116+
per_title_encode: true,
117+
playback_policy: ['public'],
118+
test: true,
119119
},
120120
test: true,
121121
timeout: 60,

0 commit comments

Comments
 (0)