Skip to content

Commit 2e57208

Browse files
authored
feat(account): add qualification field to project response (#2004)
1 parent 3a43195 commit 2e57208

File tree

2 files changed

+135
-128
lines changed

2 files changed

+135
-128
lines changed

packages/clients/src/api/account/v3/marshalling.gen.ts

Lines changed: 68 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -69,71 +69,6 @@ export const unmarshalContractSignature = (
6969
} as ContractSignature
7070
}
7171

72-
export const unmarshalProject = (data: unknown): Project => {
73-
if (!isJSONObject(data)) {
74-
throw new TypeError(
75-
`Unmarshalling the type 'Project' failed as data isn't a dictionary.`,
76-
)
77-
}
78-
79-
return {
80-
createdAt: unmarshalDate(data.created_at),
81-
description: data.description,
82-
id: data.id,
83-
name: data.name,
84-
organizationId: data.organization_id,
85-
updatedAt: unmarshalDate(data.updated_at),
86-
} as Project
87-
}
88-
89-
export const unmarshalCheckContractSignatureResponse = (
90-
data: unknown,
91-
): CheckContractSignatureResponse => {
92-
if (!isJSONObject(data)) {
93-
throw new TypeError(
94-
`Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary.`,
95-
)
96-
}
97-
98-
return {
99-
created: data.created,
100-
validated: data.validated,
101-
} as CheckContractSignatureResponse
102-
}
103-
104-
export const unmarshalListContractSignaturesResponse = (
105-
data: unknown,
106-
): ListContractSignaturesResponse => {
107-
if (!isJSONObject(data)) {
108-
throw new TypeError(
109-
`Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary.`,
110-
)
111-
}
112-
113-
return {
114-
contractSignatures: unmarshalArrayOfObject(
115-
data.contract_signatures,
116-
unmarshalContractSignature,
117-
),
118-
totalCount: data.total_count,
119-
} as ListContractSignaturesResponse
120-
}
121-
122-
export const unmarshalListProjectsResponse = (
123-
data: unknown,
124-
): ListProjectsResponse => {
125-
if (!isJSONObject(data)) {
126-
throw new TypeError(
127-
`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`,
128-
)
129-
}
130-
131-
return {
132-
projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
133-
totalCount: data.total_count,
134-
} as ListProjectsResponse
135-
}
136-
13772
const unmarshalQualificationAiMachine = (
13873
data: unknown,
13974
): QualificationAiMachine => {
@@ -301,6 +236,74 @@ const unmarshalQualification = (data: unknown): Qualification => {
301236
} as Qualification
302237
}
303238

239+
export const unmarshalProject = (data: unknown): Project => {
240+
if (!isJSONObject(data)) {
241+
throw new TypeError(
242+
`Unmarshalling the type 'Project' failed as data isn't a dictionary.`,
243+
)
244+
}
245+
246+
return {
247+
createdAt: unmarshalDate(data.created_at),
248+
description: data.description,
249+
id: data.id,
250+
name: data.name,
251+
organizationId: data.organization_id,
252+
qualification: data.qualification
253+
? unmarshalQualification(data.qualification)
254+
: undefined,
255+
updatedAt: unmarshalDate(data.updated_at),
256+
} as Project
257+
}
258+
259+
export const unmarshalCheckContractSignatureResponse = (
260+
data: unknown,
261+
): CheckContractSignatureResponse => {
262+
if (!isJSONObject(data)) {
263+
throw new TypeError(
264+
`Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary.`,
265+
)
266+
}
267+
268+
return {
269+
created: data.created,
270+
validated: data.validated,
271+
} as CheckContractSignatureResponse
272+
}
273+
274+
export const unmarshalListContractSignaturesResponse = (
275+
data: unknown,
276+
): ListContractSignaturesResponse => {
277+
if (!isJSONObject(data)) {
278+
throw new TypeError(
279+
`Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary.`,
280+
)
281+
}
282+
283+
return {
284+
contractSignatures: unmarshalArrayOfObject(
285+
data.contract_signatures,
286+
unmarshalContractSignature,
287+
),
288+
totalCount: data.total_count,
289+
} as ListContractSignaturesResponse
290+
}
291+
292+
export const unmarshalListProjectsResponse = (
293+
data: unknown,
294+
): ListProjectsResponse => {
295+
if (!isJSONObject(data)) {
296+
throw new TypeError(
297+
`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`,
298+
)
299+
}
300+
301+
return {
302+
projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
303+
totalCount: data.total_count,
304+
} as ListProjectsResponse
305+
}
306+
304307
export const unmarshalProjectQualification = (
305308
data: unknown,
306309
): ProjectQualification => {

packages/clients/src/api/account/v3/types.gen.ts

Lines changed: 67 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -62,33 +62,6 @@ export type QualificationSetScalewayEnvironmentSubUseCase =
6262

6363
export type QualificationShareDataSubUseCase = 'unknown_sub_use_case'
6464

65-
export interface Contract {
66-
/**
67-
* ID of the contract.
68-
*/
69-
id: string
70-
/**
71-
* The type of the contract.
72-
*/
73-
type: ContractType
74-
/**
75-
* The name of the contract.
76-
*/
77-
name: string
78-
/**
79-
* The version of the contract.
80-
*/
81-
version: number
82-
/**
83-
* The creation date of the contract.
84-
*/
85-
createdAt?: Date
86-
/**
87-
* The last modification date of the contract.
88-
*/
89-
updatedAt?: Date
90-
}
91-
9265
export interface QualificationAiMachine {
9366
subUseCase: QualificationAiMachineSubUseCase
9467
}
@@ -125,58 +98,31 @@ export interface QualificationShareData {
12598
subUseCase: QualificationShareDataSubUseCase
12699
}
127100

128-
export interface ContractSignature {
101+
export interface Contract {
129102
/**
130-
* ID of the contract signature.
103+
* ID of the contract.
131104
*/
132105
id: string
133106
/**
134-
* The Organization ID which signed the contract.
135-
*/
136-
organizationId: string
137-
/**
138-
* The creation date of the contract signature.
139-
*/
140-
createdAt?: Date
141-
/**
142-
* The signing date of the contract signature.
143-
*/
144-
signedAt?: Date
145-
/**
146-
* The expiration date of the contract signature.
147-
*/
148-
expiresAt?: Date
149-
/**
150-
* The contract signed.
151-
*/
152-
contract?: Contract
153-
}
154-
155-
export interface Project {
156-
/**
157-
* ID of the Project.
107+
* The type of the contract.
158108
*/
159-
id: string
109+
type: ContractType
160110
/**
161-
* Name of the Project.
111+
* The name of the contract.
162112
*/
163113
name: string
164114
/**
165-
* Organization ID of the Project.
115+
* The version of the contract.
166116
*/
167-
organizationId: string
117+
version: number
168118
/**
169-
* Creation date of the Project.
119+
* The creation date of the contract.
170120
*/
171121
createdAt?: Date
172122
/**
173-
* Update date of the Project.
123+
* The last modification date of the contract.
174124
*/
175125
updatedAt?: Date
176-
/**
177-
* Description of the Project.
178-
*/
179-
description: string
180126
}
181127

182128
export interface Qualification {
@@ -231,6 +177,64 @@ export interface Qualification {
231177
otherUseCase?: QualificationOtherUseCase
232178
}
233179

180+
export interface ContractSignature {
181+
/**
182+
* ID of the contract signature.
183+
*/
184+
id: string
185+
/**
186+
* The Organization ID which signed the contract.
187+
*/
188+
organizationId: string
189+
/**
190+
* The creation date of the contract signature.
191+
*/
192+
createdAt?: Date
193+
/**
194+
* The signing date of the contract signature.
195+
*/
196+
signedAt?: Date
197+
/**
198+
* The expiration date of the contract signature.
199+
*/
200+
expiresAt?: Date
201+
/**
202+
* The contract signed.
203+
*/
204+
contract?: Contract
205+
}
206+
207+
export interface Project {
208+
/**
209+
* ID of the Project.
210+
*/
211+
id: string
212+
/**
213+
* Name of the Project.
214+
*/
215+
name: string
216+
/**
217+
* Organization ID of the Project.
218+
*/
219+
organizationId: string
220+
/**
221+
* Creation date of the Project.
222+
*/
223+
createdAt?: Date
224+
/**
225+
* Update date of the Project.
226+
*/
227+
updatedAt?: Date
228+
/**
229+
* Description of the Project.
230+
*/
231+
description: string
232+
/**
233+
* Qualification of the Project.
234+
*/
235+
qualification?: Qualification
236+
}
237+
234238
export interface CheckContractSignatureResponse {
235239
/**
236240
* Whether a signature has been requested for this contract.

0 commit comments

Comments
 (0)