diff --git a/packages/clients/src/api/account/v3/marshalling.gen.ts b/packages/clients/src/api/account/v3/marshalling.gen.ts index ead7600e6..144669d7e 100644 --- a/packages/clients/src/api/account/v3/marshalling.gen.ts +++ b/packages/clients/src/api/account/v3/marshalling.gen.ts @@ -69,71 +69,6 @@ export const unmarshalContractSignature = ( } as ContractSignature } -export const unmarshalProject = (data: unknown): Project => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'Project' failed as data isn't a dictionary.`, - ) - } - - return { - createdAt: unmarshalDate(data.created_at), - description: data.description, - id: data.id, - name: data.name, - organizationId: data.organization_id, - updatedAt: unmarshalDate(data.updated_at), - } as Project -} - -export const unmarshalCheckContractSignatureResponse = ( - data: unknown, -): CheckContractSignatureResponse => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary.`, - ) - } - - return { - created: data.created, - validated: data.validated, - } as CheckContractSignatureResponse -} - -export const unmarshalListContractSignaturesResponse = ( - data: unknown, -): ListContractSignaturesResponse => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary.`, - ) - } - - return { - contractSignatures: unmarshalArrayOfObject( - data.contract_signatures, - unmarshalContractSignature, - ), - totalCount: data.total_count, - } as ListContractSignaturesResponse -} - -export const unmarshalListProjectsResponse = ( - data: unknown, -): ListProjectsResponse => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`, - ) - } - - return { - projects: unmarshalArrayOfObject(data.projects, unmarshalProject), - totalCount: data.total_count, - } as ListProjectsResponse -} - const unmarshalQualificationAiMachine = ( data: unknown, ): QualificationAiMachine => { @@ -301,6 +236,74 @@ const unmarshalQualification = (data: unknown): Qualification => { } as Qualification } +export const unmarshalProject = (data: unknown): Project => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Project' failed as data isn't a dictionary.`, + ) + } + + return { + createdAt: unmarshalDate(data.created_at), + description: data.description, + id: data.id, + name: data.name, + organizationId: data.organization_id, + qualification: data.qualification + ? unmarshalQualification(data.qualification) + : undefined, + updatedAt: unmarshalDate(data.updated_at), + } as Project +} + +export const unmarshalCheckContractSignatureResponse = ( + data: unknown, +): CheckContractSignatureResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary.`, + ) + } + + return { + created: data.created, + validated: data.validated, + } as CheckContractSignatureResponse +} + +export const unmarshalListContractSignaturesResponse = ( + data: unknown, +): ListContractSignaturesResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary.`, + ) + } + + return { + contractSignatures: unmarshalArrayOfObject( + data.contract_signatures, + unmarshalContractSignature, + ), + totalCount: data.total_count, + } as ListContractSignaturesResponse +} + +export const unmarshalListProjectsResponse = ( + data: unknown, +): ListProjectsResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`, + ) + } + + return { + projects: unmarshalArrayOfObject(data.projects, unmarshalProject), + totalCount: data.total_count, + } as ListProjectsResponse +} + export const unmarshalProjectQualification = ( data: unknown, ): ProjectQualification => { diff --git a/packages/clients/src/api/account/v3/types.gen.ts b/packages/clients/src/api/account/v3/types.gen.ts index f4a91ede5..4623bda40 100644 --- a/packages/clients/src/api/account/v3/types.gen.ts +++ b/packages/clients/src/api/account/v3/types.gen.ts @@ -62,33 +62,6 @@ export type QualificationSetScalewayEnvironmentSubUseCase = export type QualificationShareDataSubUseCase = 'unknown_sub_use_case' -export interface Contract { - /** - * ID of the contract. - */ - id: string - /** - * The type of the contract. - */ - type: ContractType - /** - * The name of the contract. - */ - name: string - /** - * The version of the contract. - */ - version: number - /** - * The creation date of the contract. - */ - createdAt?: Date - /** - * The last modification date of the contract. - */ - updatedAt?: Date -} - export interface QualificationAiMachine { subUseCase: QualificationAiMachineSubUseCase } @@ -125,58 +98,31 @@ export interface QualificationShareData { subUseCase: QualificationShareDataSubUseCase } -export interface ContractSignature { +export interface Contract { /** - * ID of the contract signature. + * ID of the contract. */ id: string /** - * The Organization ID which signed the contract. - */ - organizationId: string - /** - * The creation date of the contract signature. - */ - createdAt?: Date - /** - * The signing date of the contract signature. - */ - signedAt?: Date - /** - * The expiration date of the contract signature. - */ - expiresAt?: Date - /** - * The contract signed. - */ - contract?: Contract -} - -export interface Project { - /** - * ID of the Project. + * The type of the contract. */ - id: string + type: ContractType /** - * Name of the Project. + * The name of the contract. */ name: string /** - * Organization ID of the Project. + * The version of the contract. */ - organizationId: string + version: number /** - * Creation date of the Project. + * The creation date of the contract. */ createdAt?: Date /** - * Update date of the Project. + * The last modification date of the contract. */ updatedAt?: Date - /** - * Description of the Project. - */ - description: string } export interface Qualification { @@ -231,6 +177,64 @@ export interface Qualification { otherUseCase?: QualificationOtherUseCase } +export interface ContractSignature { + /** + * ID of the contract signature. + */ + id: string + /** + * The Organization ID which signed the contract. + */ + organizationId: string + /** + * The creation date of the contract signature. + */ + createdAt?: Date + /** + * The signing date of the contract signature. + */ + signedAt?: Date + /** + * The expiration date of the contract signature. + */ + expiresAt?: Date + /** + * The contract signed. + */ + contract?: Contract +} + +export interface Project { + /** + * ID of the Project. + */ + id: string + /** + * Name of the Project. + */ + name: string + /** + * Organization ID of the Project. + */ + organizationId: string + /** + * Creation date of the Project. + */ + createdAt?: Date + /** + * Update date of the Project. + */ + updatedAt?: Date + /** + * Description of the Project. + */ + description: string + /** + * Qualification of the Project. + */ + qualification?: Qualification +} + export interface CheckContractSignatureResponse { /** * Whether a signature has been requested for this contract.