Skip to content

feat(account): add qualification field to project response #2004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 68 additions & 65 deletions packages/clients/src/api/account/v3/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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 => {
Expand Down
130 changes: 67 additions & 63 deletions packages/clients/src/api/account/v3/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down
Loading