Skip to content

Commit f955e7b

Browse files
feat(api): api update
1 parent b8e9d0d commit f955e7b

File tree

6 files changed

+6
-153
lines changed

6 files changed

+6
-153
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1808
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3ff88658548577389a348a8beea805d3d0acd6ca847c4b612b4bb3b1aee28044.yml
3-
openapi_spec_hash: 817d5f31e18225d119be2e6b46ce52a4
1+
configured_endpoints: 1806
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-074798acdc9c8a7de78c8667d80911a6415eb6898ccd2f6dbb5636c810cbfe15.yml
3+
openapi_spec_hash: 096e417cb1f4c6e194ca24dfce55a976
44
config_hash: 03215e1e2607cd36fdac96c1ef923317

api.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4219,14 +4219,10 @@ Methods:
42194219

42204220
Types:
42214221

4222-
- <code><a href="./src/resources/stream/downloads.ts">DownloadCreateResponse</a></code>
4223-
- <code><a href="./src/resources/stream/downloads.ts">DownloadDeleteResponse</a></code>
42244222
- <code><a href="./src/resources/stream/downloads.ts">DownloadGetResponse</a></code>
42254223

42264224
Methods:
42274225

4228-
- <code title="post /accounts/{account_id}/stream/{identifier}/downloads">client.stream.downloads.<a href="./src/resources/stream/downloads.ts">create</a>(identifier, { ...params }) -> DownloadCreateResponse</code>
4229-
- <code title="delete /accounts/{account_id}/stream/{identifier}/downloads">client.stream.downloads.<a href="./src/resources/stream/downloads.ts">delete</a>(identifier, { ...params }) -> DownloadDeleteResponse</code>
42304226
- <code title="get /accounts/{account_id}/stream/{identifier}/downloads">client.stream.downloads.<a href="./src/resources/stream/downloads.ts">get</a>(identifier, { ...params }) -> DownloadGetResponse</code>
42314227

42324228
## Embed

src/resources/stream/downloads.ts

Lines changed: 1 addition & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,6 @@ import { APIResource } from '../../resource';
44
import * as Core from '../../core';
55

66
export class Downloads extends APIResource {
7-
/**
8-
* Creates a download for a video when a video is ready to view.
9-
*
10-
* @example
11-
* ```ts
12-
* const download = await client.stream.downloads.create(
13-
* 'ea95132c15732412d22c1476fa83f27a',
14-
* {
15-
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
16-
* body: {},
17-
* },
18-
* );
19-
* ```
20-
*/
21-
create(
22-
identifier: string,
23-
params: DownloadCreateParams,
24-
options?: Core.RequestOptions,
25-
): Core.APIPromise<DownloadCreateResponse> {
26-
const { account_id, body } = params;
27-
return (
28-
this._client.post(`/accounts/${account_id}/stream/${identifier}/downloads`, {
29-
body: body,
30-
...options,
31-
}) as Core.APIPromise<{ result: DownloadCreateResponse }>
32-
)._thenUnwrap((obj) => obj.result);
33-
}
34-
35-
/**
36-
* Delete the downloads for a video.
37-
*
38-
* @example
39-
* ```ts
40-
* const download = await client.stream.downloads.delete(
41-
* 'ea95132c15732412d22c1476fa83f27a',
42-
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
43-
* );
44-
* ```
45-
*/
46-
delete(
47-
identifier: string,
48-
params: DownloadDeleteParams,
49-
options?: Core.RequestOptions,
50-
): Core.APIPromise<DownloadDeleteResponse> {
51-
const { account_id } = params;
52-
return (
53-
this._client.delete(
54-
`/accounts/${account_id}/stream/${identifier}/downloads`,
55-
options,
56-
) as Core.APIPromise<{ result: DownloadDeleteResponse }>
57-
)._thenUnwrap((obj) => obj.result);
58-
}
59-
607
/**
618
* Lists the downloads created for a video.
629
*
@@ -82,31 +29,8 @@ export class Downloads extends APIResource {
8229
}
8330
}
8431

85-
export type DownloadCreateResponse = unknown;
86-
87-
export type DownloadDeleteResponse = string;
88-
8932
export type DownloadGetResponse = unknown;
9033

91-
export interface DownloadCreateParams {
92-
/**
93-
* Path param: Identifier.
94-
*/
95-
account_id: string;
96-
97-
/**
98-
* Body param:
99-
*/
100-
body: unknown;
101-
}
102-
103-
export interface DownloadDeleteParams {
104-
/**
105-
* Identifier.
106-
*/
107-
account_id: string;
108-
}
109-
11034
export interface DownloadGetParams {
11135
/**
11236
* Identifier.
@@ -115,12 +39,5 @@ export interface DownloadGetParams {
11539
}
11640

11741
export declare namespace Downloads {
118-
export {
119-
type DownloadCreateResponse as DownloadCreateResponse,
120-
type DownloadDeleteResponse as DownloadDeleteResponse,
121-
type DownloadGetResponse as DownloadGetResponse,
122-
type DownloadCreateParams as DownloadCreateParams,
123-
type DownloadDeleteParams as DownloadDeleteParams,
124-
type DownloadGetParams as DownloadGetParams,
125-
};
42+
export { type DownloadGetResponse as DownloadGetResponse, type DownloadGetParams as DownloadGetParams };
12643
}

src/resources/stream/index.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,7 @@ export {
1818
type DirectUploadCreateResponse,
1919
type DirectUploadCreateParams,
2020
} from './direct-upload';
21-
export {
22-
Downloads,
23-
type DownloadCreateResponse,
24-
type DownloadDeleteResponse,
25-
type DownloadGetResponse,
26-
type DownloadCreateParams,
27-
type DownloadDeleteParams,
28-
type DownloadGetParams,
29-
} from './downloads';
21+
export { Downloads, type DownloadGetResponse, type DownloadGetParams } from './downloads';
3022
export { Embed, type EmbedGetResponse, type EmbedGetParams } from './embed';
3123
export {
3224
KeyGetResponsesSinglePage,

src/resources/stream/stream.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,7 @@ import { Copy, CopyCreateParams } from './copy';
2020
import * as DirectUploadAPI from './direct-upload';
2121
import { DirectUpload, DirectUploadCreateParams, DirectUploadCreateResponse } from './direct-upload';
2222
import * as DownloadsAPI from './downloads';
23-
import {
24-
DownloadCreateParams,
25-
DownloadCreateResponse,
26-
DownloadDeleteParams,
27-
DownloadDeleteResponse,
28-
DownloadGetParams,
29-
DownloadGetResponse,
30-
Downloads,
31-
} from './downloads';
23+
import { DownloadGetParams, DownloadGetResponse, Downloads } from './downloads';
3224
import * as EmbedAPI from './embed';
3325
import { Embed, EmbedGetParams, EmbedGetResponse } from './embed';
3426
import * as KeysAPI from './keys';
@@ -702,11 +694,7 @@ export declare namespace Stream {
702694

703695
export {
704696
Downloads as Downloads,
705-
type DownloadCreateResponse as DownloadCreateResponse,
706-
type DownloadDeleteResponse as DownloadDeleteResponse,
707697
type DownloadGetResponse as DownloadGetResponse,
708-
type DownloadCreateParams as DownloadCreateParams,
709-
type DownloadDeleteParams as DownloadDeleteParams,
710698
type DownloadGetParams as DownloadGetParams,
711699
};
712700

tests/api-resources/stream/downloads.test.ts

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,6 @@ const client = new Cloudflare({
1010
});
1111

1212
describe('resource downloads', () => {
13-
test('create: only required params', async () => {
14-
const responsePromise = client.stream.downloads.create('ea95132c15732412d22c1476fa83f27a', {
15-
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
16-
body: {},
17-
});
18-
const rawResponse = await responsePromise.asResponse();
19-
expect(rawResponse).toBeInstanceOf(Response);
20-
const response = await responsePromise;
21-
expect(response).not.toBeInstanceOf(Response);
22-
const dataAndResponse = await responsePromise.withResponse();
23-
expect(dataAndResponse.data).toBe(response);
24-
expect(dataAndResponse.response).toBe(rawResponse);
25-
});
26-
27-
test('create: required and optional params', async () => {
28-
const response = await client.stream.downloads.create('ea95132c15732412d22c1476fa83f27a', {
29-
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
30-
body: {},
31-
});
32-
});
33-
34-
test('delete: only required params', async () => {
35-
const responsePromise = client.stream.downloads.delete('ea95132c15732412d22c1476fa83f27a', {
36-
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
37-
});
38-
const rawResponse = await responsePromise.asResponse();
39-
expect(rawResponse).toBeInstanceOf(Response);
40-
const response = await responsePromise;
41-
expect(response).not.toBeInstanceOf(Response);
42-
const dataAndResponse = await responsePromise.withResponse();
43-
expect(dataAndResponse.data).toBe(response);
44-
expect(dataAndResponse.response).toBe(rawResponse);
45-
});
46-
47-
test('delete: required and optional params', async () => {
48-
const response = await client.stream.downloads.delete('ea95132c15732412d22c1476fa83f27a', {
49-
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
50-
});
51-
});
52-
5313
test('get: only required params', async () => {
5414
const responsePromise = client.stream.downloads.get('ea95132c15732412d22c1476fa83f27a', {
5515
account_id: '023e105f4ecef8ad9ca31a8372d0c353',

0 commit comments

Comments
 (0)