Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/publish/netlify/api/services/AssetService.ts
6465 views
1
/* istanbul ignore file */
2
/* tslint:disable */
3
/* eslint-disable */
4
import type { CancelablePromise } from "../core/CancelablePromise.ts";
5
import type { BaseHttpRequest } from "../core/BaseHttpRequest.ts";
6
7
export class AssetService {
8
constructor(public readonly httpRequest: BaseHttpRequest) {}
9
10
/**
11
* @returns any OK
12
* @throws ApiError
13
*/
14
public listSiteAssets({
15
siteId,
16
}: {
17
siteId: string;
18
}): CancelablePromise<
19
Array<{
20
id?: string;
21
site_id?: string;
22
creator_id?: string;
23
name?: string;
24
state?: string;
25
content_type?: string;
26
url?: string;
27
key?: string;
28
visibility?: string;
29
size?: number;
30
created_at?: string;
31
updated_at?: string;
32
}>
33
> {
34
return this.httpRequest.request({
35
method: "GET",
36
url: "/sites/{site_id}/assets",
37
path: {
38
"site_id": siteId,
39
},
40
});
41
}
42
43
/**
44
* @returns any error
45
* @throws ApiError
46
*/
47
public createSiteAsset({
48
siteId,
49
name,
50
size,
51
contentType,
52
visibility,
53
}: {
54
siteId: string;
55
name: string;
56
size: number;
57
contentType: string;
58
visibility?: string;
59
}): CancelablePromise<{
60
code?: number;
61
message: string;
62
}> {
63
return this.httpRequest.request({
64
method: "POST",
65
url: "/sites/{site_id}/assets",
66
path: {
67
"site_id": siteId,
68
},
69
query: {
70
"name": name,
71
"size": size,
72
"content_type": contentType,
73
"visibility": visibility,
74
},
75
});
76
}
77
78
/**
79
* @returns any OK
80
* @throws ApiError
81
*/
82
public getSiteAssetInfo({
83
siteId,
84
assetId,
85
}: {
86
siteId: string;
87
assetId: string;
88
}): CancelablePromise<{
89
id?: string;
90
site_id?: string;
91
creator_id?: string;
92
name?: string;
93
state?: string;
94
content_type?: string;
95
url?: string;
96
key?: string;
97
visibility?: string;
98
size?: number;
99
created_at?: string;
100
updated_at?: string;
101
}> {
102
return this.httpRequest.request({
103
method: "GET",
104
url: "/sites/{site_id}/assets/{asset_id}",
105
path: {
106
"site_id": siteId,
107
"asset_id": assetId,
108
},
109
});
110
}
111
112
/**
113
* @returns any Updated
114
* @throws ApiError
115
*/
116
public updateSiteAsset({
117
siteId,
118
assetId,
119
state,
120
}: {
121
siteId: string;
122
assetId: string;
123
state: string;
124
}): CancelablePromise<{
125
id?: string;
126
site_id?: string;
127
creator_id?: string;
128
name?: string;
129
state?: string;
130
content_type?: string;
131
url?: string;
132
key?: string;
133
visibility?: string;
134
size?: number;
135
created_at?: string;
136
updated_at?: string;
137
}> {
138
return this.httpRequest.request({
139
method: "PUT",
140
url: "/sites/{site_id}/assets/{asset_id}",
141
path: {
142
"site_id": siteId,
143
"asset_id": assetId,
144
},
145
query: {
146
"state": state,
147
},
148
});
149
}
150
151
/**
152
* @returns any error
153
* @throws ApiError
154
*/
155
public deleteSiteAsset({
156
siteId,
157
assetId,
158
}: {
159
siteId: string;
160
assetId: string;
161
}): CancelablePromise<{
162
code?: number;
163
message: string;
164
}> {
165
return this.httpRequest.request({
166
method: "DELETE",
167
url: "/sites/{site_id}/assets/{asset_id}",
168
path: {
169
"site_id": siteId,
170
"asset_id": assetId,
171
},
172
});
173
}
174
}
175
176