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/SplitTestService.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 SplitTestService {
8
constructor(public readonly httpRequest: BaseHttpRequest) {}
9
10
/**
11
* @returns any error
12
* @throws ApiError
13
*/
14
public createSplitTest({
15
siteId,
16
branchTests,
17
}: {
18
siteId: string;
19
branchTests: {
20
branch_tests?: any;
21
};
22
}): CancelablePromise<{
23
code?: number;
24
message: string;
25
}> {
26
return this.httpRequest.request({
27
method: "POST",
28
url: "/sites/{site_id}/traffic_splits",
29
path: {
30
"site_id": siteId,
31
},
32
body: branchTests,
33
});
34
}
35
36
/**
37
* @returns any split_tests
38
* @throws ApiError
39
*/
40
public getSplitTests({
41
siteId,
42
}: {
43
siteId: string;
44
}): CancelablePromise<
45
Array<{
46
id?: string;
47
site_id?: string;
48
name?: string;
49
path?: string;
50
branches?: Array<any>;
51
active?: boolean;
52
created_at?: string;
53
updated_at?: string;
54
unpublished_at?: string;
55
}>
56
> {
57
return this.httpRequest.request({
58
method: "GET",
59
url: "/sites/{site_id}/traffic_splits",
60
path: {
61
"site_id": siteId,
62
},
63
});
64
}
65
66
/**
67
* @returns any error
68
* @throws ApiError
69
*/
70
public updateSplitTest({
71
siteId,
72
splitTestId,
73
branchTests,
74
}: {
75
siteId: string;
76
splitTestId: string;
77
branchTests: {
78
branch_tests?: any;
79
};
80
}): CancelablePromise<{
81
code?: number;
82
message: string;
83
}> {
84
return this.httpRequest.request({
85
method: "PUT",
86
url: "/sites/{site_id}/traffic_splits/{split_test_id}",
87
path: {
88
"site_id": siteId,
89
"split_test_id": splitTestId,
90
},
91
body: branchTests,
92
});
93
}
94
95
/**
96
* @returns any split_test
97
* @throws ApiError
98
*/
99
public getSplitTest({
100
siteId,
101
splitTestId,
102
}: {
103
siteId: string;
104
splitTestId: string;
105
}): CancelablePromise<{
106
id?: string;
107
site_id?: string;
108
name?: string;
109
path?: string;
110
branches?: Array<any>;
111
active?: boolean;
112
created_at?: string;
113
updated_at?: string;
114
unpublished_at?: string;
115
}> {
116
return this.httpRequest.request({
117
method: "GET",
118
url: "/sites/{site_id}/traffic_splits/{split_test_id}",
119
path: {
120
"site_id": siteId,
121
"split_test_id": splitTestId,
122
},
123
});
124
}
125
126
/**
127
* @returns any error
128
* @throws ApiError
129
*/
130
public enableSplitTest({
131
siteId,
132
splitTestId,
133
}: {
134
siteId: string;
135
splitTestId: string;
136
}): CancelablePromise<{
137
code?: number;
138
message: string;
139
}> {
140
return this.httpRequest.request({
141
method: "POST",
142
url: "/sites/{site_id}/traffic_splits/{split_test_id}/publish",
143
path: {
144
"site_id": siteId,
145
"split_test_id": splitTestId,
146
},
147
});
148
}
149
150
/**
151
* @returns any error
152
* @throws ApiError
153
*/
154
public disableSplitTest({
155
siteId,
156
splitTestId,
157
}: {
158
siteId: string;
159
splitTestId: string;
160
}): CancelablePromise<{
161
code?: number;
162
message: string;
163
}> {
164
return this.httpRequest.request({
165
method: "POST",
166
url: "/sites/{site_id}/traffic_splits/{split_test_id}/unpublish",
167
path: {
168
"site_id": siteId,
169
"split_test_id": splitTestId,
170
},
171
});
172
}
173
}
174
175