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/SnippetService.ts
6464 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 SnippetService {
8
constructor(public readonly httpRequest: BaseHttpRequest) {}
9
10
/**
11
* @returns any OK
12
* @throws ApiError
13
*/
14
public listSiteSnippets({
15
siteId,
16
}: {
17
siteId: string;
18
}): CancelablePromise<
19
Array<{
20
id?: number;
21
site_id?: string;
22
title?: string;
23
general?: string;
24
general_position?: string;
25
goal?: string;
26
goal_position?: string;
27
}>
28
> {
29
return this.httpRequest.request({
30
method: "GET",
31
url: "/sites/{site_id}/snippets",
32
path: {
33
"site_id": siteId,
34
},
35
});
36
}
37
38
/**
39
* @returns any error
40
* @throws ApiError
41
*/
42
public createSiteSnippet({
43
siteId,
44
snippet,
45
}: {
46
siteId: string;
47
snippet: {
48
id?: number;
49
site_id?: string;
50
title?: string;
51
general?: string;
52
general_position?: string;
53
goal?: string;
54
goal_position?: string;
55
};
56
}): CancelablePromise<{
57
code?: number;
58
message: string;
59
}> {
60
return this.httpRequest.request({
61
method: "POST",
62
url: "/sites/{site_id}/snippets",
63
path: {
64
"site_id": siteId,
65
},
66
body: snippet,
67
});
68
}
69
70
/**
71
* @returns any OK
72
* @throws ApiError
73
*/
74
public getSiteSnippet({
75
siteId,
76
snippetId,
77
}: {
78
siteId: string;
79
snippetId: string;
80
}): CancelablePromise<{
81
id?: number;
82
site_id?: string;
83
title?: string;
84
general?: string;
85
general_position?: string;
86
goal?: string;
87
goal_position?: string;
88
}> {
89
return this.httpRequest.request({
90
method: "GET",
91
url: "/sites/{site_id}/snippets/{snippet_id}",
92
path: {
93
"site_id": siteId,
94
"snippet_id": snippetId,
95
},
96
});
97
}
98
99
/**
100
* @returns any error
101
* @throws ApiError
102
*/
103
public updateSiteSnippet({
104
siteId,
105
snippetId,
106
snippet,
107
}: {
108
siteId: string;
109
snippetId: string;
110
snippet: {
111
id?: number;
112
site_id?: string;
113
title?: string;
114
general?: string;
115
general_position?: string;
116
goal?: string;
117
goal_position?: string;
118
};
119
}): CancelablePromise<{
120
code?: number;
121
message: string;
122
}> {
123
return this.httpRequest.request({
124
method: "PUT",
125
url: "/sites/{site_id}/snippets/{snippet_id}",
126
path: {
127
"site_id": siteId,
128
"snippet_id": snippetId,
129
},
130
body: snippet,
131
});
132
}
133
134
/**
135
* @returns any error
136
* @throws ApiError
137
*/
138
public deleteSiteSnippet({
139
siteId,
140
snippetId,
141
}: {
142
siteId: string;
143
snippetId: string;
144
}): CancelablePromise<{
145
code?: number;
146
message: string;
147
}> {
148
return this.httpRequest.request({
149
method: "DELETE",
150
url: "/sites/{site_id}/snippets/{snippet_id}",
151
path: {
152
"site_id": siteId,
153
"snippet_id": snippetId,
154
},
155
});
156
}
157
}
158
159