@scaleway/sdk-jobs 2.6.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/license.md +3 -0
- package/dist/metadata.gen.d.ts +6 -6
- package/dist/metadata.gen.js +6 -2
- package/dist/v1alpha1/api.gen.js +91 -184
- package/dist/v1alpha1/content.gen.js +1 -1
- package/dist/v1alpha1/marshalling.gen.js +22 -22
- package/dist/v1alpha1/metadata.gen.js +1 -1
- package/dist/v1alpha1/validation-rules.gen.js +10 -10
- package/dist/v1alpha2/api.gen.js +118 -240
- package/dist/v1alpha2/content.gen.js +1 -1
- package/dist/v1alpha2/marshalling.gen.js +31 -31
- package/dist/v1alpha2/metadata.gen.js +1 -1
- package/dist/v1alpha2/validation-rules.gen.js +16 -16
- package/package.json +15 -14
- package/LICENSE +0 -191
- package/dist/metadata.gen.json +0 -6
- package/dist/metadata2.gen.js +0 -8
package/dist/v1alpha2/api.gen.js
CHANGED
|
@@ -1,252 +1,130 @@
|
|
|
1
1
|
import { marshalCreateJobDefinitionRequest, marshalCreateSecretsRequest, marshalCreateTriggerRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateSecretRequest, marshalUpdateTriggerRequest, unmarshalCreateSecretsResponse, unmarshalJobDefinition, unmarshalJobLimits, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobResourcesResponse, unmarshalListJobRunsResponse, unmarshalListSecretsResponse, unmarshalListTriggersResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse, unmarshalTrigger } from "./marshalling.gen.js";
|
|
2
2
|
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
|
|
3
3
|
//#region src/v1alpha2/api.gen.ts
|
|
4
|
-
|
|
4
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
5
5
|
/**
|
|
6
6
|
* Serverless Jobs API.
|
|
7
7
|
|
|
8
8
|
This API allows you to manage your Serverless Jobs.
|
|
9
9
|
*/
|
|
10
10
|
var API = class extends API$1 {
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
body: JSON.stringify(marshalCreateSecretsRequest(request, this.client.settings)),
|
|
129
|
-
headers: jsonContentHeaders,
|
|
130
|
-
method: "POST",
|
|
131
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`
|
|
132
|
-
}, unmarshalCreateSecretsResponse);
|
|
133
|
-
/**
|
|
134
|
-
* Get a secret references within a job definition.
|
|
135
|
-
*
|
|
136
|
-
* @param request - The request {@link GetSecretRequest}
|
|
137
|
-
* @returns A Promise of Secret
|
|
138
|
-
*/
|
|
139
|
-
getSecret = (request) => this.client.fetch({
|
|
140
|
-
method: "GET",
|
|
141
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
142
|
-
}, unmarshalSecret);
|
|
143
|
-
/**
|
|
144
|
-
* List secrets references within a job definition.
|
|
145
|
-
*
|
|
146
|
-
* @param request - The request {@link ListSecretsRequest}
|
|
147
|
-
* @returns A Promise of ListSecretsResponse
|
|
148
|
-
*/
|
|
149
|
-
listSecrets = (request) => this.client.fetch({
|
|
150
|
-
method: "GET",
|
|
151
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`,
|
|
152
|
-
urlParams: urlParams(["job_definition_id", request.jobDefinitionId])
|
|
153
|
-
}, unmarshalListSecretsResponse);
|
|
154
|
-
/**
|
|
155
|
-
* Update a secret reference within a job definition.
|
|
156
|
-
*
|
|
157
|
-
* @param request - The request {@link UpdateSecretRequest}
|
|
158
|
-
* @returns A Promise of Secret
|
|
159
|
-
*/
|
|
160
|
-
updateSecret = (request) => this.client.fetch({
|
|
161
|
-
body: JSON.stringify(marshalUpdateSecretRequest(request, this.client.settings)),
|
|
162
|
-
headers: jsonContentHeaders,
|
|
163
|
-
method: "PATCH",
|
|
164
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
165
|
-
}, unmarshalSecret);
|
|
166
|
-
/**
|
|
167
|
-
* Delete a secret reference within a job definition.
|
|
168
|
-
*
|
|
169
|
-
* @param request - The request {@link DeleteSecretRequest}
|
|
170
|
-
*/
|
|
171
|
-
deleteSecret = (request) => this.client.fetch({
|
|
172
|
-
method: "DELETE",
|
|
173
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
174
|
-
});
|
|
175
|
-
/**
|
|
176
|
-
* Create a trigger.
|
|
177
|
-
*
|
|
178
|
-
* @param request - The request {@link CreateTriggerRequest}
|
|
179
|
-
* @returns A Promise of Trigger
|
|
180
|
-
*/
|
|
181
|
-
createTrigger = (request) => this.client.fetch({
|
|
182
|
-
body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
|
|
183
|
-
headers: jsonContentHeaders,
|
|
184
|
-
method: "POST",
|
|
185
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`
|
|
186
|
-
}, unmarshalTrigger);
|
|
187
|
-
/**
|
|
188
|
-
* Get a trigger.
|
|
189
|
-
*
|
|
190
|
-
* @param request - The request {@link GetTriggerRequest}
|
|
191
|
-
* @returns A Promise of Trigger
|
|
192
|
-
*/
|
|
193
|
-
getTrigger = (request) => this.client.fetch({
|
|
194
|
-
method: "GET",
|
|
195
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
|
|
196
|
-
}, unmarshalTrigger);
|
|
197
|
-
pageOfListTriggers = (request) => this.client.fetch({
|
|
198
|
-
method: "GET",
|
|
199
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`,
|
|
200
|
-
urlParams: urlParams(["job_definition_id", request.jobDefinitionId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
201
|
-
}, unmarshalListTriggersResponse);
|
|
202
|
-
/**
|
|
203
|
-
* List triggers of a job definition.
|
|
204
|
-
*
|
|
205
|
-
* @param request - The request {@link ListTriggersRequest}
|
|
206
|
-
* @returns A Promise of ListTriggersResponse
|
|
207
|
-
*/
|
|
208
|
-
listTriggers = (request) => enrichForPagination("triggers", this.pageOfListTriggers, request);
|
|
209
|
-
/**
|
|
210
|
-
* Update a trigger.
|
|
211
|
-
*
|
|
212
|
-
* @param request - The request {@link UpdateTriggerRequest}
|
|
213
|
-
* @returns A Promise of Trigger
|
|
214
|
-
*/
|
|
215
|
-
updateTrigger = (request) => this.client.fetch({
|
|
216
|
-
body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
|
|
217
|
-
headers: jsonContentHeaders,
|
|
218
|
-
method: "PATCH",
|
|
219
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
|
|
220
|
-
}, unmarshalTrigger);
|
|
221
|
-
/**
|
|
222
|
-
* Delete a trigger.
|
|
223
|
-
*
|
|
224
|
-
* @param request - The request {@link DeleteTriggerRequest}
|
|
225
|
-
*/
|
|
226
|
-
deleteTrigger = (request) => this.client.fetch({
|
|
227
|
-
method: "DELETE",
|
|
228
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
|
|
229
|
-
});
|
|
230
|
-
/**
|
|
231
|
-
* List job resources for the console.
|
|
232
|
-
*
|
|
233
|
-
* @param request - The request {@link ListJobResourcesRequest}
|
|
234
|
-
* @returns A Promise of ListJobResourcesResponse
|
|
235
|
-
*/
|
|
236
|
-
listJobResources = (request = {}) => this.client.fetch({
|
|
237
|
-
method: "GET",
|
|
238
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-resources`
|
|
239
|
-
}, unmarshalListJobResourcesResponse);
|
|
240
|
-
/**
|
|
241
|
-
* Get job limits for the console.
|
|
242
|
-
*
|
|
243
|
-
* @param request - The request {@link GetJobLimitsRequest}
|
|
244
|
-
* @returns A Promise of JobLimits
|
|
245
|
-
*/
|
|
246
|
-
getJobLimits = (request = {}) => this.client.fetch({
|
|
247
|
-
method: "GET",
|
|
248
|
-
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-limits`
|
|
249
|
-
}, unmarshalJobLimits);
|
|
11
|
+
constructor(..._args) {
|
|
12
|
+
super(..._args);
|
|
13
|
+
this.createJobDefinition = (request) => this.client.fetch({
|
|
14
|
+
body: JSON.stringify(marshalCreateJobDefinitionRequest(request, this.client.settings)),
|
|
15
|
+
headers: jsonContentHeaders,
|
|
16
|
+
method: "POST",
|
|
17
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions`
|
|
18
|
+
}, unmarshalJobDefinition);
|
|
19
|
+
this.getJobDefinition = (request) => this.client.fetch({
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}`
|
|
22
|
+
}, unmarshalJobDefinition);
|
|
23
|
+
this.pageOfListJobDefinitions = (request = {}) => this.client.fetch({
|
|
24
|
+
method: "GET",
|
|
25
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions`,
|
|
26
|
+
urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
|
|
27
|
+
}, unmarshalListJobDefinitionsResponse);
|
|
28
|
+
this.listJobDefinitions = (request = {}) => enrichForPagination("jobDefinitions", this.pageOfListJobDefinitions, request);
|
|
29
|
+
this.updateJobDefinition = (request) => this.client.fetch({
|
|
30
|
+
body: JSON.stringify(marshalUpdateJobDefinitionRequest(request, this.client.settings)),
|
|
31
|
+
headers: jsonContentHeaders,
|
|
32
|
+
method: "PATCH",
|
|
33
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}`
|
|
34
|
+
}, unmarshalJobDefinition);
|
|
35
|
+
this.deleteJobDefinition = (request) => this.client.fetch({
|
|
36
|
+
method: "DELETE",
|
|
37
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}`
|
|
38
|
+
});
|
|
39
|
+
this.startJobDefinition = (request) => this.client.fetch({
|
|
40
|
+
body: JSON.stringify(marshalStartJobDefinitionRequest(request, this.client.settings)),
|
|
41
|
+
headers: jsonContentHeaders,
|
|
42
|
+
method: "POST",
|
|
43
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/start`
|
|
44
|
+
}, unmarshalStartJobDefinitionResponse);
|
|
45
|
+
this.getJobRun = (request) => this.client.fetch({
|
|
46
|
+
method: "GET",
|
|
47
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs/${validatePathParam("jobRunId", request.jobRunId)}`
|
|
48
|
+
}, unmarshalJobRun);
|
|
49
|
+
this.pageOfListJobRuns = (request = {}) => this.client.fetch({
|
|
50
|
+
method: "GET",
|
|
51
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs`,
|
|
52
|
+
urlParams: urlParams(["job_definition_id", request.jobDefinitionId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["reasons", request.reasons], ["state", request.state], ["states", request.states])
|
|
53
|
+
}, unmarshalListJobRunsResponse);
|
|
54
|
+
this.listJobRuns = (request = {}) => enrichForPagination("jobRuns", this.pageOfListJobRuns, request);
|
|
55
|
+
this.stopJobRun = (request) => this.client.fetch({
|
|
56
|
+
body: "{}",
|
|
57
|
+
headers: jsonContentHeaders,
|
|
58
|
+
method: "POST",
|
|
59
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs/${validatePathParam("jobRunId", request.jobRunId)}/stop`
|
|
60
|
+
}, unmarshalJobRun);
|
|
61
|
+
this.createSecrets = (request) => this.client.fetch({
|
|
62
|
+
body: JSON.stringify(marshalCreateSecretsRequest(request, this.client.settings)),
|
|
63
|
+
headers: jsonContentHeaders,
|
|
64
|
+
method: "POST",
|
|
65
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`
|
|
66
|
+
}, unmarshalCreateSecretsResponse);
|
|
67
|
+
this.getSecret = (request) => this.client.fetch({
|
|
68
|
+
method: "GET",
|
|
69
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
70
|
+
}, unmarshalSecret);
|
|
71
|
+
this.listSecrets = (request) => this.client.fetch({
|
|
72
|
+
method: "GET",
|
|
73
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`,
|
|
74
|
+
urlParams: urlParams(["job_definition_id", request.jobDefinitionId])
|
|
75
|
+
}, unmarshalListSecretsResponse);
|
|
76
|
+
this.updateSecret = (request) => this.client.fetch({
|
|
77
|
+
body: JSON.stringify(marshalUpdateSecretRequest(request, this.client.settings)),
|
|
78
|
+
headers: jsonContentHeaders,
|
|
79
|
+
method: "PATCH",
|
|
80
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
81
|
+
}, unmarshalSecret);
|
|
82
|
+
this.deleteSecret = (request) => this.client.fetch({
|
|
83
|
+
method: "DELETE",
|
|
84
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
85
|
+
});
|
|
86
|
+
this.createTrigger = (request) => this.client.fetch({
|
|
87
|
+
body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
|
|
88
|
+
headers: jsonContentHeaders,
|
|
89
|
+
method: "POST",
|
|
90
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`
|
|
91
|
+
}, unmarshalTrigger);
|
|
92
|
+
this.getTrigger = (request) => this.client.fetch({
|
|
93
|
+
method: "GET",
|
|
94
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
|
|
95
|
+
}, unmarshalTrigger);
|
|
96
|
+
this.pageOfListTriggers = (request) => this.client.fetch({
|
|
97
|
+
method: "GET",
|
|
98
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`,
|
|
99
|
+
urlParams: urlParams(["job_definition_id", request.jobDefinitionId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
100
|
+
}, unmarshalListTriggersResponse);
|
|
101
|
+
this.listTriggers = (request) => enrichForPagination("triggers", this.pageOfListTriggers, request);
|
|
102
|
+
this.updateTrigger = (request) => this.client.fetch({
|
|
103
|
+
body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
|
|
104
|
+
headers: jsonContentHeaders,
|
|
105
|
+
method: "PATCH",
|
|
106
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
|
|
107
|
+
}, unmarshalTrigger);
|
|
108
|
+
this.deleteTrigger = (request) => this.client.fetch({
|
|
109
|
+
method: "DELETE",
|
|
110
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
|
|
111
|
+
});
|
|
112
|
+
this.listJobResources = (request = {}) => this.client.fetch({
|
|
113
|
+
method: "GET",
|
|
114
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-resources`
|
|
115
|
+
}, unmarshalListJobResourcesResponse);
|
|
116
|
+
this.getJobLimits = (request = {}) => this.client.fetch({
|
|
117
|
+
method: "GET",
|
|
118
|
+
path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-limits`
|
|
119
|
+
}, unmarshalJobLimits);
|
|
120
|
+
}
|
|
121
|
+
static {
|
|
122
|
+
this.LOCALITY = toApiLocality({ regions: [
|
|
123
|
+
"fr-par",
|
|
124
|
+
"nl-ams",
|
|
125
|
+
"pl-waw"
|
|
126
|
+
] });
|
|
127
|
+
}
|
|
250
128
|
};
|
|
251
129
|
//#endregion
|
|
252
130
|
export { API };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
2
2
|
import randomName from "@scaleway/random-name";
|
|
3
3
|
//#region src/v1alpha2/marshalling.gen.ts
|
|
4
|
-
|
|
4
|
+
const unmarshalSecretEnvVar = (data) => {
|
|
5
5
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretEnvVar' failed as data isn't a dictionary.`);
|
|
6
6
|
return { name: data.name };
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
const unmarshalSecretFile = (data) => {
|
|
9
9
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretFile' failed as data isn't a dictionary.`);
|
|
10
10
|
return { path: data.path };
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
const unmarshalSecret = (data) => {
|
|
13
13
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
|
|
14
14
|
return {
|
|
15
15
|
envVar: data.env_var ? unmarshalSecretEnvVar(data.env_var) : void 0,
|
|
@@ -20,18 +20,18 @@ var unmarshalSecret = (data) => {
|
|
|
20
20
|
secretManagerVersion: data.secret_manager_version
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
const unmarshalCronSchedule = (data) => {
|
|
24
24
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CronSchedule' failed as data isn't a dictionary.`);
|
|
25
25
|
return {
|
|
26
26
|
schedule: data.schedule,
|
|
27
27
|
timezone: data.timezone
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
const unmarshalRetryPolicy = (data) => {
|
|
31
31
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RetryPolicy' failed as data isn't a dictionary.`);
|
|
32
32
|
return { maxRetries: data.max_retries };
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
const unmarshalJobDefinition = (data) => {
|
|
35
35
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobDefinition' failed as data isn't a dictionary.`);
|
|
36
36
|
return {
|
|
37
37
|
args: data.args,
|
|
@@ -54,7 +54,7 @@ var unmarshalJobDefinition = (data) => {
|
|
|
54
54
|
updatedAt: unmarshalDate(data.updated_at)
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
-
|
|
57
|
+
const unmarshalJobRun = (data) => {
|
|
58
58
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobRun' failed as data isn't a dictionary.`);
|
|
59
59
|
return {
|
|
60
60
|
args: data.args,
|
|
@@ -79,7 +79,7 @@ var unmarshalJobRun = (data) => {
|
|
|
79
79
|
updatedAt: unmarshalDate(data.updated_at)
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
const unmarshalTriggerCronConfig = (data) => {
|
|
83
83
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'TriggerCronConfig' failed as data isn't a dictionary.`);
|
|
84
84
|
return {
|
|
85
85
|
args: data.args,
|
|
@@ -88,7 +88,7 @@ var unmarshalTriggerCronConfig = (data) => {
|
|
|
88
88
|
timezone: data.timezone
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
const unmarshalTrigger = (data) => {
|
|
92
92
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);
|
|
93
93
|
return {
|
|
94
94
|
createdAt: unmarshalDate(data.created_at),
|
|
@@ -99,63 +99,63 @@ var unmarshalTrigger = (data) => {
|
|
|
99
99
|
updatedAt: unmarshalDate(data.updated_at)
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
|
-
|
|
102
|
+
const unmarshalCreateSecretsResponse = (data) => {
|
|
103
103
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateSecretsResponse' failed as data isn't a dictionary.`);
|
|
104
104
|
return { secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret) };
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
const unmarshalJobLimits = (data) => {
|
|
107
107
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobLimits' failed as data isn't a dictionary.`);
|
|
108
108
|
return { secretsPerJobDefinition: data.secrets_per_job_definition };
|
|
109
109
|
};
|
|
110
|
-
|
|
110
|
+
const unmarshalListJobDefinitionsResponse = (data) => {
|
|
111
111
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobDefinitionsResponse' failed as data isn't a dictionary.`);
|
|
112
112
|
return {
|
|
113
113
|
jobDefinitions: unmarshalArrayOfObject(data.job_definitions, unmarshalJobDefinition),
|
|
114
114
|
totalCount: data.total_count
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
|
-
|
|
117
|
+
const unmarshalResource = (data) => {
|
|
118
118
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Resource' failed as data isn't a dictionary.`);
|
|
119
119
|
return {
|
|
120
120
|
computeLimitMvcpu: data.compute_limit_mvcpu,
|
|
121
121
|
memoryLimitBytes: data.memory_limit_bytes
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
|
-
|
|
124
|
+
const unmarshalListJobResourcesResponse = (data) => {
|
|
125
125
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobResourcesResponse' failed as data isn't a dictionary.`);
|
|
126
126
|
return { resources: unmarshalArrayOfObject(data.resources, unmarshalResource) };
|
|
127
127
|
};
|
|
128
|
-
|
|
128
|
+
const unmarshalListJobRunsResponse = (data) => {
|
|
129
129
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobRunsResponse' failed as data isn't a dictionary.`);
|
|
130
130
|
return {
|
|
131
131
|
jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun),
|
|
132
132
|
totalCount: data.total_count
|
|
133
133
|
};
|
|
134
134
|
};
|
|
135
|
-
|
|
135
|
+
const unmarshalListSecretsResponse = (data) => {
|
|
136
136
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`);
|
|
137
137
|
return {
|
|
138
138
|
secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
|
|
139
139
|
totalCount: data.total_count
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
|
-
|
|
142
|
+
const unmarshalListTriggersResponse = (data) => {
|
|
143
143
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);
|
|
144
144
|
return {
|
|
145
145
|
totalCount: data.total_count,
|
|
146
146
|
triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
|
-
|
|
149
|
+
const unmarshalStartJobDefinitionResponse = (data) => {
|
|
150
150
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'StartJobDefinitionResponse' failed as data isn't a dictionary.`);
|
|
151
151
|
return { jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun) };
|
|
152
152
|
};
|
|
153
|
-
|
|
153
|
+
const marshalCreateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
154
154
|
schedule: request.schedule,
|
|
155
155
|
timezone: request.timezone
|
|
156
156
|
});
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
const marshalRetryPolicy = (request, defaults) => ({ max_retries: request.maxRetries });
|
|
158
|
+
const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
159
159
|
args: request.args,
|
|
160
160
|
command: request.command,
|
|
161
161
|
cpu_limit: request.cpuLimit,
|
|
@@ -171,7 +171,7 @@ var marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
|
171
171
|
retry_policy: request.retryPolicy !== void 0 ? marshalRetryPolicy(request.retryPolicy, defaults) : void 0,
|
|
172
172
|
startup_command: request.startupCommand
|
|
173
173
|
});
|
|
174
|
-
|
|
174
|
+
const marshalCreateSecretsRequestSecretConfig = (request, defaults) => ({
|
|
175
175
|
secret_manager_id: request.secretManagerId,
|
|
176
176
|
secret_manager_version: request.secretManagerVersion,
|
|
177
177
|
...resolveOneOf([{
|
|
@@ -182,17 +182,17 @@ var marshalCreateSecretsRequestSecretConfig = (request, defaults) => ({
|
|
|
182
182
|
value: request.envVarName
|
|
183
183
|
}])
|
|
184
184
|
});
|
|
185
|
-
|
|
185
|
+
const marshalCreateSecretsRequest = (request, defaults) => ({
|
|
186
186
|
job_definition_id: request.jobDefinitionId,
|
|
187
187
|
secrets: request.secrets.map((elt) => marshalCreateSecretsRequestSecretConfig(elt, defaults))
|
|
188
188
|
});
|
|
189
|
-
|
|
189
|
+
const marshalCreateTriggerRequestCronConfig = (request, defaults) => ({
|
|
190
190
|
args: request.args,
|
|
191
191
|
schedule: request.schedule,
|
|
192
192
|
startup_command: request.startupCommand,
|
|
193
193
|
timezone: request.timezone
|
|
194
194
|
});
|
|
195
|
-
|
|
195
|
+
const marshalCreateTriggerRequest = (request, defaults) => ({
|
|
196
196
|
job_definition_id: request.jobDefinitionId,
|
|
197
197
|
name: request.name,
|
|
198
198
|
...resolveOneOf([{
|
|
@@ -200,18 +200,18 @@ var marshalCreateTriggerRequest = (request, defaults) => ({
|
|
|
200
200
|
value: request.cronConfig !== void 0 ? marshalCreateTriggerRequestCronConfig(request.cronConfig, defaults) : void 0
|
|
201
201
|
}])
|
|
202
202
|
});
|
|
203
|
-
|
|
203
|
+
const marshalStartJobDefinitionRequest = (request, defaults) => ({
|
|
204
204
|
args: request.args,
|
|
205
205
|
command: request.command,
|
|
206
206
|
environment_variables: request.environmentVariables,
|
|
207
207
|
replicas: request.replicas,
|
|
208
208
|
startup_command: request.startupCommand
|
|
209
209
|
});
|
|
210
|
-
|
|
210
|
+
const marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
211
211
|
schedule: request.schedule,
|
|
212
212
|
timezone: request.timezone
|
|
213
213
|
});
|
|
214
|
-
|
|
214
|
+
const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
215
215
|
args: request.args,
|
|
216
216
|
command: request.command,
|
|
217
217
|
cpu_limit: request.cpuLimit,
|
|
@@ -226,7 +226,7 @@ var marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
|
226
226
|
retry_policy: request.retryPolicy !== void 0 ? marshalRetryPolicy(request.retryPolicy, defaults) : void 0,
|
|
227
227
|
startup_command: request.startupCommand
|
|
228
228
|
});
|
|
229
|
-
|
|
229
|
+
const marshalUpdateSecretRequest = (request, defaults) => ({
|
|
230
230
|
secret_manager_version: request.secretManagerVersion,
|
|
231
231
|
...resolveOneOf([{
|
|
232
232
|
param: "path",
|
|
@@ -236,13 +236,13 @@ var marshalUpdateSecretRequest = (request, defaults) => ({
|
|
|
236
236
|
value: request.envVarName
|
|
237
237
|
}])
|
|
238
238
|
});
|
|
239
|
-
|
|
239
|
+
const marshalUpdateTriggerRequestCronConfig = (request, defaults) => ({
|
|
240
240
|
args: request.args,
|
|
241
241
|
schedule: request.schedule,
|
|
242
242
|
startup_command: request.startupCommand,
|
|
243
243
|
timezone: request.timezone
|
|
244
244
|
});
|
|
245
|
-
|
|
245
|
+
const marshalUpdateTriggerRequest = (request, defaults) => ({
|
|
246
246
|
name: request.name,
|
|
247
247
|
...resolveOneOf([{
|
|
248
248
|
param: "cron_config",
|