From 38ed66a6387304490f1fe680c2aa1fd190980856 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Thu, 29 Aug 2024 08:58:28 +0200 Subject: [PATCH] Updated YAML File to match API rule for readOnly properties --- misc/BreCalApi.cs | 448 ++++++++++++++++++++++---------------------- misc/BreCalApi.yaml | 4 +- misc/Readme_yaml.md | 19 ++ 3 files changed, 243 insertions(+), 228 deletions(-) create mode 100644 misc/Readme_yaml.md diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 68a9e32..f5147d3 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,14 +1,15 @@ //---------------------- // -// Generated REST API Client Code Generator v1.9.8.0 on 06.05.2024 13:42:21 -// Using the tool OpenAPI Generator v7.4.0 +// Generated REST API Client Code Generator v1.10.9.0 on 29.08.2024 08:26:31 +// Using the tool OpenAPI Generator v7.8.0 // //---------------------- using BreCalClient.misc.Client; using BreCalClient.misc.Model; +using FileIO = System.IO.File; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; @@ -39,7 +40,6 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; -using System.Web; /* * Bremen calling API @@ -164,7 +164,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - System.Threading.Tasks.Task ShipDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ShipDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete a ship (logically). /// @@ -176,7 +176,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> ShipDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ShipDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update a ship entry /// @@ -188,7 +188,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - System.Threading.Tasks.Task ShipUpdateAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ShipUpdateAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update a ship entry /// @@ -200,7 +200,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> ShipUpdateWithHttpInfoAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ShipUpdateWithHttpInfoAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// create a new ship entry /// @@ -212,7 +212,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - System.Threading.Tasks.Task ShipsCreateAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ShipsCreateAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// create a new ship entry /// @@ -224,7 +224,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> ShipsCreateWithHttpInfoAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ShipsCreateWithHttpInfoAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// gets a list of ships /// @@ -235,7 +235,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Ship> - System.Threading.Tasks.Task> ShipsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ShipsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// gets a list of ships /// @@ -246,7 +246,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Ship>) - System.Threading.Tasks.Task>> ShipsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ShipsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } /// @@ -418,7 +418,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - public async System.Threading.Tasks.Task ShipDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ShipDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipDeleteWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -431,7 +431,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> ShipDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ShipDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -542,7 +542,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - public async System.Threading.Tasks.Task ShipUpdateAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ShipUpdateAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipUpdateWithHttpInfoAsync(ship, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -555,7 +555,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> ShipUpdateWithHttpInfoAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ShipUpdateWithHttpInfoAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'ship' is set if (ship == null) @@ -672,7 +672,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - public async System.Threading.Tasks.Task ShipsCreateAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ShipsCreateAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipsCreateWithHttpInfoAsync(ship, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -685,7 +685,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> ShipsCreateWithHttpInfoAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ShipsCreateWithHttpInfoAsync(Ship ship, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'ship' is set if (ship == null) @@ -792,7 +792,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Ship> - public async System.Threading.Tasks.Task> ShipsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ShipsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await ShipsGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -804,7 +804,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Ship>) - public async System.Threading.Tasks.Task>> ShipsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ShipsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -947,7 +947,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - System.Threading.Tasks.Task ShipcallCreateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ShipcallCreateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create a new ship call /// @@ -959,7 +959,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> ShipcallCreateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ShipcallCreateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Updates a ship call /// @@ -971,7 +971,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - System.Threading.Tasks.Task ShipcallUpdateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ShipcallUpdateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Updates a ship call /// @@ -983,7 +983,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> ShipcallUpdateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ShipcallUpdateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Gets a list of ship calls /// @@ -995,7 +995,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Shipcall> - System.Threading.Tasks.Task> ShipcallsGetAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ShipcallsGetAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Gets a list of ship calls /// @@ -1007,7 +1007,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Shipcall>) - System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } /// @@ -1185,7 +1185,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - public async System.Threading.Tasks.Task ShipcallCreateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ShipcallCreateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipcallCreateWithHttpInfoAsync(shipcall, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1198,7 +1198,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> ShipcallCreateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ShipcallCreateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'shipcall' is set if (shipcall == null) @@ -1315,7 +1315,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - public async System.Threading.Tasks.Task ShipcallUpdateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ShipcallUpdateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipcallUpdateWithHttpInfoAsync(shipcall, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1328,7 +1328,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> ShipcallUpdateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ShipcallUpdateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'shipcall' is set if (shipcall == null) @@ -1442,7 +1442,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Shipcall> - public async System.Threading.Tasks.Task> ShipcallsGetAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ShipcallsGetAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await ShipcallsGetWithHttpInfoAsync(pastDays, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1455,7 +1455,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Shipcall>) - public async System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -1621,7 +1621,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Berth> - System.Threading.Tasks.Task> BerthsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BerthsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Gets a list of all berths registered /// @@ -1632,7 +1632,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Berth>) - System.Threading.Tasks.Task>> BerthsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> BerthsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// History data /// @@ -1644,7 +1644,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<History> - System.Threading.Tasks.Task> HistoryGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> HistoryGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// History data /// @@ -1656,7 +1656,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<History>) - System.Threading.Tasks.Task>> HistoryGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> HistoryGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Gets a list of notifications pursuant to a specified participant and ship call /// @@ -1668,7 +1668,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Notification - System.Threading.Tasks.Task NotificationsGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task NotificationsGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Gets a list of notifications pursuant to a specified participant and ship call /// @@ -1680,7 +1680,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Notification) - System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// gets one or all participants /// @@ -1692,7 +1692,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Participant> - System.Threading.Tasks.Task> ParticipantsGetAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ParticipantsGetAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// gets one or all participants /// @@ -1704,7 +1704,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Participant>) - System.Threading.Tasks.Task>> ParticipantsGetWithHttpInfoAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ParticipantsGetWithHttpInfoAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } /// @@ -1872,7 +1872,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Berth> - public async System.Threading.Tasks.Task> BerthsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BerthsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await BerthsGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1884,7 +1884,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Berth>) - public async System.Threading.Tasks.Task>> BerthsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> BerthsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -1988,7 +1988,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<History> - public async System.Threading.Tasks.Task> HistoryGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> HistoryGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await HistoryGetWithHttpInfoAsync(shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2001,7 +2001,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<History>) - public async System.Threading.Tasks.Task>> HistoryGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> HistoryGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -2106,7 +2106,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Notification - public async System.Threading.Tasks.Task NotificationsGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task NotificationsGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await NotificationsGetWithHttpInfoAsync(shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2119,7 +2119,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Notification) - public async System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -2227,7 +2227,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Participant> - public async System.Threading.Tasks.Task> ParticipantsGetAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ParticipantsGetAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await ParticipantsGetWithHttpInfoAsync(userId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2240,7 +2240,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Participant>) - public async System.Threading.Tasks.Task>> ParticipantsGetWithHttpInfoAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ParticipantsGetWithHttpInfoAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -2409,7 +2409,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - System.Threading.Tasks.Task TimesCreateAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TimesCreateAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create a new times entry for a ship call /// @@ -2421,7 +2421,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> TimesCreateWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TimesCreateWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete a times entry for a ship call. /// @@ -2433,7 +2433,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - System.Threading.Tasks.Task TimesDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TimesDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete a times entry for a ship call. /// @@ -2445,7 +2445,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> TimesDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TimesDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Gets list of times /// @@ -2457,7 +2457,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Times> - System.Threading.Tasks.Task> TimesGetAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TimesGetAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Gets list of times /// @@ -2469,7 +2469,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Times>) - System.Threading.Tasks.Task>> TimesGetWithHttpInfoAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> TimesGetWithHttpInfoAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update a times entry for a ship call /// @@ -2481,7 +2481,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - System.Threading.Tasks.Task TimesUpdateAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TimesUpdateAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update a times entry for a ship call /// @@ -2493,7 +2493,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> TimesUpdateWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TimesUpdateWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } /// @@ -2671,7 +2671,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - public async System.Threading.Tasks.Task TimesCreateAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TimesCreateAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesCreateWithHttpInfoAsync(times, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2684,7 +2684,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> TimesCreateWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TimesCreateWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'times' is set if (times == null) @@ -2795,7 +2795,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - public async System.Threading.Tasks.Task TimesDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TimesDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesDeleteWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2808,7 +2808,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> TimesDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TimesDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -2916,7 +2916,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Times> - public async System.Threading.Tasks.Task> TimesGetAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TimesGetAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await TimesGetWithHttpInfoAsync(shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2929,7 +2929,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Times>) - public async System.Threading.Tasks.Task>> TimesGetWithHttpInfoAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> TimesGetWithHttpInfoAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -3043,7 +3043,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - public async System.Threading.Tasks.Task TimesUpdateAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TimesUpdateAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesUpdateWithHttpInfoAsync(times, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3056,7 +3056,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> TimesUpdateWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TimesUpdateWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'times' is set if (times == null) @@ -3184,7 +3184,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of LoginResult - System.Threading.Tasks.Task LoginAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task LoginAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Returns a JWT session token and user data if successful /// @@ -3196,7 +3196,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (LoginResult) - System.Threading.Tasks.Task> LoginWithHttpInfoAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> LoginWithHttpInfoAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update user details (first/last name, phone, password) /// @@ -3208,7 +3208,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - System.Threading.Tasks.Task UserUpdateAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UserUpdateAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update user details (first/last name, phone, password) /// @@ -3220,7 +3220,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> UserUpdateWithHttpInfoAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UserUpdateWithHttpInfoAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } /// @@ -3398,7 +3398,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of LoginResult - public async System.Threading.Tasks.Task LoginAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task LoginAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await LoginWithHttpInfoAsync(credentials, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3411,7 +3411,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (LoginResult) - public async System.Threading.Tasks.Task> LoginWithHttpInfoAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> LoginWithHttpInfoAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'credentials' is set if (credentials == null) @@ -3528,7 +3528,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - public async System.Threading.Tasks.Task UserUpdateAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UserUpdateAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await UserUpdateWithHttpInfoAsync(userDetails, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3541,7 +3541,7 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> UserUpdateWithHttpInfoAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UserUpdateWithHttpInfoAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'userDetails' is set if (userDetails == null) @@ -3634,10 +3634,10 @@ namespace BreCalClient.misc.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is BreCalClient.misc.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((BreCalClient.misc.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -3678,7 +3678,7 @@ namespace BreCalClient.misc.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -3688,7 +3688,7 @@ namespace BreCalClient.misc.Client } if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type { @@ -3706,11 +3706,11 @@ namespace BreCalClient.misc.Client } public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } /// @@ -3752,7 +3752,7 @@ namespace BreCalClient.misc.Client /// public ApiClient() { - _baseUrl = BreCalClient.misc.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// /// Initializes a new instance of the @@ -3804,14 +3804,14 @@ namespace BreCalClient.misc.Client } /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -3909,7 +3909,7 @@ namespace BreCalClient.misc.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -3917,6 +3917,13 @@ namespace BreCalClient.misc.Client } return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -3955,51 +3962,41 @@ namespace BreCalClient.misc.Client } return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; + setOptions(clientOptions); using (RestClient client = new RestClient(clientOptions, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = await getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(BreCalClient.misc.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -4052,82 +4049,69 @@ namespace BreCalClient.misc.Client return result; } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + Func>> getResponse = (client) => + { + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return Task.FromResult(DeserializeRestResponseFromPolicy(client, request, policyResult)); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; + Func>> getResponse = async (client) => { - InterceptRequest(request); - RestResponse response; if (RetryConfiguration.AsyncRetryPolicy != null) { var policy = RetryConfiguration.AsyncRetryPolicy; var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); } - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(BreCalClient.misc.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - InterceptResponse(request, response); - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) - { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - result.Cookies.Add(cookie); - } - } - return result; - } + }; + return ExecClientAsync(getResponse, setOptions, request, options, configuration); } #region IAsynchronousClient /// @@ -4139,7 +4123,7 @@ namespace BreCalClient.misc.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -4153,7 +4137,7 @@ namespace BreCalClient.misc.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -4167,7 +4151,7 @@ namespace BreCalClient.misc.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -4181,7 +4165,7 @@ namespace BreCalClient.misc.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -4195,7 +4179,7 @@ namespace BreCalClient.misc.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -4209,7 +4193,7 @@ namespace BreCalClient.misc.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -4223,7 +4207,7 @@ namespace BreCalClient.misc.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); @@ -4640,7 +4624,7 @@ namespace BreCalClient.misc.Client /// Encoded string. public static string Base64Encode(string text) { - return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); } /// /// Convert stream to byte array @@ -4828,7 +4812,7 @@ namespace BreCalClient.misc.Client /// /// Initializes a new instance of the class /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration() { Proxy = null; @@ -4855,7 +4839,7 @@ namespace BreCalClient.misc.Client /// /// Initializes a new instance of the class /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration( IDictionary defaultHeaders, IDictionary apiKey, @@ -5441,7 +5425,7 @@ namespace BreCalClient.misc.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. /// @@ -5451,7 +5435,7 @@ namespace BreCalClient.misc.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. /// @@ -5461,7 +5445,7 @@ namespace BreCalClient.misc.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. /// @@ -5471,7 +5455,7 @@ namespace BreCalClient.misc.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. /// @@ -5481,7 +5465,7 @@ namespace BreCalClient.misc.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. /// @@ -5491,7 +5475,7 @@ namespace BreCalClient.misc.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. /// @@ -5501,7 +5485,7 @@ namespace BreCalClient.misc.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); } } @@ -6191,7 +6175,7 @@ namespace BreCalClient.misc.Model this.Name = name; this.OwnerId = ownerId; this.AuthorityId = authorityId; - this.VarLock = varLock; + this.Lock = varLock; this.Created = created; this.Modified = modified; this.Deleted = deleted; @@ -6223,7 +6207,7 @@ namespace BreCalClient.misc.Model /// /// If true lock must be passed [DataMember(Name = "lock", EmitDefaultValue = true)] - public bool? VarLock { get; set; } + public bool? Lock { get; set; } /// /// Gets or Sets Created /// @@ -6251,7 +6235,7 @@ namespace BreCalClient.misc.Model sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" OwnerId: ").Append(OwnerId).Append("\n"); sb.Append(" AuthorityId: ").Append(AuthorityId).Append("\n"); - sb.Append(" VarLock: ").Append(VarLock).Append("\n"); + sb.Append(" Lock: ").Append(Lock).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n"); sb.Append(" Deleted: ").Append(Deleted).Append("\n"); @@ -6271,12 +6255,12 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Name (string) maxLength if (this.Name != null && this.Name.Length > 128) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, length must be less than 128.", new [] { "Name" }); + yield return new ValidationResult("Invalid value for Name, length must be less than 128.", new [] { "Name" }); } yield break; } @@ -6361,7 +6345,7 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -6434,7 +6418,7 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -6584,7 +6568,7 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -6646,7 +6630,7 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -6772,7 +6756,7 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -6876,7 +6860,7 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -7118,27 +7102,27 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Name (string) maxLength if (this.Name != null && this.Name.Length > 128) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, length must be less than 128.", new [] { "Name" }); + yield return new ValidationResult("Invalid value for Name, length must be less than 128.", new [] { "Name" }); } // Street (string) maxLength if (this.Street != null && this.Street.Length > 128) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Street, length must be less than 128.", new [] { "Street" }); + yield return new ValidationResult("Invalid value for Street, length must be less than 128.", new [] { "Street" }); } // PostalCode (string) maxLength if (this.PostalCode != null && this.PostalCode.Length > 5) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PostalCode, length must be less than 5.", new [] { "PostalCode" }); + yield return new ValidationResult("Invalid value for PostalCode, length must be less than 5.", new [] { "PostalCode" }); } // City (string) maxLength if (this.City != null && this.City.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for City, length must be less than 64.", new [] { "City" }); + yield return new ValidationResult("Invalid value for City, length must be less than 64.", new [] { "City" }); } yield break; } @@ -7214,7 +7198,7 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -7374,17 +7358,17 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Name (string) maxLength if (this.Name != null && this.Name.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, length must be less than 64.", new [] { "Name" }); + yield return new ValidationResult("Invalid value for Name, length must be less than 64.", new [] { "Name" }); } // Callsign (string) maxLength if (this.Callsign != null && this.Callsign.Length > 8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Callsign, length must be less than 8.", new [] { "Callsign" }); + yield return new ValidationResult("Invalid value for Callsign, length must be less than 8.", new [] { "Callsign" }); } yield break; } @@ -7450,12 +7434,11 @@ namespace BreCalClient.misc.Model /// mooredLock. /// canceled. /// evaluation. - /// evaluationMessage. /// Physical reference point for all times given in shipcall and depending times entries. /// participants. /// Readonly field set by the database. /// Readonly field set by the database. - public Shipcall(int id = default(int), int shipId = default(int), ShipcallType type = default(ShipcallType), DateTime? eta = default(DateTime?), string voyage = default(string), DateTime? etd = default(DateTime?), int? arrivalBerthId = default(int?), int? departureBerthId = default(int?), bool? tugRequired = default(bool?), bool? pilotRequired = default(bool?), int? flags = default(int?), bool? pierSide = default(bool?), bool? bunkering = default(bool?), bool? replenishingTerminal = default(bool?), bool? replenishingLock = default(bool?), double? draft = default(double?), DateTime? tidalWindowFrom = default(DateTime?), DateTime? tidalWindowTo = default(DateTime?), bool? rainSensitiveCargo = default(bool?), int? recommendedTugs = default(int?), bool? anchored = default(bool?), bool? mooredLock = default(bool?), bool? canceled = default(bool?), EvaluationType? evaluation = default(EvaluationType?), string evaluationMessage = default(string), int? timeRefPoint = default(int?), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) + public Shipcall(int id = default(int), int shipId = default(int), ShipcallType type = default(ShipcallType), DateTime? eta = default(DateTime?), string voyage = default(string), DateTime? etd = default(DateTime?), int? arrivalBerthId = default(int?), int? departureBerthId = default(int?), bool? tugRequired = default(bool?), bool? pilotRequired = default(bool?), int? flags = default(int?), bool? pierSide = default(bool?), bool? bunkering = default(bool?), bool? replenishingTerminal = default(bool?), bool? replenishingLock = default(bool?), double? draft = default(double?), DateTime? tidalWindowFrom = default(DateTime?), DateTime? tidalWindowTo = default(DateTime?), bool? rainSensitiveCargo = default(bool?), int? recommendedTugs = default(int?), bool? anchored = default(bool?), bool? mooredLock = default(bool?), bool? canceled = default(bool?), EvaluationType? evaluation = default(EvaluationType?), int? timeRefPoint = default(int?), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.ShipId = shipId; @@ -7481,7 +7464,6 @@ namespace BreCalClient.misc.Model this.MooredLock = mooredLock; this.Canceled = canceled; this.Evaluation = evaluation; - this.EvaluationMessage = evaluationMessage; this.TimeRefPoint = timeRefPoint; this.Participants = participants; this.Created = created; @@ -7602,7 +7584,19 @@ namespace BreCalClient.misc.Model /// Gets or Sets EvaluationMessage /// [DataMember(Name = "evaluation_message", EmitDefaultValue = true)] - public string EvaluationMessage { get; set; } + public string EvaluationMessage { get; private set; } + /// + /// Returns false as EvaluationMessage should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeEvaluationMessage() + { + return false; + } + public bool ShouldSerializeEvaluation() + { + return false; + } /// /// Physical reference point for all times given in shipcall and depending times entries /// @@ -7679,17 +7673,17 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Voyage (string) maxLength if (this.Voyage != null && this.Voyage.Length > 16) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Voyage, length must be less than 16.", new [] { "Voyage" }); + yield return new ValidationResult("Invalid value for Voyage, length must be less than 16.", new [] { "Voyage" }); } // EvaluationMessage (string) maxLength if (this.EvaluationMessage != null && this.EvaluationMessage.Length > 512) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EvaluationMessage, length must be less than 512.", new [] { "EvaluationMessage" }); + yield return new ValidationResult("Invalid value for EvaluationMessage, length must be less than 512.", new [] { "EvaluationMessage" }); } yield break; } @@ -8001,17 +7995,17 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Remarks (string) maxLength if (this.Remarks != null && this.Remarks.Length > 512) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Remarks, length must be less than 512.", new [] { "Remarks" }); + yield return new ValidationResult("Invalid value for Remarks, length must be less than 512.", new [] { "Remarks" }); } // BerthInfo (string) maxLength if (this.BerthInfo != null && this.BerthInfo.Length > 512) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for BerthInfo, length must be less than 512.", new [] { "BerthInfo" }); + yield return new ValidationResult("Invalid value for BerthInfo, length must be less than 512.", new [] { "BerthInfo" }); } yield break; } @@ -8121,37 +8115,37 @@ namespace BreCalClient.misc.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // OldPassword (string) maxLength if (this.OldPassword != null && this.OldPassword.Length > 128) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for OldPassword, length must be less than 128.", new [] { "OldPassword" }); + yield return new ValidationResult("Invalid value for OldPassword, length must be less than 128.", new [] { "OldPassword" }); } // NewPassword (string) maxLength if (this.NewPassword != null && this.NewPassword.Length > 128) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for NewPassword, length must be less than 128.", new [] { "NewPassword" }); + yield return new ValidationResult("Invalid value for NewPassword, length must be less than 128.", new [] { "NewPassword" }); } // FirstName (string) maxLength if (this.FirstName != null && this.FirstName.Length > 45) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for FirstName, length must be less than 45.", new [] { "FirstName" }); + yield return new ValidationResult("Invalid value for FirstName, length must be less than 45.", new [] { "FirstName" }); } // LastName (string) maxLength if (this.LastName != null && this.LastName.Length > 45) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for LastName, length must be less than 45.", new [] { "LastName" }); + yield return new ValidationResult("Invalid value for LastName, length must be less than 45.", new [] { "LastName" }); } // UserPhone (string) maxLength if (this.UserPhone != null && this.UserPhone.Length > 128) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UserPhone, length must be less than 128.", new [] { "UserPhone" }); + yield return new ValidationResult("Invalid value for UserPhone, length must be less than 128.", new [] { "UserPhone" }); } // UserEmail (string) maxLength if (this.UserEmail != null && this.UserEmail.Length > 128) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UserEmail, length must be less than 128.", new [] { "UserEmail" }); + yield return new ValidationResult("Invalid value for UserEmail, length must be less than 128.", new [] { "UserEmail" }); } yield break; } diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index be9d091..e8bcc95 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -566,6 +566,7 @@ components: evaluation: $ref: '#/components/schemas/EvaluationType' evaluation_message: + readOnly: true maxLength: 512 type: string nullable: true @@ -964,8 +965,9 @@ components: - email - push EvaluationType: - type: string + readOnly: true nullable: true + type: string enum: - undefined - green diff --git a/misc/Readme_yaml.md b/misc/Readme_yaml.md new file mode 100644 index 0000000..d6fa5a5 --- /dev/null +++ b/misc/Readme_yaml.md @@ -0,0 +1,19 @@ +# Bremen Calling Open API spec + +## Infos zur Generierung der CS Wrapper / Mapping Datei aus YAML + +Verwendung von "OpenAPIGenerator" aus dem [Rest API Client Code Generator 2022](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2022). +Die automatisch generierte Datei muss leider noch nachgearbeitet werden: + +1) #pragma warning disable CS8073 (direkt nach der NS declaration). +2) #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' (am Schluss vor der schließenden Klammer des NS) +3) Für readOnly Properties wird bei einem Enum kein korrekter Code emittiert. Daher muss aktuell folgende Funktion ergänzt werden, damit beim Speichern das "evaluation" Flag nicht mitgesendet wird: + +```C++ +public bool ShouldSerializeEvaluation() +{ + return false; +} +``` + +Witziger(!)weise funktioniert es für das Property EvaluationMessage korrekt.