-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfile-links.ts
More file actions
87 lines (74 loc) · 2.26 KB
/
file-links.ts
File metadata and controls
87 lines (74 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
export class FileLinks extends APIResource {
/**
* Create a File Link
*
* @example
* ```ts
* const fileLink = await client.fileLinks.create({
* file_id: 'file_makxrc67oh9l6sg7w9yc',
* });
* ```
*/
create(body: FileLinkCreateParams, options?: RequestOptions): APIPromise<FileLink> {
return this._client.post('/file_links', { body, ...options });
}
}
/**
* File Links let you generate a URL that can be used to download a File.
*/
export interface FileLink {
/**
* The File Link identifier.
*/
id: string;
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the File
* Link was created.
*/
created_at: string;
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the File
* Link will expire.
*/
expires_at: string;
/**
* The identifier of the File the File Link points to.
*/
file_id: string;
/**
* The idempotency key you chose for this object. This value is unique across
* Increase and is used to ensure that a request is only processed once. Learn more
* about [idempotency](https://increase.com/documentation/idempotency-keys).
*/
idempotency_key: string | null;
/**
* A constant representing the object's type. For this resource it will always be
* `file_link`.
*/
type: 'file_link';
/**
* A URL where the File can be downloaded. The URL will expire after the
* `expires_at` time. This URL is unauthenticated and can be used to download the
* File without an Increase API key.
*/
unauthenticated_url: string;
}
export interface FileLinkCreateParams {
/**
* The File to create a File Link for.
*/
file_id: string;
/**
* The time at which the File Link will expire. The default is 1 hour from the time
* of the request. The maximum is 1 day from the time of the request.
*/
expires_at?: string;
[k: string]: unknown;
}
export declare namespace FileLinks {
export { type FileLink as FileLink, type FileLinkCreateParams as FileLinkCreateParams };
}