From ddd1d6d9b16f1a88b828aeb7648ffd45c927bbd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yana=C3=ABl=20GRETTE?= Date: Mon, 14 Dec 2020 10:55:28 +0100 Subject: [PATCH] =?UTF-8?q?R=C3=A9solution=20d'un=20probl=C3=A8me=20dans?= =?UTF-8?q?=20le=20cas=20de=20la=20r=C3=A9cup=C3=A9ration=20de=20donn?= =?UTF-8?q?=C3=A9es=20non=20existantes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiCollaborateur/CollaborateurApi.cs | 160 +++++++++++++----- 1 file changed, 115 insertions(+), 45 deletions(-) diff --git a/EPAServeur/ApiCollaborateur/CollaborateurApi.cs b/EPAServeur/ApiCollaborateur/CollaborateurApi.cs index b26b95c..f336e15 100644 --- a/EPAServeur/ApiCollaborateur/CollaborateurApi.cs +++ b/EPAServeur/ApiCollaborateur/CollaborateurApi.cs @@ -858,7 +858,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("AjoutCollab", localVarResponse); @@ -927,7 +928,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("AjoutCollab", localVarResponse); @@ -951,6 +953,8 @@ namespace IO.Swagger.ApiCollaborateur public List ChercherCollab (List collabsId = null, bool? ancienCollaborateur = null, List roles = null, List buIds = null) { ApiResponse> localVarResponse = ChercherCollabWithHttpInfo(collabsId, ancienCollaborateur, roles, buIds); + if (localVarResponse == null) + return new List(); return localVarResponse.Data; } @@ -998,7 +1002,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollab", localVarResponse); @@ -1022,6 +1027,8 @@ namespace IO.Swagger.ApiCollaborateur public async System.Threading.Tasks.Task> ChercherCollabAsync (List collabsId = null, bool? ancienCollaborateur = null, List roles = null, List buIds = null) { ApiResponse> localVarResponse = await ChercherCollabAsyncWithHttpInfo(collabsId, ancienCollaborateur, roles, buIds); + if (localVarResponse == null) + return new List(); return localVarResponse.Data; } @@ -1070,7 +1077,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollab", localVarResponse); @@ -1091,7 +1099,9 @@ namespace IO.Swagger.ApiCollaborateur public List ChercherCollabAgence (long? agenceId, List roles = null) { ApiResponse> localVarResponse = ChercherCollabAgenceWithHttpInfo(agenceId, roles); - return localVarResponse.Data; + if (localVarResponse == null) + return new List(); + return localVarResponse.Data; } /// @@ -1137,7 +1147,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollabAgence", localVarResponse); @@ -1159,6 +1170,8 @@ namespace IO.Swagger.ApiCollaborateur public async System.Threading.Tasks.Task> ChercherCollabAgenceAsync (long? agenceId, List roles = null) { ApiResponse> localVarResponse = await ChercherCollabAgenceAsyncWithHttpInfo(agenceId, roles); + if (localVarResponse == null) + return new List(); return localVarResponse.Data; } @@ -1206,7 +1219,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollabAgence", localVarResponse); @@ -1228,6 +1242,8 @@ namespace IO.Swagger.ApiCollaborateur public List ChercherCollabBU (long? buId, List roles = null) { ApiResponse> localVarResponse = ChercherCollabBUWithHttpInfo(buId, roles); + if (localVarResponse == null) + return new List(); return localVarResponse.Data; } @@ -1274,7 +1290,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollabBU", localVarResponse); @@ -1296,7 +1313,9 @@ namespace IO.Swagger.ApiCollaborateur public async System.Threading.Tasks.Task> ChercherCollabBUAsync (long? buId, List roles = null) { ApiResponse> localVarResponse = await ChercherCollabBUAsyncWithHttpInfo(buId, roles); - return localVarResponse.Data; + if (localVarResponse == null) + return new List(); + return localVarResponse.Data; } @@ -1343,7 +1362,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollabBU", localVarResponse); @@ -1364,6 +1384,8 @@ namespace IO.Swagger.ApiCollaborateur public Collaborateur ChercherCollabId (Guid? collabId) { ApiResponse localVarResponse = ChercherCollabIdWithHttpInfo(collabId); + if (localVarResponse == null) + return null; return localVarResponse.Data; } @@ -1408,7 +1430,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollabId", localVarResponse); @@ -1429,7 +1452,9 @@ namespace IO.Swagger.ApiCollaborateur public async System.Threading.Tasks.Task ChercherCollabIdAsync (Guid? collabId) { ApiResponse localVarResponse = await ChercherCollabIdAsyncWithHttpInfo(collabId); - return localVarResponse.Data; + if (localVarResponse == null) + return null; + return localVarResponse.Data; } @@ -1475,12 +1500,13 @@ namespace IO.Swagger.ApiCollaborateur int localVarStatusCode = (int) localVarResponse.StatusCode; + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollabId", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), (Collaborateur) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Collaborateur))); @@ -1495,7 +1521,9 @@ namespace IO.Swagger.ApiCollaborateur public Collaborateur ChercherCollabMail (string mailApside) { ApiResponse localVarResponse = ChercherCollabMailWithHttpInfo(mailApside); - return localVarResponse.Data; + if (localVarResponse == null) + return null; + return localVarResponse.Data; } /// @@ -1539,7 +1567,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollabMail", localVarResponse); @@ -1560,7 +1589,9 @@ namespace IO.Swagger.ApiCollaborateur public async System.Threading.Tasks.Task ChercherCollabMailAsync (string mailApside) { ApiResponse localVarResponse = await ChercherCollabMailAsyncWithHttpInfo(mailApside); - return localVarResponse.Data; + if (localVarResponse == null) + return null; + return localVarResponse.Data; } @@ -1605,7 +1636,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollabMail", localVarResponse); @@ -1626,7 +1658,9 @@ namespace IO.Swagger.ApiCollaborateur public List ChercherCollabRef (Guid? refId) { ApiResponse> localVarResponse = ChercherCollabRefWithHttpInfo(refId); - return localVarResponse.Data; + if (localVarResponse == null) + return new List(); + return localVarResponse.Data; } /// @@ -1670,7 +1704,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollabRef", localVarResponse); @@ -1691,7 +1726,9 @@ namespace IO.Swagger.ApiCollaborateur public async System.Threading.Tasks.Task> ChercherCollabRefAsync (Guid? refId) { ApiResponse> localVarResponse = await ChercherCollabRefAsyncWithHttpInfo(refId); - return localVarResponse.Data; + if (localVarResponse == null) + return new List(); + return localVarResponse.Data; } @@ -1736,7 +1773,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherCollabRef", localVarResponse); @@ -1757,7 +1795,9 @@ namespace IO.Swagger.ApiCollaborateur public Collaborateur ChercherRefActuelId (Guid? collabId) { ApiResponse localVarResponse = ChercherRefActuelIdWithHttpInfo(collabId); - return localVarResponse.Data; + if (localVarResponse == null) + return null; + return localVarResponse.Data; } /// @@ -1801,7 +1841,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherRefActuelId", localVarResponse); @@ -1822,7 +1863,9 @@ namespace IO.Swagger.ApiCollaborateur public async System.Threading.Tasks.Task ChercherRefActuelIdAsync (Guid? collabId) { ApiResponse localVarResponse = await ChercherRefActuelIdAsyncWithHttpInfo(collabId); - return localVarResponse.Data; + if (localVarResponse == null) + return null; + return localVarResponse.Data; } @@ -1867,7 +1910,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherRefActuelId", localVarResponse); @@ -1888,7 +1932,9 @@ namespace IO.Swagger.ApiCollaborateur public Collaborateur ChercherRefActuelMail (string mailApside) { ApiResponse localVarResponse = ChercherRefActuelMailWithHttpInfo(mailApside); - return localVarResponse.Data; + if (localVarResponse == null) + return null; + return localVarResponse.Data; } /// @@ -1932,7 +1978,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherRefActuelMail", localVarResponse); @@ -1953,7 +2000,9 @@ namespace IO.Swagger.ApiCollaborateur public async System.Threading.Tasks.Task ChercherRefActuelMailAsync (string mailApside) { ApiResponse localVarResponse = await ChercherRefActuelMailAsyncWithHttpInfo(mailApside); - return localVarResponse.Data; + if (localVarResponse == null) + return null; + return localVarResponse.Data; } @@ -1998,7 +2047,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherRefActuelMail", localVarResponse); @@ -2019,7 +2069,9 @@ namespace IO.Swagger.ApiCollaborateur public List ChercherRefCollabId (Guid? collabId) { ApiResponse> localVarResponse = ChercherRefCollabIdWithHttpInfo(collabId); - return localVarResponse.Data; + if (localVarResponse == null) + return new List(); + return localVarResponse.Data; } /// @@ -2063,7 +2115,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherRefCollabId", localVarResponse); @@ -2084,7 +2137,9 @@ namespace IO.Swagger.ApiCollaborateur public async System.Threading.Tasks.Task> ChercherRefCollabIdAsync (Guid? collabId) { ApiResponse> localVarResponse = await ChercherRefCollabIdAsyncWithHttpInfo(collabId); - return localVarResponse.Data; + if (localVarResponse == null) + return new List(); + return localVarResponse.Data; } @@ -2129,7 +2184,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherRefCollabId", localVarResponse); @@ -2150,7 +2206,9 @@ namespace IO.Swagger.ApiCollaborateur public List ChercherRefCollabMail (string mailApside) { ApiResponse> localVarResponse = ChercherRefCollabMailWithHttpInfo(mailApside); - return localVarResponse.Data; + if (localVarResponse == null) + return new List(); + return localVarResponse.Data; } /// @@ -2194,7 +2252,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherRefCollabMail", localVarResponse); @@ -2215,7 +2274,9 @@ namespace IO.Swagger.ApiCollaborateur public async System.Threading.Tasks.Task> ChercherRefCollabMailAsync (string mailApside) { ApiResponse> localVarResponse = await ChercherRefCollabMailAsyncWithHttpInfo(mailApside); - return localVarResponse.Data; + if (localVarResponse == null) + return new List(); + return localVarResponse.Data; } @@ -2260,7 +2321,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ChercherRefCollabMail", localVarResponse); @@ -2334,7 +2396,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("MajCollab", localVarResponse); @@ -2409,7 +2472,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("MajCollab", localVarResponse); @@ -2483,7 +2547,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("MajCollabMail", localVarResponse); @@ -2558,7 +2623,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("MajCollabMail", localVarResponse); @@ -2632,7 +2698,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("MajCollabpatch", localVarResponse); @@ -2707,7 +2774,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("MajCollabpatch", localVarResponse); @@ -2781,7 +2849,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("MajCollabpatchMail", localVarResponse); @@ -2856,7 +2925,8 @@ namespace IO.Swagger.ApiCollaborateur localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; - + if (localVarStatusCode == 404) + return null; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("MajCollabpatchMail", localVarResponse);