@scaleway/sdk-account 2.2.1 → 2.3.0

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/README.md CHANGED
@@ -83,6 +83,7 @@ const api = new Account.v1.API(client)
83
83
  ## Support
84
84
 
85
85
  We love feedback! Feel free to reach us on:
86
+
86
87
  - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
88
  - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
89
 
@@ -93,4 +94,3 @@ This repository is at its early stage and is still in active development. If you
93
94
  ## License
94
95
 
95
96
  This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
96
-
@@ -0,0 +1,11 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __exportAll = (all, no_symbols) => {
3
+ let target = {};
4
+ for (var name in all) __defProp(target, name, {
5
+ get: all[name],
6
+ enumerable: true
7
+ });
8
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
9
+ return target;
10
+ };
11
+ export { __exportAll };
package/dist/index.gen.js CHANGED
@@ -1,4 +1,2 @@
1
- import * as index_gen from "./v3/index.gen.js";
2
- export {
3
- index_gen as Accountv3
4
- };
1
+ import { index_gen_exports } from "./v3/index.gen.js";
2
+ export { index_gen_exports as Accountv3 };
@@ -1,214 +1,145 @@
1
- import { API, urlParams, validatePathParam, enrichForPagination } from "@scaleway/sdk-client";
2
- import { marshalContractApiCreateContractSignatureRequest, unmarshalContractSignature, marshalContractApiCheckContractSignatureRequest, unmarshalCheckContractSignatureResponse, unmarshalListContractSignaturesResponse, marshalProjectApiCreateProjectRequest, unmarshalProject, unmarshalListProjectsResponse, marshalProjectApiUpdateProjectRequest, marshalProjectApiSetProjectQualificationRequest, unmarshalProjectQualification } from "./marshalling.gen.js";
3
- const jsonContentHeaders = {
4
- "Content-Type": "application/json; charset=utf-8"
1
+ import { marshalContractApiCheckContractSignatureRequest, marshalContractApiCreateContractSignatureRequest, marshalProjectApiCreateProjectRequest, marshalProjectApiSetProjectQualificationRequest, marshalProjectApiUpdateProjectRequest, unmarshalCheckContractSignatureResponse, unmarshalContractSignature, unmarshalListContractSignaturesResponse, unmarshalListProjectsResponse, unmarshalProject, unmarshalProjectQualification } from "./marshalling.gen.js";
2
+ import { API, enrichForPagination, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
+ /**
5
+ * Contract API.
6
+
7
+ The Contract API allows you to manage contracts.
8
+ */
9
+ var ContractAPI = class extends API {
10
+ /**
11
+ * Download a contract content.
12
+ *
13
+ * @param request - The request {@link ContractApiDownloadContractSignatureRequest}
14
+ * @returns A Promise of Blob
15
+ */
16
+ downloadContractSignature = (request) => this.client.fetch({
17
+ method: "GET",
18
+ path: `/account/v3/contract-signatures/${validatePathParam("contractSignatureId", request.contractSignatureId)}/download`,
19
+ urlParams: urlParams(["dl", 1], ["locale", request.locale]),
20
+ responseType: "blob"
21
+ });
22
+ /**
23
+ * Create a signature for your Organization for the latest version of the requested contract.
24
+ *
25
+ * @param request - The request {@link ContractApiCreateContractSignatureRequest}
26
+ * @returns A Promise of ContractSignature
27
+ */
28
+ createContractSignature = (request) => this.client.fetch({
29
+ body: JSON.stringify(marshalContractApiCreateContractSignatureRequest(request, this.client.settings)),
30
+ headers: jsonContentHeaders,
31
+ method: "POST",
32
+ path: `/account/v3/contract-signatures`
33
+ }, unmarshalContractSignature);
34
+ /**
35
+ * Sign a contract for your Organization.
36
+ *
37
+ * @param request - The request {@link ContractApiValidateContractSignatureRequest}
38
+ * @returns A Promise of ContractSignature
39
+ */
40
+ validateContractSignature = (request) => this.client.fetch({
41
+ body: "{}",
42
+ headers: jsonContentHeaders,
43
+ method: "POST",
44
+ path: `/account/v3/contract-signatures/${validatePathParam("contractSignatureId", request.contractSignatureId)}/validate`
45
+ }, unmarshalContractSignature);
46
+ /**
47
+ * Check if a contract is signed for your Organization.
48
+ *
49
+ * @param request - The request {@link ContractApiCheckContractSignatureRequest}
50
+ * @returns A Promise of CheckContractSignatureResponse
51
+ */
52
+ checkContractSignature = (request) => this.client.fetch({
53
+ body: JSON.stringify(marshalContractApiCheckContractSignatureRequest(request, this.client.settings)),
54
+ headers: jsonContentHeaders,
55
+ method: "POST",
56
+ path: `/account/v3/contract-signatures/check`
57
+ }, unmarshalCheckContractSignatureResponse);
58
+ pageOfListContractSignatures = (request = {}) => this.client.fetch({
59
+ method: "GET",
60
+ path: `/account/v3/contract-signatures`,
61
+ urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
62
+ }, unmarshalListContractSignaturesResponse);
63
+ /**
64
+ * List contract signatures for an Organization.
65
+ *
66
+ * @param request - The request {@link ContractApiListContractSignaturesRequest}
67
+ * @returns A Promise of ListContractSignaturesResponse
68
+ */
69
+ listContractSignatures = (request = {}) => enrichForPagination("contractSignatures", this.pageOfListContractSignatures, request);
5
70
  };
6
- class ContractAPI extends API {
7
- /**
8
- * Download a contract content.
9
- *
10
- * @param request - The request {@link ContractApiDownloadContractSignatureRequest}
11
- * @returns A Promise of Blob
12
- */
13
- downloadContractSignature = (request) => this.client.fetch({
14
- method: "GET",
15
- path: `/account/v3/contract-signatures/${validatePathParam("contractSignatureId", request.contractSignatureId)}/download`,
16
- urlParams: urlParams(["dl", 1], ["locale", request.locale]),
17
- responseType: "blob"
18
- });
19
- /**
20
- * Create a signature for your Organization for the latest version of the requested contract.
21
- *
22
- * @param request - The request {@link ContractApiCreateContractSignatureRequest}
23
- * @returns A Promise of ContractSignature
24
- */
25
- createContractSignature = (request) => this.client.fetch(
26
- {
27
- body: JSON.stringify(
28
- marshalContractApiCreateContractSignatureRequest(
29
- request,
30
- this.client.settings
31
- )
32
- ),
33
- headers: jsonContentHeaders,
34
- method: "POST",
35
- path: `/account/v3/contract-signatures`
36
- },
37
- unmarshalContractSignature
38
- );
39
- /**
40
- * Sign a contract for your Organization.
41
- *
42
- * @param request - The request {@link ContractApiValidateContractSignatureRequest}
43
- * @returns A Promise of ContractSignature
44
- */
45
- validateContractSignature = (request) => this.client.fetch(
46
- {
47
- body: "{}",
48
- headers: jsonContentHeaders,
49
- method: "POST",
50
- path: `/account/v3/contract-signatures/${validatePathParam("contractSignatureId", request.contractSignatureId)}/validate`
51
- },
52
- unmarshalContractSignature
53
- );
54
- /**
55
- * Check if a contract is signed for your Organization.
56
- *
57
- * @param request - The request {@link ContractApiCheckContractSignatureRequest}
58
- * @returns A Promise of CheckContractSignatureResponse
59
- */
60
- checkContractSignature = (request) => this.client.fetch(
61
- {
62
- body: JSON.stringify(
63
- marshalContractApiCheckContractSignatureRequest(
64
- request,
65
- this.client.settings
66
- )
67
- ),
68
- headers: jsonContentHeaders,
69
- method: "POST",
70
- path: `/account/v3/contract-signatures/check`
71
- },
72
- unmarshalCheckContractSignatureResponse
73
- );
74
- pageOfListContractSignatures = (request = {}) => this.client.fetch(
75
- {
76
- method: "GET",
77
- path: `/account/v3/contract-signatures`,
78
- urlParams: urlParams(
79
- ["order_by", request.orderBy],
80
- [
81
- "organization_id",
82
- request.organizationId ?? this.client.settings.defaultOrganizationId
83
- ],
84
- ["page", request.page],
85
- [
86
- "page_size",
87
- request.pageSize ?? this.client.settings.defaultPageSize
88
- ]
89
- )
90
- },
91
- unmarshalListContractSignaturesResponse
92
- );
93
- /**
94
- * List contract signatures for an Organization.
95
- *
96
- * @param request - The request {@link ContractApiListContractSignaturesRequest}
97
- * @returns A Promise of ListContractSignaturesResponse
98
- */
99
- listContractSignatures = (request = {}) => enrichForPagination(
100
- "contractSignatures",
101
- this.pageOfListContractSignatures,
102
- request
103
- );
104
- }
105
- class ProjectAPI extends API {
106
- /**
107
- * Create a new Project for an Organization. Generate a new Project for an Organization, specifying its configuration including name and description.
108
- *
109
- * @param request - The request {@link ProjectApiCreateProjectRequest}
110
- * @returns A Promise of Project
111
- */
112
- createProject = (request) => this.client.fetch(
113
- {
114
- body: JSON.stringify(
115
- marshalProjectApiCreateProjectRequest(request, this.client.settings)
116
- ),
117
- headers: jsonContentHeaders,
118
- method: "POST",
119
- path: `/account/v3/projects`
120
- },
121
- unmarshalProject
122
- );
123
- pageOfListProjects = (request = {}) => this.client.fetch(
124
- {
125
- method: "GET",
126
- path: `/account/v3/projects`,
127
- urlParams: urlParams(
128
- ["name", request.name],
129
- ["order_by", request.orderBy],
130
- [
131
- "organization_id",
132
- request.organizationId ?? this.client.settings.defaultOrganizationId
133
- ],
134
- ["page", request.page],
135
- [
136
- "page_size",
137
- request.pageSize ?? this.client.settings.defaultPageSize
138
- ],
139
- ["project_ids", request.projectIds]
140
- )
141
- },
142
- unmarshalListProjectsResponse
143
- );
144
- /**
145
- * List all Projects of an Organization. List all Projects of an Organization. The response will include the total number of Projects as well as their associated Organizations, names, and IDs. Other information includes the creation and update date of the Project.
146
- *
147
- * @param request - The request {@link ProjectApiListProjectsRequest}
148
- * @returns A Promise of ListProjectsResponse
149
- */
150
- listProjects = (request = {}) => enrichForPagination("projects", this.pageOfListProjects, request);
151
- /**
152
- * Get an existing Project. Retrieve information about an existing Project, specified by its Project ID. Its full details, including ID, name and description, are returned in the response object.
153
- *
154
- * @param request - The request {@link ProjectApiGetProjectRequest}
155
- * @returns A Promise of Project
156
- */
157
- getProject = (request = {}) => this.client.fetch(
158
- {
159
- method: "GET",
160
- path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
161
- },
162
- unmarshalProject
163
- );
164
- /**
165
- * Delete an existing Project. Delete an existing Project, specified by its Project ID. The Project needs to be empty (meaning there are no resources left in it) to be deleted effectively. Note that deleting a Project is permanent, and cannot be undone.
166
- *
167
- * @param request - The request {@link ProjectApiDeleteProjectRequest}
168
- */
169
- deleteProject = (request = {}) => this.client.fetch({
170
- method: "DELETE",
171
- path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
172
- });
173
- /**
174
- * Update Project. Update the parameters of an existing Project, specified by its Project ID. These parameters include the name and description.
175
- *
176
- * @param request - The request {@link ProjectApiUpdateProjectRequest}
177
- * @returns A Promise of Project
178
- */
179
- updateProject = (request = {}) => this.client.fetch(
180
- {
181
- body: JSON.stringify(
182
- marshalProjectApiUpdateProjectRequest(request, this.client.settings)
183
- ),
184
- headers: jsonContentHeaders,
185
- method: "PATCH",
186
- path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
187
- },
188
- unmarshalProject
189
- );
190
- /**
191
- * Set project use case. Set the project use case for a new or existing Project, specified by its Project ID. You can customize the use case, sub use case, and architecture type you want to use in the Project.
192
- *
193
- * @param request - The request {@link ProjectApiSetProjectQualificationRequest}
194
- * @returns A Promise of ProjectQualification
195
- */
196
- setProjectQualification = (request = {}) => this.client.fetch(
197
- {
198
- body: JSON.stringify(
199
- marshalProjectApiSetProjectQualificationRequest(
200
- request,
201
- this.client.settings
202
- )
203
- ),
204
- headers: jsonContentHeaders,
205
- method: "POST",
206
- path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/project-qualification`
207
- },
208
- unmarshalProjectQualification
209
- );
210
- }
211
- export {
212
- ContractAPI,
213
- ProjectAPI
71
+ /**
72
+ * Account API.
73
+
74
+ This API allows you to manage your Scaleway Projects.
75
+ */
76
+ var ProjectAPI = class extends API {
77
+ /**
78
+ * Create a new Project for an Organization. Generate a new Project for an Organization, specifying its configuration including name and description.
79
+ *
80
+ * @param request - The request {@link ProjectApiCreateProjectRequest}
81
+ * @returns A Promise of Project
82
+ */
83
+ createProject = (request) => this.client.fetch({
84
+ body: JSON.stringify(marshalProjectApiCreateProjectRequest(request, this.client.settings)),
85
+ headers: jsonContentHeaders,
86
+ method: "POST",
87
+ path: `/account/v3/projects`
88
+ }, unmarshalProject);
89
+ pageOfListProjects = (request = {}) => this.client.fetch({
90
+ method: "GET",
91
+ path: `/account/v3/projects`,
92
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_ids", request.projectIds])
93
+ }, unmarshalListProjectsResponse);
94
+ /**
95
+ * List all Projects of an Organization. List all Projects of an Organization. The response will include the total number of Projects as well as their associated Organizations, names, and IDs. Other information includes the creation and update date of the Project.
96
+ *
97
+ * @param request - The request {@link ProjectApiListProjectsRequest}
98
+ * @returns A Promise of ListProjectsResponse
99
+ */
100
+ listProjects = (request = {}) => enrichForPagination("projects", this.pageOfListProjects, request);
101
+ /**
102
+ * Get an existing Project. Retrieve information about an existing Project, specified by its Project ID. Its full details, including ID, name and description, are returned in the response object.
103
+ *
104
+ * @param request - The request {@link ProjectApiGetProjectRequest}
105
+ * @returns A Promise of Project
106
+ */
107
+ getProject = (request = {}) => this.client.fetch({
108
+ method: "GET",
109
+ path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
110
+ }, unmarshalProject);
111
+ /**
112
+ * Delete an existing Project. Delete an existing Project, specified by its Project ID. The Project needs to be empty (meaning there are no resources left in it) to be deleted effectively. Note that deleting a Project is permanent, and cannot be undone.
113
+ *
114
+ * @param request - The request {@link ProjectApiDeleteProjectRequest}
115
+ */
116
+ deleteProject = (request = {}) => this.client.fetch({
117
+ method: "DELETE",
118
+ path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
119
+ });
120
+ /**
121
+ * Update Project. Update the parameters of an existing Project, specified by its Project ID. These parameters include the name and description.
122
+ *
123
+ * @param request - The request {@link ProjectApiUpdateProjectRequest}
124
+ * @returns A Promise of Project
125
+ */
126
+ updateProject = (request = {}) => this.client.fetch({
127
+ body: JSON.stringify(marshalProjectApiUpdateProjectRequest(request, this.client.settings)),
128
+ headers: jsonContentHeaders,
129
+ method: "PATCH",
130
+ path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
131
+ }, unmarshalProject);
132
+ /**
133
+ * Set project use case. Set the project use case for a new or existing Project, specified by its Project ID. You can customize the use case, sub use case, and architecture type you want to use in the Project.
134
+ *
135
+ * @param request - The request {@link ProjectApiSetProjectQualificationRequest}
136
+ * @returns A Promise of ProjectQualification
137
+ */
138
+ setProjectQualification = (request = {}) => this.client.fetch({
139
+ body: JSON.stringify(marshalProjectApiSetProjectQualificationRequest(request, this.client.settings)),
140
+ headers: jsonContentHeaders,
141
+ method: "POST",
142
+ path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/project-qualification`
143
+ }, unmarshalProjectQualification);
214
144
  };
145
+ export { ContractAPI, ProjectAPI };
@@ -1,19 +1,21 @@
1
- import { ContractAPI, ProjectAPI } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { marshalContractApiCheckContractSignatureRequest, marshalContractApiCreateContractSignatureRequest, marshalProjectApiCreateProjectRequest, marshalProjectApiSetProjectQualificationRequest, marshalProjectApiUpdateProjectRequest, unmarshalCheckContractSignatureResponse, unmarshalContractSignature, unmarshalListContractSignaturesResponse, unmarshalListProjectsResponse, unmarshalProject, unmarshalProjectQualification } from "./marshalling.gen.js";
3
- import * as validationRules_gen from "./validation-rules.gen.js";
4
- export {
5
- ContractAPI,
6
- ProjectAPI,
7
- validationRules_gen as ValidationRules,
8
- marshalContractApiCheckContractSignatureRequest,
9
- marshalContractApiCreateContractSignatureRequest,
10
- marshalProjectApiCreateProjectRequest,
11
- marshalProjectApiSetProjectQualificationRequest,
12
- marshalProjectApiUpdateProjectRequest,
13
- unmarshalCheckContractSignatureResponse,
14
- unmarshalContractSignature,
15
- unmarshalListContractSignaturesResponse,
16
- unmarshalListProjectsResponse,
17
- unmarshalProject,
18
- unmarshalProjectQualification
19
- };
3
+ import { ContractAPI, ProjectAPI } from "./api.gen.js";
4
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
5
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
6
+ ContractAPI: () => ContractAPI,
7
+ ProjectAPI: () => ProjectAPI,
8
+ ValidationRules: () => validation_rules_gen_exports,
9
+ marshalContractApiCheckContractSignatureRequest: () => marshalContractApiCheckContractSignatureRequest,
10
+ marshalContractApiCreateContractSignatureRequest: () => marshalContractApiCreateContractSignatureRequest,
11
+ marshalProjectApiCreateProjectRequest: () => marshalProjectApiCreateProjectRequest,
12
+ marshalProjectApiSetProjectQualificationRequest: () => marshalProjectApiSetProjectQualificationRequest,
13
+ marshalProjectApiUpdateProjectRequest: () => marshalProjectApiUpdateProjectRequest,
14
+ unmarshalCheckContractSignatureResponse: () => unmarshalCheckContractSignatureResponse,
15
+ unmarshalContractSignature: () => unmarshalContractSignature,
16
+ unmarshalListContractSignaturesResponse: () => unmarshalListContractSignaturesResponse,
17
+ unmarshalListProjectsResponse: () => unmarshalListProjectsResponse,
18
+ unmarshalProject: () => unmarshalProject,
19
+ unmarshalProjectQualification: () => unmarshalProjectQualification
20
+ });
21
+ export { index_gen_exports };
@@ -1,314 +1,187 @@
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
1
2
  import randomName from "@scaleway/random-name";
2
- import { resolveOneOf, isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
3
- const unmarshalContract = (data) => {
4
- if (!isJSONObject(data)) {
5
- throw new TypeError(
6
- `Unmarshalling the type 'Contract' failed as data isn't a dictionary.`
7
- );
8
- }
9
- return {
10
- createdAt: unmarshalDate(data.created_at),
11
- id: data.id,
12
- name: data.name,
13
- type: data.type,
14
- updatedAt: unmarshalDate(data.updated_at),
15
- version: data.version
16
- };
3
+ var unmarshalContract = (data) => {
4
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Contract' failed as data isn't a dictionary.`);
5
+ return {
6
+ createdAt: unmarshalDate(data.created_at),
7
+ id: data.id,
8
+ name: data.name,
9
+ type: data.type,
10
+ updatedAt: unmarshalDate(data.updated_at),
11
+ version: data.version
12
+ };
17
13
  };
18
14
  const unmarshalContractSignature = (data) => {
19
- if (!isJSONObject(data)) {
20
- throw new TypeError(
21
- `Unmarshalling the type 'ContractSignature' failed as data isn't a dictionary.`
22
- );
23
- }
24
- return {
25
- contract: data.contract ? unmarshalContract(data.contract) : void 0,
26
- createdAt: unmarshalDate(data.created_at),
27
- expiresAt: unmarshalDate(data.expires_at),
28
- id: data.id,
29
- organizationId: data.organization_id,
30
- signedAt: unmarshalDate(data.signed_at)
31
- };
32
- };
33
- const unmarshalQualificationAiMachine = (data) => {
34
- if (!isJSONObject(data)) {
35
- throw new TypeError(
36
- `Unmarshalling the type 'QualificationAiMachine' failed as data isn't a dictionary.`
37
- );
38
- }
39
- return {
40
- subUseCase: data.sub_use_case
41
- };
42
- };
43
- const unmarshalQualificationArchiveData = (data) => {
44
- if (!isJSONObject(data)) {
45
- throw new TypeError(
46
- `Unmarshalling the type 'QualificationArchiveData' failed as data isn't a dictionary.`
47
- );
48
- }
49
- return {
50
- subUseCase: data.sub_use_case
51
- };
52
- };
53
- const unmarshalQualificationContainer = (data) => {
54
- if (!isJSONObject(data)) {
55
- throw new TypeError(
56
- `Unmarshalling the type 'QualificationContainer' failed as data isn't a dictionary.`
57
- );
58
- }
59
- return {
60
- subUseCase: data.sub_use_case
61
- };
62
- };
63
- const unmarshalQualificationDeploySoftware = (data) => {
64
- if (!isJSONObject(data)) {
65
- throw new TypeError(
66
- `Unmarshalling the type 'QualificationDeploySoftware' failed as data isn't a dictionary.`
67
- );
68
- }
69
- return {
70
- subUseCase: data.sub_use_case
71
- };
72
- };
73
- const unmarshalQualificationHostApplication = (data) => {
74
- if (!isJSONObject(data)) {
75
- throw new TypeError(
76
- `Unmarshalling the type 'QualificationHostApplication' failed as data isn't a dictionary.`
77
- );
78
- }
79
- return {
80
- subUseCase: data.sub_use_case
81
- };
82
- };
83
- const unmarshalQualificationHostWebsite = (data) => {
84
- if (!isJSONObject(data)) {
85
- throw new TypeError(
86
- `Unmarshalling the type 'QualificationHostWebsite' failed as data isn't a dictionary.`
87
- );
88
- }
89
- return {
90
- subUseCase: data.sub_use_case
91
- };
92
- };
93
- const unmarshalQualificationOtherUseCase = (data) => {
94
- if (!isJSONObject(data)) {
95
- throw new TypeError(
96
- `Unmarshalling the type 'QualificationOtherUseCase' failed as data isn't a dictionary.`
97
- );
98
- }
99
- return {
100
- subUseCase: data.sub_use_case
101
- };
102
- };
103
- const unmarshalQualificationSetScalewayEnvironment = (data) => {
104
- if (!isJSONObject(data)) {
105
- throw new TypeError(
106
- `Unmarshalling the type 'QualificationSetScalewayEnvironment' failed as data isn't a dictionary.`
107
- );
108
- }
109
- return {
110
- subUseCase: data.sub_use_case
111
- };
112
- };
113
- const unmarshalQualificationShareData = (data) => {
114
- if (!isJSONObject(data)) {
115
- throw new TypeError(
116
- `Unmarshalling the type 'QualificationShareData' failed as data isn't a dictionary.`
117
- );
118
- }
119
- return {
120
- subUseCase: data.sub_use_case
121
- };
122
- };
123
- const unmarshalQualification = (data) => {
124
- if (!isJSONObject(data)) {
125
- throw new TypeError(
126
- `Unmarshalling the type 'Qualification' failed as data isn't a dictionary.`
127
- );
128
- }
129
- return {
130
- aiMachine: data.ai_machine ? unmarshalQualificationAiMachine(data.ai_machine) : void 0,
131
- architectureType: data.architecture_type,
132
- archiveData: data.archive_data ? unmarshalQualificationArchiveData(data.archive_data) : void 0,
133
- container: data.container ? unmarshalQualificationContainer(data.container) : void 0,
134
- deploySoftware: data.deploy_software ? unmarshalQualificationDeploySoftware(data.deploy_software) : void 0,
135
- hostApplication: data.host_application ? unmarshalQualificationHostApplication(data.host_application) : void 0,
136
- hostWebsite: data.host_website ? unmarshalQualificationHostWebsite(data.host_website) : void 0,
137
- otherUseCase: data.other_use_case ? unmarshalQualificationOtherUseCase(data.other_use_case) : void 0,
138
- setScalewayEnvironment: data.set_scaleway_environment ? unmarshalQualificationSetScalewayEnvironment(
139
- data.set_scaleway_environment
140
- ) : void 0,
141
- shareData: data.share_data ? unmarshalQualificationShareData(data.share_data) : void 0
142
- };
15
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ContractSignature' failed as data isn't a dictionary.`);
16
+ return {
17
+ contract: data.contract ? unmarshalContract(data.contract) : void 0,
18
+ createdAt: unmarshalDate(data.created_at),
19
+ expiresAt: unmarshalDate(data.expires_at),
20
+ id: data.id,
21
+ organizationId: data.organization_id,
22
+ signedAt: unmarshalDate(data.signed_at)
23
+ };
24
+ };
25
+ var unmarshalQualificationAiMachine = (data) => {
26
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'QualificationAiMachine' failed as data isn't a dictionary.`);
27
+ return { subUseCase: data.sub_use_case };
28
+ };
29
+ var unmarshalQualificationArchiveData = (data) => {
30
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'QualificationArchiveData' failed as data isn't a dictionary.`);
31
+ return { subUseCase: data.sub_use_case };
32
+ };
33
+ var unmarshalQualificationContainer = (data) => {
34
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'QualificationContainer' failed as data isn't a dictionary.`);
35
+ return { subUseCase: data.sub_use_case };
36
+ };
37
+ var unmarshalQualificationDeploySoftware = (data) => {
38
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'QualificationDeploySoftware' failed as data isn't a dictionary.`);
39
+ return { subUseCase: data.sub_use_case };
40
+ };
41
+ var unmarshalQualificationHostApplication = (data) => {
42
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'QualificationHostApplication' failed as data isn't a dictionary.`);
43
+ return { subUseCase: data.sub_use_case };
44
+ };
45
+ var unmarshalQualificationHostWebsite = (data) => {
46
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'QualificationHostWebsite' failed as data isn't a dictionary.`);
47
+ return { subUseCase: data.sub_use_case };
48
+ };
49
+ var unmarshalQualificationOtherUseCase = (data) => {
50
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'QualificationOtherUseCase' failed as data isn't a dictionary.`);
51
+ return { subUseCase: data.sub_use_case };
52
+ };
53
+ var unmarshalQualificationSetScalewayEnvironment = (data) => {
54
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'QualificationSetScalewayEnvironment' failed as data isn't a dictionary.`);
55
+ return { subUseCase: data.sub_use_case };
56
+ };
57
+ var unmarshalQualificationShareData = (data) => {
58
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'QualificationShareData' failed as data isn't a dictionary.`);
59
+ return { subUseCase: data.sub_use_case };
60
+ };
61
+ var unmarshalQualification = (data) => {
62
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Qualification' failed as data isn't a dictionary.`);
63
+ return {
64
+ aiMachine: data.ai_machine ? unmarshalQualificationAiMachine(data.ai_machine) : void 0,
65
+ architectureType: data.architecture_type,
66
+ archiveData: data.archive_data ? unmarshalQualificationArchiveData(data.archive_data) : void 0,
67
+ container: data.container ? unmarshalQualificationContainer(data.container) : void 0,
68
+ deploySoftware: data.deploy_software ? unmarshalQualificationDeploySoftware(data.deploy_software) : void 0,
69
+ hostApplication: data.host_application ? unmarshalQualificationHostApplication(data.host_application) : void 0,
70
+ hostWebsite: data.host_website ? unmarshalQualificationHostWebsite(data.host_website) : void 0,
71
+ otherUseCase: data.other_use_case ? unmarshalQualificationOtherUseCase(data.other_use_case) : void 0,
72
+ setScalewayEnvironment: data.set_scaleway_environment ? unmarshalQualificationSetScalewayEnvironment(data.set_scaleway_environment) : void 0,
73
+ shareData: data.share_data ? unmarshalQualificationShareData(data.share_data) : void 0
74
+ };
143
75
  };
144
76
  const unmarshalProject = (data) => {
145
- if (!isJSONObject(data)) {
146
- throw new TypeError(
147
- `Unmarshalling the type 'Project' failed as data isn't a dictionary.`
148
- );
149
- }
150
- return {
151
- createdAt: unmarshalDate(data.created_at),
152
- description: data.description,
153
- id: data.id,
154
- name: data.name,
155
- organizationId: data.organization_id,
156
- qualification: data.qualification ? unmarshalQualification(data.qualification) : void 0,
157
- updatedAt: unmarshalDate(data.updated_at)
158
- };
77
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
78
+ return {
79
+ createdAt: unmarshalDate(data.created_at),
80
+ description: data.description,
81
+ id: data.id,
82
+ name: data.name,
83
+ organizationId: data.organization_id,
84
+ qualification: data.qualification ? unmarshalQualification(data.qualification) : void 0,
85
+ updatedAt: unmarshalDate(data.updated_at)
86
+ };
159
87
  };
160
88
  const unmarshalCheckContractSignatureResponse = (data) => {
161
- if (!isJSONObject(data)) {
162
- throw new TypeError(
163
- `Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary.`
164
- );
165
- }
166
- return {
167
- created: data.created,
168
- validated: data.validated
169
- };
89
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary.`);
90
+ return {
91
+ created: data.created,
92
+ validated: data.validated
93
+ };
170
94
  };
171
95
  const unmarshalListContractSignaturesResponse = (data) => {
172
- if (!isJSONObject(data)) {
173
- throw new TypeError(
174
- `Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary.`
175
- );
176
- }
177
- return {
178
- contractSignatures: unmarshalArrayOfObject(
179
- data.contract_signatures,
180
- unmarshalContractSignature
181
- ),
182
- totalCount: data.total_count
183
- };
96
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary.`);
97
+ return {
98
+ contractSignatures: unmarshalArrayOfObject(data.contract_signatures, unmarshalContractSignature),
99
+ totalCount: data.total_count
100
+ };
184
101
  };
185
102
  const unmarshalListProjectsResponse = (data) => {
186
- if (!isJSONObject(data)) {
187
- throw new TypeError(
188
- `Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`
189
- );
190
- }
191
- return {
192
- projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
193
- totalCount: data.total_count
194
- };
103
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
104
+ return {
105
+ projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
106
+ totalCount: data.total_count
107
+ };
195
108
  };
196
109
  const unmarshalProjectQualification = (data) => {
197
- if (!isJSONObject(data)) {
198
- throw new TypeError(
199
- `Unmarshalling the type 'ProjectQualification' failed as data isn't a dictionary.`
200
- );
201
- }
202
- return {
203
- projectId: data.project_id,
204
- qualification: data.qualification ? unmarshalQualification(data.qualification) : void 0
205
- };
110
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ProjectQualification' failed as data isn't a dictionary.`);
111
+ return {
112
+ projectId: data.project_id,
113
+ qualification: data.qualification ? unmarshalQualification(data.qualification) : void 0
114
+ };
206
115
  };
207
116
  const marshalContractApiCheckContractSignatureRequest = (request, defaults) => ({
208
- contract_name: request.contractName,
209
- contract_type: request.contractType,
210
- organization_id: request.organizationId ?? defaults.defaultOrganizationId
117
+ contract_name: request.contractName,
118
+ contract_type: request.contractType,
119
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
211
120
  });
212
121
  const marshalContractApiCreateContractSignatureRequest = (request, defaults) => ({
213
- contract_name: request.contractName,
214
- contract_type: request.contractType,
215
- organization_id: request.organizationId ?? defaults.defaultOrganizationId,
216
- validated: request.validated
122
+ contract_name: request.contractName,
123
+ contract_type: request.contractType,
124
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId,
125
+ validated: request.validated
217
126
  });
218
127
  const marshalProjectApiCreateProjectRequest = (request, defaults) => ({
219
- description: request.description,
220
- name: request.name || randomName("proj"),
221
- organization_id: request.organizationId ?? defaults.defaultOrganizationId
222
- });
223
- const marshalQualificationAiMachine = (request, defaults) => ({
224
- sub_use_case: request.subUseCase
128
+ description: request.description,
129
+ name: request.name || randomName("proj"),
130
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
225
131
  });
226
- const marshalQualificationArchiveData = (request, defaults) => ({
227
- sub_use_case: request.subUseCase
228
- });
229
- const marshalQualificationContainer = (request, defaults) => ({
230
- sub_use_case: request.subUseCase
231
- });
232
- const marshalQualificationDeploySoftware = (request, defaults) => ({
233
- sub_use_case: request.subUseCase
234
- });
235
- const marshalQualificationHostApplication = (request, defaults) => ({
236
- sub_use_case: request.subUseCase
237
- });
238
- const marshalQualificationHostWebsite = (request, defaults) => ({
239
- sub_use_case: request.subUseCase
240
- });
241
- const marshalQualificationOtherUseCase = (request, defaults) => ({
242
- sub_use_case: request.subUseCase
243
- });
244
- const marshalQualificationSetScalewayEnvironment = (request, defaults) => ({
245
- sub_use_case: request.subUseCase
246
- });
247
- const marshalQualificationShareData = (request, defaults) => ({
248
- sub_use_case: request.subUseCase
249
- });
250
- const marshalQualification = (request, defaults) => ({
251
- architecture_type: request.architectureType,
252
- ...resolveOneOf([
253
- {
254
- param: "host_website",
255
- value: request.hostWebsite !== void 0 ? marshalQualificationHostWebsite(request.hostWebsite) : void 0
256
- },
257
- {
258
- param: "host_application",
259
- value: request.hostApplication !== void 0 ? marshalQualificationHostApplication(
260
- request.hostApplication
261
- ) : void 0
262
- },
263
- {
264
- param: "deploy_software",
265
- value: request.deploySoftware !== void 0 ? marshalQualificationDeploySoftware(request.deploySoftware) : void 0
266
- },
267
- {
268
- param: "set_scaleway_environment",
269
- value: request.setScalewayEnvironment !== void 0 ? marshalQualificationSetScalewayEnvironment(
270
- request.setScalewayEnvironment
271
- ) : void 0
272
- },
273
- {
274
- param: "ai_machine",
275
- value: request.aiMachine !== void 0 ? marshalQualificationAiMachine(request.aiMachine) : void 0
276
- },
277
- {
278
- param: "container",
279
- value: request.container !== void 0 ? marshalQualificationContainer(request.container) : void 0
280
- },
281
- {
282
- param: "archive_data",
283
- value: request.archiveData !== void 0 ? marshalQualificationArchiveData(request.archiveData) : void 0
284
- },
285
- {
286
- param: "share_data",
287
- value: request.shareData !== void 0 ? marshalQualificationShareData(request.shareData) : void 0
288
- },
289
- {
290
- param: "other_use_case",
291
- value: request.otherUseCase !== void 0 ? marshalQualificationOtherUseCase(request.otherUseCase) : void 0
292
- }
293
- ])
294
- });
295
- const marshalProjectApiSetProjectQualificationRequest = (request, defaults) => ({
296
- qualification: request.qualification !== void 0 ? marshalQualification(request.qualification) : void 0
132
+ var marshalQualificationAiMachine = (request, defaults) => ({ sub_use_case: request.subUseCase });
133
+ var marshalQualificationArchiveData = (request, defaults) => ({ sub_use_case: request.subUseCase });
134
+ var marshalQualificationContainer = (request, defaults) => ({ sub_use_case: request.subUseCase });
135
+ var marshalQualificationDeploySoftware = (request, defaults) => ({ sub_use_case: request.subUseCase });
136
+ var marshalQualificationHostApplication = (request, defaults) => ({ sub_use_case: request.subUseCase });
137
+ var marshalQualificationHostWebsite = (request, defaults) => ({ sub_use_case: request.subUseCase });
138
+ var marshalQualificationOtherUseCase = (request, defaults) => ({ sub_use_case: request.subUseCase });
139
+ var marshalQualificationSetScalewayEnvironment = (request, defaults) => ({ sub_use_case: request.subUseCase });
140
+ var marshalQualificationShareData = (request, defaults) => ({ sub_use_case: request.subUseCase });
141
+ var marshalQualification = (request, defaults) => ({
142
+ architecture_type: request.architectureType,
143
+ ...resolveOneOf([
144
+ {
145
+ param: "host_website",
146
+ value: request.hostWebsite !== void 0 ? marshalQualificationHostWebsite(request.hostWebsite, defaults) : void 0
147
+ },
148
+ {
149
+ param: "host_application",
150
+ value: request.hostApplication !== void 0 ? marshalQualificationHostApplication(request.hostApplication, defaults) : void 0
151
+ },
152
+ {
153
+ param: "deploy_software",
154
+ value: request.deploySoftware !== void 0 ? marshalQualificationDeploySoftware(request.deploySoftware, defaults) : void 0
155
+ },
156
+ {
157
+ param: "set_scaleway_environment",
158
+ value: request.setScalewayEnvironment !== void 0 ? marshalQualificationSetScalewayEnvironment(request.setScalewayEnvironment, defaults) : void 0
159
+ },
160
+ {
161
+ param: "ai_machine",
162
+ value: request.aiMachine !== void 0 ? marshalQualificationAiMachine(request.aiMachine, defaults) : void 0
163
+ },
164
+ {
165
+ param: "container",
166
+ value: request.container !== void 0 ? marshalQualificationContainer(request.container, defaults) : void 0
167
+ },
168
+ {
169
+ param: "archive_data",
170
+ value: request.archiveData !== void 0 ? marshalQualificationArchiveData(request.archiveData, defaults) : void 0
171
+ },
172
+ {
173
+ param: "share_data",
174
+ value: request.shareData !== void 0 ? marshalQualificationShareData(request.shareData, defaults) : void 0
175
+ },
176
+ {
177
+ param: "other_use_case",
178
+ value: request.otherUseCase !== void 0 ? marshalQualificationOtherUseCase(request.otherUseCase, defaults) : void 0
179
+ }
180
+ ])
297
181
  });
182
+ const marshalProjectApiSetProjectQualificationRequest = (request, defaults) => ({ qualification: request.qualification !== void 0 ? marshalQualification(request.qualification, defaults) : void 0 });
298
183
  const marshalProjectApiUpdateProjectRequest = (request, defaults) => ({
299
- description: request.description,
300
- name: request.name
184
+ description: request.description,
185
+ name: request.name
301
186
  });
302
- export {
303
- marshalContractApiCheckContractSignatureRequest,
304
- marshalContractApiCreateContractSignatureRequest,
305
- marshalProjectApiCreateProjectRequest,
306
- marshalProjectApiSetProjectQualificationRequest,
307
- marshalProjectApiUpdateProjectRequest,
308
- unmarshalCheckContractSignatureResponse,
309
- unmarshalContractSignature,
310
- unmarshalListContractSignaturesResponse,
311
- unmarshalListProjectsResponse,
312
- unmarshalProject,
313
- unmarshalProjectQualification
314
- };
187
+ export { marshalContractApiCheckContractSignatureRequest, marshalContractApiCreateContractSignatureRequest, marshalProjectApiCreateProjectRequest, marshalProjectApiSetProjectQualificationRequest, marshalProjectApiUpdateProjectRequest, unmarshalCheckContractSignatureResponse, unmarshalContractSignature, unmarshalListContractSignaturesResponse, unmarshalListProjectsResponse, unmarshalProject, unmarshalProjectQualification };
@@ -1,61 +1,47 @@
1
- const ContractApiCheckContractSignatureRequest = {
2
- contractName: {
3
- minLength: 1
4
- }
5
- };
6
- const ContractApiCreateContractSignatureRequest = {
7
- contractName: {
8
- minLength: 1
9
- }
10
- };
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
3
+ ContractApiCheckContractSignatureRequest: () => ContractApiCheckContractSignatureRequest,
4
+ ContractApiCreateContractSignatureRequest: () => ContractApiCreateContractSignatureRequest,
5
+ ContractApiListContractSignaturesRequest: () => ContractApiListContractSignaturesRequest,
6
+ ProjectApiCreateProjectRequest: () => ProjectApiCreateProjectRequest,
7
+ ProjectApiListProjectsRequest: () => ProjectApiListProjectsRequest,
8
+ ProjectApiUpdateProjectRequest: () => ProjectApiUpdateProjectRequest
9
+ });
10
+ const ContractApiCheckContractSignatureRequest = { contractName: { minLength: 1 } };
11
+ const ContractApiCreateContractSignatureRequest = { contractName: { minLength: 1 } };
11
12
  const ContractApiListContractSignaturesRequest = {
12
- page: {
13
- greaterThan: 0
14
- },
15
- pageSize: {
16
- greaterThanOrEqual: 1,
17
- lessThanOrEqual: 100
18
- }
13
+ page: { greaterThan: 0 },
14
+ pageSize: {
15
+ greaterThanOrEqual: 1,
16
+ lessThanOrEqual: 100
17
+ }
19
18
  };
20
19
  const ProjectApiCreateProjectRequest = {
21
- description: {
22
- maxLength: 200
23
- },
24
- name: {
25
- maxLength: 64,
26
- minLength: 1,
27
- pattern: /^[a-zA-Z0-9\._\- ]+$/
28
- }
20
+ description: { maxLength: 200 },
21
+ name: {
22
+ maxLength: 64,
23
+ minLength: 1,
24
+ pattern: /^[a-zA-Z0-9\._\- ]+$/
25
+ }
29
26
  };
30
27
  const ProjectApiListProjectsRequest = {
31
- name: {
32
- maxLength: 64,
33
- minLength: 1,
34
- pattern: /^[a-zA-Z0-9\._\- ]+$/
35
- },
36
- page: {
37
- greaterThan: 0
38
- },
39
- pageSize: {
40
- greaterThanOrEqual: 1,
41
- lessThanOrEqual: 100
42
- }
28
+ name: {
29
+ maxLength: 64,
30
+ minLength: 1,
31
+ pattern: /^[a-zA-Z0-9\._\- ]+$/
32
+ },
33
+ page: { greaterThan: 0 },
34
+ pageSize: {
35
+ greaterThanOrEqual: 1,
36
+ lessThanOrEqual: 100
37
+ }
43
38
  };
44
39
  const ProjectApiUpdateProjectRequest = {
45
- description: {
46
- maxLength: 200
47
- },
48
- name: {
49
- maxLength: 64,
50
- minLength: 1,
51
- pattern: /^[a-zA-Z0-9\._\- ]+$/
52
- }
53
- };
54
- export {
55
- ContractApiCheckContractSignatureRequest,
56
- ContractApiCreateContractSignatureRequest,
57
- ContractApiListContractSignaturesRequest,
58
- ProjectApiCreateProjectRequest,
59
- ProjectApiListProjectsRequest,
60
- ProjectApiUpdateProjectRequest
40
+ description: { maxLength: 200 },
41
+ name: {
42
+ maxLength: 64,
43
+ minLength: 1,
44
+ pattern: /^[a-zA-Z0-9\._\- ]+$/
45
+ }
61
46
  };
47
+ export { validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-account",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Scaleway SDK account",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.0"
30
+ "@scaleway/sdk-std": "2.2.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.0"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",