@scaleway/sdk-account 2.2.2 → 2.3.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/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,196 +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
- {
15
- method: "GET",
16
- path: `/account/v3/contract-signatures/${validatePathParam("contractSignatureId", request.contractSignatureId)}/download`,
17
- urlParams: urlParams(
18
- ["dl", 1],
19
- ["locale", request.locale]
20
- ),
21
- responseType: "blob"
22
- }
23
- );
24
- /**
25
- * Create a signature for your Organization for the latest version of the requested contract.
26
- *
27
- * @param request - The request {@link ContractApiCreateContractSignatureRequest}
28
- * @returns A Promise of ContractSignature
29
- */
30
- createContractSignature = (request) => this.client.fetch(
31
- {
32
- body: JSON.stringify(
33
- marshalContractApiCreateContractSignatureRequest(request, this.client.settings)
34
- ),
35
- headers: jsonContentHeaders,
36
- method: "POST",
37
- path: `/account/v3/contract-signatures`
38
- },
39
- unmarshalContractSignature
40
- );
41
- /**
42
- * Sign a contract for your Organization.
43
- *
44
- * @param request - The request {@link ContractApiValidateContractSignatureRequest}
45
- * @returns A Promise of ContractSignature
46
- */
47
- validateContractSignature = (request) => this.client.fetch(
48
- {
49
- body: "{}",
50
- headers: jsonContentHeaders,
51
- method: "POST",
52
- path: `/account/v3/contract-signatures/${validatePathParam("contractSignatureId", request.contractSignatureId)}/validate`
53
- },
54
- unmarshalContractSignature
55
- );
56
- /**
57
- * Check if a contract is signed for your Organization.
58
- *
59
- * @param request - The request {@link ContractApiCheckContractSignatureRequest}
60
- * @returns A Promise of CheckContractSignatureResponse
61
- */
62
- checkContractSignature = (request) => this.client.fetch(
63
- {
64
- body: JSON.stringify(
65
- marshalContractApiCheckContractSignatureRequest(request, this.client.settings)
66
- ),
67
- headers: jsonContentHeaders,
68
- method: "POST",
69
- path: `/account/v3/contract-signatures/check`
70
- },
71
- unmarshalCheckContractSignatureResponse
72
- );
73
- pageOfListContractSignatures = (request = {}) => this.client.fetch(
74
- {
75
- method: "GET",
76
- path: `/account/v3/contract-signatures`,
77
- urlParams: urlParams(
78
- ["order_by", request.orderBy],
79
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
80
- ["page", request.page],
81
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
82
- )
83
- },
84
- unmarshalListContractSignaturesResponse
85
- );
86
- /**
87
- * List contract signatures for an Organization.
88
- *
89
- * @param request - The request {@link ContractApiListContractSignaturesRequest}
90
- * @returns A Promise of ListContractSignaturesResponse
91
- */
92
- listContractSignatures = (request = {}) => enrichForPagination("contractSignatures", this.pageOfListContractSignatures, request);
93
- }
94
- class ProjectAPI extends API {
95
- /**
96
- * Create a new Project for an Organization. Generate a new Project for an Organization, specifying its configuration including name and description.
97
- *
98
- * @param request - The request {@link ProjectApiCreateProjectRequest}
99
- * @returns A Promise of Project
100
- */
101
- createProject = (request) => this.client.fetch(
102
- {
103
- body: JSON.stringify(
104
- marshalProjectApiCreateProjectRequest(request, this.client.settings)
105
- ),
106
- headers: jsonContentHeaders,
107
- method: "POST",
108
- path: `/account/v3/projects`
109
- },
110
- unmarshalProject
111
- );
112
- pageOfListProjects = (request = {}) => this.client.fetch(
113
- {
114
- method: "GET",
115
- path: `/account/v3/projects`,
116
- urlParams: urlParams(
117
- ["name", request.name],
118
- ["order_by", request.orderBy],
119
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
120
- ["page", request.page],
121
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
122
- ["project_ids", request.projectIds]
123
- )
124
- },
125
- unmarshalListProjectsResponse
126
- );
127
- /**
128
- * 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.
129
- *
130
- * @param request - The request {@link ProjectApiListProjectsRequest}
131
- * @returns A Promise of ListProjectsResponse
132
- */
133
- listProjects = (request = {}) => enrichForPagination("projects", this.pageOfListProjects, request);
134
- /**
135
- * 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.
136
- *
137
- * @param request - The request {@link ProjectApiGetProjectRequest}
138
- * @returns A Promise of Project
139
- */
140
- getProject = (request = {}) => this.client.fetch(
141
- {
142
- method: "GET",
143
- path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
144
- },
145
- unmarshalProject
146
- );
147
- /**
148
- * 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.
149
- *
150
- * @param request - The request {@link ProjectApiDeleteProjectRequest}
151
- */
152
- deleteProject = (request = {}) => this.client.fetch(
153
- {
154
- method: "DELETE",
155
- path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
156
- }
157
- );
158
- /**
159
- * Update Project. Update the parameters of an existing Project, specified by its Project ID. These parameters include the name and description.
160
- *
161
- * @param request - The request {@link ProjectApiUpdateProjectRequest}
162
- * @returns A Promise of Project
163
- */
164
- updateProject = (request = {}) => this.client.fetch(
165
- {
166
- body: JSON.stringify(
167
- marshalProjectApiUpdateProjectRequest(request, this.client.settings)
168
- ),
169
- headers: jsonContentHeaders,
170
- method: "PATCH",
171
- path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
172
- },
173
- unmarshalProject
174
- );
175
- /**
176
- * 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.
177
- *
178
- * @param request - The request {@link ProjectApiSetProjectQualificationRequest}
179
- * @returns A Promise of ProjectQualification
180
- */
181
- setProjectQualification = (request = {}) => this.client.fetch(
182
- {
183
- body: JSON.stringify(
184
- marshalProjectApiSetProjectQualificationRequest(request, this.client.settings)
185
- ),
186
- headers: jsonContentHeaders,
187
- method: "POST",
188
- path: `/account/v3/projects/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/project-qualification`
189
- },
190
- unmarshalProjectQualification
191
- );
192
- }
193
- export {
194
- ContractAPI,
195
- 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);
196
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,305 +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(data.set_scaleway_environment) : void 0,
139
- shareData: data.share_data ? unmarshalQualificationShareData(data.share_data) : void 0
140
- };
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
+ };
141
75
  };
142
76
  const unmarshalProject = (data) => {
143
- if (!isJSONObject(data)) {
144
- throw new TypeError(
145
- `Unmarshalling the type 'Project' failed as data isn't a dictionary.`
146
- );
147
- }
148
- return {
149
- createdAt: unmarshalDate(data.created_at),
150
- description: data.description,
151
- id: data.id,
152
- name: data.name,
153
- organizationId: data.organization_id,
154
- qualification: data.qualification ? unmarshalQualification(data.qualification) : void 0,
155
- updatedAt: unmarshalDate(data.updated_at)
156
- };
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
+ };
157
87
  };
158
88
  const unmarshalCheckContractSignatureResponse = (data) => {
159
- if (!isJSONObject(data)) {
160
- throw new TypeError(
161
- `Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary.`
162
- );
163
- }
164
- return {
165
- created: data.created,
166
- validated: data.validated
167
- };
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
+ };
168
94
  };
169
95
  const unmarshalListContractSignaturesResponse = (data) => {
170
- if (!isJSONObject(data)) {
171
- throw new TypeError(
172
- `Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary.`
173
- );
174
- }
175
- return {
176
- contractSignatures: unmarshalArrayOfObject(data.contract_signatures, unmarshalContractSignature),
177
- totalCount: data.total_count
178
- };
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
+ };
179
101
  };
180
102
  const unmarshalListProjectsResponse = (data) => {
181
- if (!isJSONObject(data)) {
182
- throw new TypeError(
183
- `Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`
184
- );
185
- }
186
- return {
187
- projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
188
- totalCount: data.total_count
189
- };
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
+ };
190
108
  };
191
109
  const unmarshalProjectQualification = (data) => {
192
- if (!isJSONObject(data)) {
193
- throw new TypeError(
194
- `Unmarshalling the type 'ProjectQualification' failed as data isn't a dictionary.`
195
- );
196
- }
197
- return {
198
- projectId: data.project_id,
199
- qualification: data.qualification ? unmarshalQualification(data.qualification) : void 0
200
- };
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
+ };
201
115
  };
202
116
  const marshalContractApiCheckContractSignatureRequest = (request, defaults) => ({
203
- contract_name: request.contractName,
204
- contract_type: request.contractType,
205
- organization_id: request.organizationId ?? defaults.defaultOrganizationId
117
+ contract_name: request.contractName,
118
+ contract_type: request.contractType,
119
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
206
120
  });
207
121
  const marshalContractApiCreateContractSignatureRequest = (request, defaults) => ({
208
- contract_name: request.contractName,
209
- contract_type: request.contractType,
210
- organization_id: request.organizationId ?? defaults.defaultOrganizationId,
211
- validated: request.validated
122
+ contract_name: request.contractName,
123
+ contract_type: request.contractType,
124
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId,
125
+ validated: request.validated
212
126
  });
213
127
  const marshalProjectApiCreateProjectRequest = (request, defaults) => ({
214
- description: request.description,
215
- name: request.name || randomName("proj"),
216
- organization_id: request.organizationId ?? defaults.defaultOrganizationId
217
- });
218
- const marshalQualificationAiMachine = (request, defaults) => ({
219
- sub_use_case: request.subUseCase
128
+ description: request.description,
129
+ name: request.name || randomName("proj"),
130
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
220
131
  });
221
- const marshalQualificationArchiveData = (request, defaults) => ({
222
- sub_use_case: request.subUseCase
223
- });
224
- const marshalQualificationContainer = (request, defaults) => ({
225
- sub_use_case: request.subUseCase
226
- });
227
- const marshalQualificationDeploySoftware = (request, defaults) => ({
228
- sub_use_case: request.subUseCase
229
- });
230
- const marshalQualificationHostApplication = (request, defaults) => ({
231
- sub_use_case: request.subUseCase
232
- });
233
- const marshalQualificationHostWebsite = (request, defaults) => ({
234
- sub_use_case: request.subUseCase
235
- });
236
- const marshalQualificationOtherUseCase = (request, defaults) => ({
237
- sub_use_case: request.subUseCase
238
- });
239
- const marshalQualificationSetScalewayEnvironment = (request, defaults) => ({
240
- sub_use_case: request.subUseCase
241
- });
242
- const marshalQualificationShareData = (request, defaults) => ({
243
- sub_use_case: request.subUseCase
244
- });
245
- const marshalQualification = (request, defaults) => ({
246
- architecture_type: request.architectureType,
247
- ...resolveOneOf([
248
- {
249
- param: "host_website",
250
- value: request.hostWebsite !== void 0 ? marshalQualificationHostWebsite(request.hostWebsite) : void 0
251
- },
252
- {
253
- param: "host_application",
254
- value: request.hostApplication !== void 0 ? marshalQualificationHostApplication(request.hostApplication) : void 0
255
- },
256
- {
257
- param: "deploy_software",
258
- value: request.deploySoftware !== void 0 ? marshalQualificationDeploySoftware(request.deploySoftware) : void 0
259
- },
260
- {
261
- param: "set_scaleway_environment",
262
- value: request.setScalewayEnvironment !== void 0 ? marshalQualificationSetScalewayEnvironment(request.setScalewayEnvironment) : void 0
263
- },
264
- {
265
- param: "ai_machine",
266
- value: request.aiMachine !== void 0 ? marshalQualificationAiMachine(request.aiMachine) : void 0
267
- },
268
- {
269
- param: "container",
270
- value: request.container !== void 0 ? marshalQualificationContainer(request.container) : void 0
271
- },
272
- {
273
- param: "archive_data",
274
- value: request.archiveData !== void 0 ? marshalQualificationArchiveData(request.archiveData) : void 0
275
- },
276
- {
277
- param: "share_data",
278
- value: request.shareData !== void 0 ? marshalQualificationShareData(request.shareData) : void 0
279
- },
280
- {
281
- param: "other_use_case",
282
- value: request.otherUseCase !== void 0 ? marshalQualificationOtherUseCase(request.otherUseCase) : void 0
283
- }
284
- ])
285
- });
286
- const marshalProjectApiSetProjectQualificationRequest = (request, defaults) => ({
287
- 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
+ ])
288
181
  });
182
+ const marshalProjectApiSetProjectQualificationRequest = (request, defaults) => ({ qualification: request.qualification !== void 0 ? marshalQualification(request.qualification, defaults) : void 0 });
289
183
  const marshalProjectApiUpdateProjectRequest = (request, defaults) => ({
290
- description: request.description,
291
- name: request.name
184
+ description: request.description,
185
+ name: request.name
292
186
  });
293
- export {
294
- marshalContractApiCheckContractSignatureRequest,
295
- marshalContractApiCreateContractSignatureRequest,
296
- marshalProjectApiCreateProjectRequest,
297
- marshalProjectApiSetProjectQualificationRequest,
298
- marshalProjectApiUpdateProjectRequest,
299
- unmarshalCheckContractSignatureResponse,
300
- unmarshalContractSignature,
301
- unmarshalListContractSignaturesResponse,
302
- unmarshalListProjectsResponse,
303
- unmarshalProject,
304
- unmarshalProjectQualification
305
- };
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.2",
3
+ "version": "2.3.1",
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.1"
30
+ "@scaleway/sdk-std": "2.2.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.1"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",