Skip to content

Commit 17474eb

Browse files
authored
feat(account): add qualification field to project response (#949)
1 parent 68ea8ae commit 17474eb

File tree

6 files changed

+362
-340
lines changed

6 files changed

+362
-340
lines changed

scaleway-async/scaleway_async/account/v3/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from .types import QualificationOtherUseCaseSubUseCase
1414
from .types import QualificationSetScalewayEnvironmentSubUseCase
1515
from .types import QualificationShareDataSubUseCase
16-
from .types import Contract
1716
from .types import QualificationAiMachine
1817
from .types import QualificationArchiveData
1918
from .types import QualificationContainer
@@ -23,9 +22,10 @@
2322
from .types import QualificationOtherUseCase
2423
from .types import QualificationSetScalewayEnvironment
2524
from .types import QualificationShareData
25+
from .types import Contract
26+
from .types import Qualification
2627
from .types import ContractSignature
2728
from .types import Project
28-
from .types import Qualification
2929
from .types import CheckContractSignatureResponse
3030
from .types import ContractApiCheckContractSignatureRequest
3131
from .types import ContractApiCreateContractSignatureRequest
@@ -58,7 +58,6 @@
5858
"QualificationOtherUseCaseSubUseCase",
5959
"QualificationSetScalewayEnvironmentSubUseCase",
6060
"QualificationShareDataSubUseCase",
61-
"Contract",
6261
"QualificationAiMachine",
6362
"QualificationArchiveData",
6463
"QualificationContainer",
@@ -68,9 +67,10 @@
6867
"QualificationOtherUseCase",
6968
"QualificationSetScalewayEnvironment",
7069
"QualificationShareData",
70+
"Contract",
71+
"Qualification",
7172
"ContractSignature",
7273
"Project",
73-
"Qualification",
7474
"CheckContractSignatureResponse",
7575
"ContractApiCheckContractSignatureRequest",
7676
"ContractApiCreateContractSignatureRequest",

scaleway-async/scaleway_async/account/v3/marshalling.py

Lines changed: 116 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
from .types import (
1313
Contract,
1414
ContractSignature,
15-
Project,
16-
CheckContractSignatureResponse,
17-
ListContractSignaturesResponse,
18-
ListProjectsResponse,
1915
QualificationAiMachine,
2016
QualificationArchiveData,
2117
QualificationContainer,
@@ -26,6 +22,10 @@
2622
QualificationSetScalewayEnvironment,
2723
QualificationShareData,
2824
Qualification,
25+
Project,
26+
CheckContractSignatureResponse,
27+
ListContractSignaturesResponse,
28+
ListProjectsResponse,
2929
ProjectQualification,
3030
ContractApiCheckContractSignatureRequest,
3131
ContractApiCreateContractSignatureRequest,
@@ -117,112 +117,6 @@ def unmarshal_ContractSignature(data: Any) -> ContractSignature:
117117
return ContractSignature(**args)
118118

119119

120-
def unmarshal_Project(data: Any) -> Project:
121-
if not isinstance(data, dict):
122-
raise TypeError(
123-
"Unmarshalling the type 'Project' failed as data isn't a dictionary."
124-
)
125-
126-
args: Dict[str, Any] = {}
127-
128-
field = data.get("id", None)
129-
if field is not None:
130-
args["id"] = field
131-
132-
field = data.get("name", None)
133-
if field is not None:
134-
args["name"] = field
135-
136-
field = data.get("organization_id", None)
137-
if field is not None:
138-
args["organization_id"] = field
139-
140-
field = data.get("description", None)
141-
if field is not None:
142-
args["description"] = field
143-
144-
field = data.get("created_at", None)
145-
if field is not None:
146-
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
147-
else:
148-
args["created_at"] = None
149-
150-
field = data.get("updated_at", None)
151-
if field is not None:
152-
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
153-
else:
154-
args["updated_at"] = None
155-
156-
return Project(**args)
157-
158-
159-
def unmarshal_CheckContractSignatureResponse(
160-
data: Any,
161-
) -> CheckContractSignatureResponse:
162-
if not isinstance(data, dict):
163-
raise TypeError(
164-
"Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary."
165-
)
166-
167-
args: Dict[str, Any] = {}
168-
169-
field = data.get("created", None)
170-
if field is not None:
171-
args["created"] = field
172-
173-
field = data.get("validated", None)
174-
if field is not None:
175-
args["validated"] = field
176-
177-
return CheckContractSignatureResponse(**args)
178-
179-
180-
def unmarshal_ListContractSignaturesResponse(
181-
data: Any,
182-
) -> ListContractSignaturesResponse:
183-
if not isinstance(data, dict):
184-
raise TypeError(
185-
"Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary."
186-
)
187-
188-
args: Dict[str, Any] = {}
189-
190-
field = data.get("total_count", None)
191-
if field is not None:
192-
args["total_count"] = field
193-
194-
field = data.get("contract_signatures", None)
195-
if field is not None:
196-
args["contract_signatures"] = (
197-
[unmarshal_ContractSignature(v) for v in field]
198-
if field is not None
199-
else None
200-
)
201-
202-
return ListContractSignaturesResponse(**args)
203-
204-
205-
def unmarshal_ListProjectsResponse(data: Any) -> ListProjectsResponse:
206-
if not isinstance(data, dict):
207-
raise TypeError(
208-
"Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary."
209-
)
210-
211-
args: Dict[str, Any] = {}
212-
213-
field = data.get("total_count", None)
214-
if field is not None:
215-
args["total_count"] = field
216-
217-
field = data.get("projects", None)
218-
if field is not None:
219-
args["projects"] = (
220-
[unmarshal_Project(v) for v in field] if field is not None else None
221-
)
222-
223-
return ListProjectsResponse(**args)
224-
225-
226120
def unmarshal_QualificationAiMachine(data: Any) -> QualificationAiMachine:
227121
if not isinstance(data, dict):
228122
raise TypeError(
@@ -431,6 +325,118 @@ def unmarshal_Qualification(data: Any) -> Qualification:
431325
return Qualification(**args)
432326

433327

328+
def unmarshal_Project(data: Any) -> Project:
329+
if not isinstance(data, dict):
330+
raise TypeError(
331+
"Unmarshalling the type 'Project' failed as data isn't a dictionary."
332+
)
333+
334+
args: Dict[str, Any] = {}
335+
336+
field = data.get("id", None)
337+
if field is not None:
338+
args["id"] = field
339+
340+
field = data.get("name", None)
341+
if field is not None:
342+
args["name"] = field
343+
344+
field = data.get("organization_id", None)
345+
if field is not None:
346+
args["organization_id"] = field
347+
348+
field = data.get("description", None)
349+
if field is not None:
350+
args["description"] = field
351+
352+
field = data.get("created_at", None)
353+
if field is not None:
354+
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
355+
else:
356+
args["created_at"] = None
357+
358+
field = data.get("updated_at", None)
359+
if field is not None:
360+
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
361+
else:
362+
args["updated_at"] = None
363+
364+
field = data.get("qualification", None)
365+
if field is not None:
366+
args["qualification"] = unmarshal_Qualification(field)
367+
else:
368+
args["qualification"] = None
369+
370+
return Project(**args)
371+
372+
373+
def unmarshal_CheckContractSignatureResponse(
374+
data: Any,
375+
) -> CheckContractSignatureResponse:
376+
if not isinstance(data, dict):
377+
raise TypeError(
378+
"Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary."
379+
)
380+
381+
args: Dict[str, Any] = {}
382+
383+
field = data.get("created", None)
384+
if field is not None:
385+
args["created"] = field
386+
387+
field = data.get("validated", None)
388+
if field is not None:
389+
args["validated"] = field
390+
391+
return CheckContractSignatureResponse(**args)
392+
393+
394+
def unmarshal_ListContractSignaturesResponse(
395+
data: Any,
396+
) -> ListContractSignaturesResponse:
397+
if not isinstance(data, dict):
398+
raise TypeError(
399+
"Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary."
400+
)
401+
402+
args: Dict[str, Any] = {}
403+
404+
field = data.get("total_count", None)
405+
if field is not None:
406+
args["total_count"] = field
407+
408+
field = data.get("contract_signatures", None)
409+
if field is not None:
410+
args["contract_signatures"] = (
411+
[unmarshal_ContractSignature(v) for v in field]
412+
if field is not None
413+
else None
414+
)
415+
416+
return ListContractSignaturesResponse(**args)
417+
418+
419+
def unmarshal_ListProjectsResponse(data: Any) -> ListProjectsResponse:
420+
if not isinstance(data, dict):
421+
raise TypeError(
422+
"Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary."
423+
)
424+
425+
args: Dict[str, Any] = {}
426+
427+
field = data.get("total_count", None)
428+
if field is not None:
429+
args["total_count"] = field
430+
431+
field = data.get("projects", None)
432+
if field is not None:
433+
args["projects"] = (
434+
[unmarshal_Project(v) for v in field] if field is not None else None
435+
)
436+
437+
return ListProjectsResponse(**args)
438+
439+
434440
def unmarshal_ProjectQualification(data: Any) -> ProjectQualification:
435441
if not isinstance(data, dict):
436442
raise TypeError(

0 commit comments

Comments
 (0)