From c6b16c4fa7b9a615d40cdd15ebc2561657e1c7fb Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Fri, 15 Dec 2023 13:31:31 +0100 Subject: [PATCH 01/34] Enums, work in progress --- misc/BreCalApi.cs | 1027 ++++++++--------- misc/BreCalApi.yaml | 96 +- src/BreCalClient/BreCalClient.csproj | 2 +- src/BreCalClient/EditShipcallControl.xaml.cs | 23 +- .../EditTimesAgencyIncomingControl.xaml.cs | 2 +- .../EditTimesAgencyOutgoingControl.xaml.cs | 2 +- .../EditTimesAgencyShiftingControl.xaml.cs | 2 +- src/BreCalClient/EditTimesControl.xaml.cs | 2 +- .../EditTimesTerminalControl.xaml.cs | 2 +- src/BreCalClient/Extensions.cs | 34 - src/BreCalClient/IEditTimesControl.cs | 2 +- src/BreCalClient/MainWindow.xaml.cs | 4 +- src/BreCalClient/ShipcallControl.xaml.cs | 2 +- src/BreCalClient/ShipcallControlModel.cs | 36 +- 14 files changed, 623 insertions(+), 613 deletions(-) diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 741fbf4..8d04cf3 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,8 +1,8 @@ //---------------------- // -// Generated REST API Client Code Generator v1.8.4.0 on 01.11.2023 15:27:09 -// Using the tool OpenAPI Generator v7.0.0 +// Generated REST API Client Code Generator v1.9.1.0 on 15.12.2023 13:07:51 +// Using the tool OpenAPI Generator v7.1.0 // //---------------------- @@ -39,13 +39,14 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; +using System.Web; /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -70,7 +71,7 @@ namespace BreCalClient.misc.Api /// Gets a list of all berths registered /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -88,7 +89,7 @@ namespace BreCalClient.misc.Api /// Returns a JWT session token and user data if successful /// /// - /// + /// /// /// Thrown when fails to make API call /// Login credentials @@ -108,7 +109,7 @@ namespace BreCalClient.misc.Api /// Gets a list of notifications pursuant to a specified participant and ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -128,7 +129,7 @@ namespace BreCalClient.misc.Api /// gets a particular participant entry corresponding to user id /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -147,7 +148,7 @@ namespace BreCalClient.misc.Api /// Gets a list of ship calls /// /// - /// + /// /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -166,7 +167,7 @@ namespace BreCalClient.misc.Api /// Create a new ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -185,7 +186,7 @@ namespace BreCalClient.misc.Api /// Updates a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -203,7 +204,7 @@ namespace BreCalClient.misc.Api /// gets a list of registered shipcalls /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -221,7 +222,7 @@ namespace BreCalClient.misc.Api /// Delete a times entry for a ship call. /// /// - /// + /// /// /// Thrown when fails to make API call /// @@ -240,7 +241,7 @@ namespace BreCalClient.misc.Api /// Get all recorded times for a a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -259,7 +260,7 @@ namespace BreCalClient.misc.Api /// Create a new times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -278,7 +279,7 @@ namespace BreCalClient.misc.Api /// Update a times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -297,7 +298,7 @@ namespace BreCalClient.misc.Api /// Update user details (first/last name, phone, password) /// /// - /// + /// /// /// Thrown when fails to make API call /// User details @@ -316,7 +317,7 @@ namespace BreCalClient.misc.Api /// Gets a list of all berths registered /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -327,7 +328,7 @@ namespace BreCalClient.misc.Api /// Gets a list of all berths registered /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -338,7 +339,7 @@ namespace BreCalClient.misc.Api /// Returns a JWT session token and user data if successful /// /// - /// + /// /// /// Thrown when fails to make API call /// Login credentials @@ -350,7 +351,7 @@ namespace BreCalClient.misc.Api /// Returns a JWT session token and user data if successful /// /// - /// + /// /// /// Thrown when fails to make API call /// Login credentials @@ -362,7 +363,7 @@ namespace BreCalClient.misc.Api /// Gets a list of notifications pursuant to a specified participant and ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -375,7 +376,7 @@ namespace BreCalClient.misc.Api /// Gets a list of notifications pursuant to a specified participant and ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -388,7 +389,7 @@ namespace BreCalClient.misc.Api /// gets a particular participant entry corresponding to user id /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -400,7 +401,7 @@ namespace BreCalClient.misc.Api /// gets a particular participant entry corresponding to user id /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -412,7 +413,7 @@ namespace BreCalClient.misc.Api /// Gets a list of ship calls /// /// - /// + /// /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -424,7 +425,7 @@ namespace BreCalClient.misc.Api /// Gets a list of ship calls /// /// - /// + /// /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -436,7 +437,7 @@ namespace BreCalClient.misc.Api /// Create a new ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -448,7 +449,7 @@ namespace BreCalClient.misc.Api /// Create a new ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -460,7 +461,7 @@ namespace BreCalClient.misc.Api /// Updates a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -472,7 +473,7 @@ namespace BreCalClient.misc.Api /// Updates a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -484,7 +485,7 @@ namespace BreCalClient.misc.Api /// gets a list of registered shipcalls /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -495,7 +496,7 @@ namespace BreCalClient.misc.Api /// gets a list of registered shipcalls /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -506,7 +507,7 @@ namespace BreCalClient.misc.Api /// Delete a times entry for a ship call. /// /// - /// + /// /// /// Thrown when fails to make API call /// @@ -518,7 +519,7 @@ namespace BreCalClient.misc.Api /// Delete a times entry for a ship call. /// /// - /// + /// /// /// Thrown when fails to make API call /// @@ -530,7 +531,7 @@ namespace BreCalClient.misc.Api /// Get all recorded times for a a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -542,7 +543,7 @@ namespace BreCalClient.misc.Api /// Get all recorded times for a a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -554,7 +555,7 @@ namespace BreCalClient.misc.Api /// Create a new times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -566,7 +567,7 @@ namespace BreCalClient.misc.Api /// Create a new times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -578,7 +579,7 @@ namespace BreCalClient.misc.Api /// Update a times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -590,7 +591,7 @@ namespace BreCalClient.misc.Api /// Update a times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -602,7 +603,7 @@ namespace BreCalClient.misc.Api /// Update user details (first/last name, phone, password) /// /// - /// + /// /// /// Thrown when fails to make API call /// User details @@ -614,7 +615,7 @@ namespace BreCalClient.misc.Api /// Update user details (first/last name, phone, password) /// /// - /// + /// /// /// Thrown when fails to make API call /// User details @@ -728,7 +729,7 @@ namespace BreCalClient.misc.Api set { _exceptionFactory = value; } } /// - /// Gets a list of all berths registered + /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -739,7 +740,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of all berths registered + /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -783,7 +784,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of all berths registered + /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -795,7 +796,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of all berths registered + /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -840,7 +841,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Returns a JWT session token and user data if successful + /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials @@ -852,7 +853,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Returns a JWT session token and user data if successful + /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials @@ -904,7 +905,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Returns a JWT session token and user data if successful + /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials @@ -917,7 +918,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Returns a JWT session token and user data if successful + /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials @@ -970,7 +971,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -983,7 +984,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -1031,7 +1032,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -1045,7 +1046,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -1094,7 +1095,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a particular participant entry corresponding to user id + /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -1106,7 +1107,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// gets a particular participant entry corresponding to user id + /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -1155,7 +1156,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a particular participant entry corresponding to user id + /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -1168,7 +1169,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// gets a particular participant entry corresponding to user id + /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -1218,7 +1219,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -1230,7 +1231,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -1279,7 +1280,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -1292,7 +1293,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -1342,7 +1343,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Create a new ship call + /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -1354,7 +1355,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Create a new ship call + /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -1406,7 +1407,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Create a new ship call + /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -1419,7 +1420,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Create a new ship call + /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -1472,7 +1473,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Updates a ship call + /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -1484,7 +1485,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Updates a ship call + /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -1536,7 +1537,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Updates a ship call + /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -1549,7 +1550,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Updates a ship call + /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -1602,7 +1603,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a list of registered shipcalls + /// gets a list of registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1613,7 +1614,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// gets a list of registered shipcalls + /// gets a list of registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1657,7 +1658,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a list of registered shipcalls + /// gets a list of registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1669,7 +1670,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// gets a list of registered shipcalls + /// gets a list of registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1714,7 +1715,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Delete a times entry for a ship call. + /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// @@ -1725,7 +1726,7 @@ namespace BreCalClient.misc.Api TimesDeleteWithHttpInfo(id); } /// - /// Delete a times entry for a ship call. + /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// @@ -1771,7 +1772,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Delete a times entry for a ship call. + /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// @@ -1783,7 +1784,7 @@ namespace BreCalClient.misc.Api await TimesDeleteWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); } /// - /// Delete a times entry for a ship call. + /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// @@ -1830,7 +1831,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Get all recorded times for a a ship call + /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1842,7 +1843,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Get all recorded times for a a ship call + /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1891,7 +1892,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Get all recorded times for a a ship call + /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1904,7 +1905,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Get all recorded times for a a ship call + /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1954,7 +1955,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Create a new times entry for a ship call + /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -1966,7 +1967,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Create a new times entry for a ship call + /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -2018,7 +2019,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Create a new times entry for a ship call + /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -2031,7 +2032,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Create a new times entry for a ship call + /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -2084,7 +2085,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -2096,7 +2097,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -2148,7 +2149,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -2161,7 +2162,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -2214,7 +2215,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Update user details (first/last name, phone, password) + /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details @@ -2225,7 +2226,7 @@ namespace BreCalClient.misc.Api UserPutWithHttpInfo(userDetails); } /// - /// Update user details (first/last name, phone, password) + /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details @@ -2277,7 +2278,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Update user details (first/last name, phone, password) + /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details @@ -2289,7 +2290,7 @@ namespace BreCalClient.misc.Api await UserPutWithHttpInfoAsync(userDetails, operationIndex, cancellationToken).ConfigureAwait(false); } /// - /// Update user details (first/last name, phone, password) + /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details @@ -2349,7 +2350,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -2816,7 +2817,8 @@ namespace BreCalClient.misc.Client MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; using (RestClient client = new RestClient(clientOptions, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) @@ -3084,7 +3086,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3144,7 +3146,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3284,7 +3286,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3502,7 +3504,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3539,6 +3541,11 @@ namespace BreCalClient.misc.Client string.Format("Error calling {0}: {1}", methodName, response.RawContent), response.RawContent, response.Headers); } + if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); + } return null; }; #endregion Static Members @@ -3591,7 +3598,7 @@ namespace BreCalClient.misc.Client { new Dictionary { {"url", "https://brecaldevel.bsmd-emswe.eu"}, - {"description", "Test server hosted on vcup"}, + {"description", "Development server hosted on vcup"}, } } }; @@ -3638,7 +3645,7 @@ namespace BreCalClient.misc.Client /// /// Gets or sets the base path for API access. /// - public virtual string BasePath + public virtual string BasePath { get { return _basePath; } set { _basePath = value; } @@ -3956,7 +3963,7 @@ namespace BreCalClient.misc.Client string report = "C# SDK (BreCalClient.misc) Debug Report:\n"; report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 0.6.0\n"; + report += " Version of the API: 1.1.0\n"; report += " SDK Package Version: 1.0.0\n"; return report; } @@ -4025,7 +4032,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4045,7 +4052,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4102,7 +4109,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4135,7 +4142,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4168,7 +4175,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4259,7 +4266,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4376,7 +4383,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4460,7 +4467,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4719,7 +4726,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4747,7 +4754,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4817,7 +4824,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4844,7 +4851,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4911,7 +4918,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4934,7 +4941,7 @@ namespace BreCalClient.misc.Model /// created. /// modified. /// deleted (default to false). - public Berth(int id = default(int), string name = default(string), int? ownerId = default(int?), int? authorityId = default(int?), bool? varLock = default(bool?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) + public Berth(int id = default(int), string name = default(string), int ownerId = default(int), int authorityId = default(int), bool varLock = default(bool), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) { this.Id = id; this.Name = name; @@ -4959,17 +4966,17 @@ namespace BreCalClient.misc.Model /// Gets or Sets OwnerId /// [DataMember(Name = "owner_id", EmitDefaultValue = true)] - public int? OwnerId { get; set; } + public int OwnerId { get; set; } /// /// Gets or Sets AuthorityId /// [DataMember(Name = "authority_id", EmitDefaultValue = true)] - public int? AuthorityId { get; set; } + public int AuthorityId { get; set; } /// /// Gets or Sets VarLock /// [DataMember(Name = "lock", EmitDefaultValue = true)] - public bool? VarLock { get; set; } + public bool VarLock { get; set; } /// /// Gets or Sets Created /// @@ -4979,7 +4986,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime? Modified { get; set; } + public DateTime Modified { get; set; } /// /// Gets or Sets Deleted /// @@ -5032,41 +5039,38 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.OwnerId == input.OwnerId || - (this.OwnerId != null && - this.OwnerId.Equals(input.OwnerId)) - ) && + this.OwnerId.Equals(input.OwnerId) + ) && ( this.AuthorityId == input.AuthorityId || - (this.AuthorityId != null && - this.AuthorityId.Equals(input.AuthorityId)) - ) && + this.AuthorityId.Equals(input.AuthorityId) + ) && ( this.VarLock == input.VarLock || - (this.VarLock != null && - this.VarLock.Equals(input.VarLock)) - ) && + this.VarLock.Equals(input.VarLock) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -5086,18 +5090,9 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } - if (this.OwnerId != null) - { - hashCode = (hashCode * 59) + this.OwnerId.GetHashCode(); - } - if (this.AuthorityId != null) - { - hashCode = (hashCode * 59) + this.AuthorityId.GetHashCode(); - } - if (this.VarLock != null) - { - hashCode = (hashCode * 59) + this.VarLock.GetHashCode(); - } + hashCode = (hashCode * 59) + this.OwnerId.GetHashCode(); + hashCode = (hashCode * 59) + this.AuthorityId.GetHashCode(); + hashCode = (hashCode * 59) + this.VarLock.GetHashCode(); if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -5132,7 +5127,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5220,12 +5215,12 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Username == input.Username || (this.Username != null && this.Username.Equals(input.Username)) - ) && + ) && ( this.Password == input.Password || (this.Password != null && @@ -5269,7 +5264,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5345,7 +5340,7 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Message == input.Message || (this.Message != null && @@ -5385,7 +5380,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5450,7 +5445,7 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.VarId == input.VarId || this.VarId.Equals(input.VarId) @@ -5486,7 +5481,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5615,44 +5610,44 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) - ) && + ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) - ) && + ) && ( this.UserName == input.UserName || (this.UserName != null && this.UserName.Equals(input.UserName)) - ) && + ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) - ) && + ) && ( this.UserEmail == input.UserEmail || (this.UserEmail != null && this.UserEmail.Equals(input.UserEmail)) - ) && + ) && ( this.Exp == input.Exp || this.Exp.Equals(input.Exp) - ) && + ) && ( this.Token == input.Token || (this.Token != null && @@ -5715,7 +5710,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5727,33 +5722,11 @@ namespace BreCalClient.misc.Model [DataContract(Name = "notification")] public partial class Notification : IEquatable, IValidatableObject { - /// - /// Defines NotificationType - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum NotificationTypeEnum - { - /// - /// Enum Undefined for value: undefined - /// - [EnumMember(Value = "undefined")] - Undefined = 1, - /// - /// Enum Email for value: email - /// - [EnumMember(Value = "email")] - Email = 2, - /// - /// Enum Push for value: push - /// - [EnumMember(Value = "push")] - Push = 3 - } /// /// Gets or Sets NotificationType /// [DataMember(Name = "notification_type", EmitDefaultValue = true)] - public NotificationTypeEnum? NotificationType { get; set; } + public NotificationType? NotificationType { get; set; } /// /// Initializes a new instance of the class. /// @@ -5765,7 +5738,7 @@ namespace BreCalClient.misc.Model /// acknowledged. /// created. /// modified. - public Notification(int id = default(int), int timesId = default(int), int participantId = default(int), NotificationTypeEnum? notificationType = default(NotificationTypeEnum?), DateTime timestamp = default(DateTime), bool acknowledged = default(bool), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) + public Notification(int id = default(int), int timesId = default(int), int participantId = default(int), NotificationType? notificationType = default(NotificationType?), DateTime timestamp = default(DateTime), bool acknowledged = default(bool), DateTime created = default(DateTime), DateTime modified = default(DateTime)) { this.Id = id; this.TimesId = timesId; @@ -5810,7 +5783,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime? Modified { get; set; } + public DateTime Modified { get; set; } /// /// Returns the string presentation of the object /// @@ -5858,37 +5831,37 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.TimesId == input.TimesId || this.TimesId.Equals(input.TimesId) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.NotificationType == input.NotificationType || this.NotificationType.Equals(input.NotificationType) - ) && + ) && ( this.Timestamp == input.Timestamp || (this.Timestamp != null && this.Timestamp.Equals(input.Timestamp)) - ) && + ) && ( this.Acknowledged == input.Acknowledged || this.Acknowledged.Equals(input.Acknowledged) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -5941,7 +5914,42 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Model +{ + /// + /// Defines NotificationType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum NotificationType + { + /// + /// Enum Undefined for value: undefined + /// + [EnumMember(Value = "undefined")] + Undefined = 1, + /// + /// Enum Email for value: email + /// + [EnumMember(Value = "email")] + Email = 2, + /// + /// Enum Push for value: push + /// + [EnumMember(Value = "push")] + Push = 3 + } +} + +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5953,6 +5961,11 @@ namespace BreCalClient.misc.Model [DataContract(Name = "participant")] public partial class Participant : IEquatable, IValidatableObject { + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = true)] + public ParticipantType? Type { get; set; } /// /// Initializes a new instance of the class. /// @@ -5966,7 +5979,7 @@ namespace BreCalClient.misc.Model /// created. /// modified. /// deleted (default to false). - public Participant(int id = default(int), string name = default(string), string street = default(string), string postalCode = default(string), string city = default(string), int type = default(int), int? flags = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) + public Participant(int id = default(int), string name = default(string), string street = default(string), string postalCode = default(string), string city = default(string), ParticipantType? type = default(ParticipantType?), int flags = default(int), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) { this.Id = id; this.Name = name; @@ -6005,15 +6018,10 @@ namespace BreCalClient.misc.Model [DataMember(Name = "city", EmitDefaultValue = true)] public string City { get; set; } /// - /// Gets or Sets Type - /// - [DataMember(Name = "type", EmitDefaultValue = true)] - public int Type { get; set; } - /// /// Gets or Sets Flags /// [DataMember(Name = "flags", EmitDefaultValue = true)] - public int? Flags { get; set; } + public int Flags { get; set; } /// /// Gets or Sets Created /// @@ -6023,7 +6031,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime? Modified { get; set; } + public DateTime Modified { get; set; } /// /// Gets or Sets Deleted /// @@ -6078,50 +6086,49 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.Street == input.Street || (this.Street != null && this.Street.Equals(input.Street)) - ) && + ) && ( this.PostalCode == input.PostalCode || (this.PostalCode != null && this.PostalCode.Equals(input.PostalCode)) - ) && + ) && ( this.City == input.City || (this.City != null && this.City.Equals(input.City)) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) - ) && + ) && ( this.Flags == input.Flags || - (this.Flags != null && - this.Flags.Equals(input.Flags)) - ) && + this.Flags.Equals(input.Flags) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -6154,10 +6161,7 @@ namespace BreCalClient.misc.Model hashCode = (hashCode * 59) + this.City.GetHashCode(); } hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Flags != null) - { - hashCode = (hashCode * 59) + this.Flags.GetHashCode(); - } + hashCode = (hashCode * 59) + this.Flags.GetHashCode(); if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -6207,7 +6211,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6285,11 +6289,11 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) @@ -6326,7 +6330,54 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Model +{ + /// + /// Defines ParticipantType + /// + public enum ParticipantType + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + /// + /// Enum NUMBER_4 for value: 4 + /// + NUMBER_4 = 4, + /// + /// Enum NUMBER_8 for value: 8 + /// + NUMBER_8 = 8, + /// + /// Enum NUMBER_16 for value: 16 + /// + NUMBER_16 = 16, + /// + /// Enum NUMBER_32 for value: 32 + /// + NUMBER_32 = 32, + /// + /// Enum NUMBER_64 for value: 64 + /// + NUMBER_64 = 64 + } +} + +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6354,7 +6405,7 @@ namespace BreCalClient.misc.Model /// created. /// modified. /// deleted (default to false). - public Ship(int id = default(int), string name = default(string), int? imo = default(int?), string callsign = default(string), int? participantId = default(int?), float? length = default(float?), float? width = default(float?), bool isTug = false, int? bollardPull = default(int?), int? eni = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) + public Ship(int id = default(int), string name = default(string), int imo = default(int), string callsign = default(string), int participantId = default(int), float length = default(float), float width = default(float), bool isTug = false, int bollardPull = default(int), int eni = default(int), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) { this.Id = id; this.Name = name; @@ -6384,7 +6435,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Imo /// [DataMember(Name = "imo", EmitDefaultValue = true)] - public int? Imo { get; set; } + public int Imo { get; set; } /// /// Gets or Sets Callsign /// @@ -6394,17 +6445,17 @@ namespace BreCalClient.misc.Model /// Gets or Sets ParticipantId /// [DataMember(Name = "participant_id", EmitDefaultValue = true)] - public int? ParticipantId { get; set; } + public int ParticipantId { get; set; } /// /// Gets or Sets Length /// [DataMember(Name = "length", EmitDefaultValue = true)] - public float? Length { get; set; } + public float Length { get; set; } /// /// Gets or Sets Width /// [DataMember(Name = "width", EmitDefaultValue = true)] - public float? Width { get; set; } + public float Width { get; set; } /// /// Gets or Sets IsTug /// @@ -6414,12 +6465,12 @@ namespace BreCalClient.misc.Model /// Gets or Sets BollardPull /// [DataMember(Name = "bollard_pull", EmitDefaultValue = true)] - public int? BollardPull { get; set; } + public int BollardPull { get; set; } /// /// Gets or Sets Eni /// [DataMember(Name = "eni", EmitDefaultValue = true)] - public int? Eni { get; set; } + public int Eni { get; set; } /// /// Gets or Sets Created /// @@ -6429,7 +6480,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime? Modified { get; set; } + public DateTime Modified { get; set; } /// /// Gets or Sets Deleted /// @@ -6487,65 +6538,59 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.Imo == input.Imo || - (this.Imo != null && - this.Imo.Equals(input.Imo)) - ) && + this.Imo.Equals(input.Imo) + ) && ( this.Callsign == input.Callsign || (this.Callsign != null && this.Callsign.Equals(input.Callsign)) - ) && + ) && ( this.ParticipantId == input.ParticipantId || - (this.ParticipantId != null && - this.ParticipantId.Equals(input.ParticipantId)) - ) && + this.ParticipantId.Equals(input.ParticipantId) + ) && ( this.Length == input.Length || - (this.Length != null && - this.Length.Equals(input.Length)) - ) && + this.Length.Equals(input.Length) + ) && ( this.Width == input.Width || - (this.Width != null && - this.Width.Equals(input.Width)) - ) && + this.Width.Equals(input.Width) + ) && ( this.IsTug == input.IsTug || this.IsTug.Equals(input.IsTug) - ) && + ) && ( this.BollardPull == input.BollardPull || - (this.BollardPull != null && - this.BollardPull.Equals(input.BollardPull)) - ) && + this.BollardPull.Equals(input.BollardPull) + ) && ( this.Eni == input.Eni || - (this.Eni != null && - this.Eni.Equals(input.Eni)) - ) && + this.Eni.Equals(input.Eni) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -6565,35 +6610,17 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } - if (this.Imo != null) - { - hashCode = (hashCode * 59) + this.Imo.GetHashCode(); - } + hashCode = (hashCode * 59) + this.Imo.GetHashCode(); if (this.Callsign != null) { hashCode = (hashCode * 59) + this.Callsign.GetHashCode(); } - if (this.ParticipantId != null) - { - hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - } - if (this.Length != null) - { - hashCode = (hashCode * 59) + this.Length.GetHashCode(); - } - if (this.Width != null) - { - hashCode = (hashCode * 59) + this.Width.GetHashCode(); - } + hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); + hashCode = (hashCode * 59) + this.Length.GetHashCode(); + hashCode = (hashCode * 59) + this.Width.GetHashCode(); hashCode = (hashCode * 59) + this.IsTug.GetHashCode(); - if (this.BollardPull != null) - { - hashCode = (hashCode * 59) + this.BollardPull.GetHashCode(); - } - if (this.Eni != null) - { - hashCode = (hashCode * 59) + this.Eni.GetHashCode(); - } + hashCode = (hashCode * 59) + this.BollardPull.GetHashCode(); + hashCode = (hashCode * 59) + this.Eni.GetHashCode(); if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -6633,7 +6660,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6645,6 +6672,11 @@ namespace BreCalClient.misc.Model [DataContract(Name = "shipcall")] public partial class Shipcall : IEquatable, IValidatableObject { + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public ShipcallType Type { get; set; } /// /// Initializes a new instance of the class. /// @@ -6681,7 +6713,7 @@ namespace BreCalClient.misc.Model /// participants. /// created. /// modified. - public Shipcall(int id = default(int), int shipId = default(int), int type = default(int), 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?), float? draft = default(float?), 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?), int? evaluation = default(int?), string evaluationMessage = default(string), 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), float draft = default(float), 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), int evaluation = default(int), string evaluationMessage = default(string), List participants = default(List), DateTime created = default(DateTime), DateTime modified = default(DateTime)) { this.Id = id; this.ShipId = shipId; @@ -6724,15 +6756,10 @@ namespace BreCalClient.misc.Model [DataMember(Name = "ship_id", IsRequired = true, EmitDefaultValue = true)] public int ShipId { get; set; } /// - /// Gets or Sets Type - /// - [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] - public int Type { get; set; } - /// /// Gets or Sets Eta /// [DataMember(Name = "eta", EmitDefaultValue = true)] - public DateTime? Eta { get; set; } + public DateTime Eta { get; set; } /// /// Gets or Sets Voyage /// @@ -6742,97 +6769,97 @@ namespace BreCalClient.misc.Model /// Gets or Sets Etd /// [DataMember(Name = "etd", EmitDefaultValue = true)] - public DateTime? Etd { get; set; } + public DateTime Etd { get; set; } /// /// Gets or Sets ArrivalBerthId /// [DataMember(Name = "arrival_berth_id", EmitDefaultValue = true)] - public int? ArrivalBerthId { get; set; } + public int ArrivalBerthId { get; set; } /// /// Gets or Sets DepartureBerthId /// [DataMember(Name = "departure_berth_id", EmitDefaultValue = true)] - public int? DepartureBerthId { get; set; } + public int DepartureBerthId { get; set; } /// /// Gets or Sets TugRequired /// [DataMember(Name = "tug_required", EmitDefaultValue = true)] - public bool? TugRequired { get; set; } + public bool TugRequired { get; set; } /// /// Gets or Sets PilotRequired /// [DataMember(Name = "pilot_required", EmitDefaultValue = true)] - public bool? PilotRequired { get; set; } + public bool PilotRequired { get; set; } /// /// Gets or Sets Flags /// [DataMember(Name = "flags", EmitDefaultValue = true)] - public int? Flags { get; set; } + public int Flags { get; set; } /// /// Gets or Sets PierSide /// [DataMember(Name = "pier_side", EmitDefaultValue = true)] - public bool? PierSide { get; set; } + public bool PierSide { get; set; } /// /// Gets or Sets Bunkering /// [DataMember(Name = "bunkering", EmitDefaultValue = true)] - public bool? Bunkering { get; set; } + public bool Bunkering { get; set; } /// /// Gets or Sets ReplenishingTerminal /// [DataMember(Name = "replenishing_terminal", EmitDefaultValue = true)] - public bool? ReplenishingTerminal { get; set; } + public bool ReplenishingTerminal { get; set; } /// /// Gets or Sets ReplenishingLock /// [DataMember(Name = "replenishing_lock", EmitDefaultValue = true)] - public bool? ReplenishingLock { get; set; } + public bool ReplenishingLock { get; set; } /// /// Gets or Sets Draft /// [DataMember(Name = "draft", EmitDefaultValue = true)] - public float? Draft { get; set; } + public float Draft { get; set; } /// /// Gets or Sets TidalWindowFrom /// [DataMember(Name = "tidal_window_from", EmitDefaultValue = true)] - public DateTime? TidalWindowFrom { get; set; } + public DateTime TidalWindowFrom { get; set; } /// /// Gets or Sets TidalWindowTo /// [DataMember(Name = "tidal_window_to", EmitDefaultValue = true)] - public DateTime? TidalWindowTo { get; set; } + public DateTime TidalWindowTo { get; set; } /// /// Gets or Sets RainSensitiveCargo /// [DataMember(Name = "rain_sensitive_cargo", EmitDefaultValue = true)] - public bool? RainSensitiveCargo { get; set; } + public bool RainSensitiveCargo { get; set; } /// /// Gets or Sets RecommendedTugs /// [DataMember(Name = "recommended_tugs", EmitDefaultValue = true)] - public int? RecommendedTugs { get; set; } + public int RecommendedTugs { get; set; } /// /// Gets or Sets Anchored /// [DataMember(Name = "anchored", EmitDefaultValue = true)] - public bool? Anchored { get; set; } + public bool Anchored { get; set; } /// /// Gets or Sets MooredLock /// [DataMember(Name = "moored_lock", EmitDefaultValue = true)] - public bool? MooredLock { get; set; } + public bool MooredLock { get; set; } /// /// Gets or Sets Canceled /// [DataMember(Name = "canceled", EmitDefaultValue = true)] - public bool? Canceled { get; set; } + public bool Canceled { get; set; } /// /// Gets or Sets Evaluation /// [DataMember(Name = "evaluation", EmitDefaultValue = true)] - public int? Evaluation { get; set; } + public int Evaluation { get; set; } /// /// Gets or Sets EvaluationMessage /// @@ -6852,7 +6879,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime? Modified { get; set; } + public DateTime Modified { get; set; } /// /// Returns the string presentation of the object /// @@ -6920,140 +6947,124 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ShipId == input.ShipId || this.ShipId.Equals(input.ShipId) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) - ) && + ) && ( this.Eta == input.Eta || (this.Eta != null && this.Eta.Equals(input.Eta)) - ) && + ) && ( this.Voyage == input.Voyage || (this.Voyage != null && this.Voyage.Equals(input.Voyage)) - ) && + ) && ( this.Etd == input.Etd || (this.Etd != null && this.Etd.Equals(input.Etd)) - ) && + ) && ( this.ArrivalBerthId == input.ArrivalBerthId || - (this.ArrivalBerthId != null && - this.ArrivalBerthId.Equals(input.ArrivalBerthId)) - ) && + this.ArrivalBerthId.Equals(input.ArrivalBerthId) + ) && ( this.DepartureBerthId == input.DepartureBerthId || - (this.DepartureBerthId != null && - this.DepartureBerthId.Equals(input.DepartureBerthId)) - ) && + this.DepartureBerthId.Equals(input.DepartureBerthId) + ) && ( this.TugRequired == input.TugRequired || - (this.TugRequired != null && - this.TugRequired.Equals(input.TugRequired)) - ) && + this.TugRequired.Equals(input.TugRequired) + ) && ( this.PilotRequired == input.PilotRequired || - (this.PilotRequired != null && - this.PilotRequired.Equals(input.PilotRequired)) - ) && + this.PilotRequired.Equals(input.PilotRequired) + ) && ( this.Flags == input.Flags || - (this.Flags != null && - this.Flags.Equals(input.Flags)) - ) && + this.Flags.Equals(input.Flags) + ) && ( this.PierSide == input.PierSide || - (this.PierSide != null && - this.PierSide.Equals(input.PierSide)) - ) && + this.PierSide.Equals(input.PierSide) + ) && ( this.Bunkering == input.Bunkering || - (this.Bunkering != null && - this.Bunkering.Equals(input.Bunkering)) - ) && + this.Bunkering.Equals(input.Bunkering) + ) && ( this.ReplenishingTerminal == input.ReplenishingTerminal || - (this.ReplenishingTerminal != null && - this.ReplenishingTerminal.Equals(input.ReplenishingTerminal)) - ) && + this.ReplenishingTerminal.Equals(input.ReplenishingTerminal) + ) && ( this.ReplenishingLock == input.ReplenishingLock || - (this.ReplenishingLock != null && - this.ReplenishingLock.Equals(input.ReplenishingLock)) - ) && + this.ReplenishingLock.Equals(input.ReplenishingLock) + ) && ( this.Draft == input.Draft || - (this.Draft != null && - this.Draft.Equals(input.Draft)) - ) && + this.Draft.Equals(input.Draft) + ) && ( this.TidalWindowFrom == input.TidalWindowFrom || (this.TidalWindowFrom != null && this.TidalWindowFrom.Equals(input.TidalWindowFrom)) - ) && + ) && ( this.TidalWindowTo == input.TidalWindowTo || (this.TidalWindowTo != null && this.TidalWindowTo.Equals(input.TidalWindowTo)) - ) && + ) && ( this.RainSensitiveCargo == input.RainSensitiveCargo || - (this.RainSensitiveCargo != null && - this.RainSensitiveCargo.Equals(input.RainSensitiveCargo)) - ) && + this.RainSensitiveCargo.Equals(input.RainSensitiveCargo) + ) && ( this.RecommendedTugs == input.RecommendedTugs || - (this.RecommendedTugs != null && - this.RecommendedTugs.Equals(input.RecommendedTugs)) - ) && + this.RecommendedTugs.Equals(input.RecommendedTugs) + ) && ( this.Anchored == input.Anchored || - (this.Anchored != null && - this.Anchored.Equals(input.Anchored)) - ) && + this.Anchored.Equals(input.Anchored) + ) && ( this.MooredLock == input.MooredLock || - (this.MooredLock != null && - this.MooredLock.Equals(input.MooredLock)) - ) && + this.MooredLock.Equals(input.MooredLock) + ) && ( this.Canceled == input.Canceled || - (this.Canceled != null && - this.Canceled.Equals(input.Canceled)) - ) && + this.Canceled.Equals(input.Canceled) + ) && ( this.Evaluation == input.Evaluation || - (this.Evaluation != null && - this.Evaluation.Equals(input.Evaluation)) - ) && + this.Evaluation.Equals(input.Evaluation) + ) && ( this.EvaluationMessage == input.EvaluationMessage || (this.EvaluationMessage != null && this.EvaluationMessage.Equals(input.EvaluationMessage)) - ) && + ) && ( this.Participants == input.Participants || this.Participants != null && input.Participants != null && this.Participants.SequenceEqual(input.Participants) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -7084,46 +7095,16 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Etd.GetHashCode(); } - if (this.ArrivalBerthId != null) - { - hashCode = (hashCode * 59) + this.ArrivalBerthId.GetHashCode(); - } - if (this.DepartureBerthId != null) - { - hashCode = (hashCode * 59) + this.DepartureBerthId.GetHashCode(); - } - if (this.TugRequired != null) - { - hashCode = (hashCode * 59) + this.TugRequired.GetHashCode(); - } - if (this.PilotRequired != null) - { - hashCode = (hashCode * 59) + this.PilotRequired.GetHashCode(); - } - if (this.Flags != null) - { - hashCode = (hashCode * 59) + this.Flags.GetHashCode(); - } - if (this.PierSide != null) - { - hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); - } - if (this.Bunkering != null) - { - hashCode = (hashCode * 59) + this.Bunkering.GetHashCode(); - } - if (this.ReplenishingTerminal != null) - { - hashCode = (hashCode * 59) + this.ReplenishingTerminal.GetHashCode(); - } - if (this.ReplenishingLock != null) - { - hashCode = (hashCode * 59) + this.ReplenishingLock.GetHashCode(); - } - if (this.Draft != null) - { - hashCode = (hashCode * 59) + this.Draft.GetHashCode(); - } + hashCode = (hashCode * 59) + this.ArrivalBerthId.GetHashCode(); + hashCode = (hashCode * 59) + this.DepartureBerthId.GetHashCode(); + hashCode = (hashCode * 59) + this.TugRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.PilotRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.Flags.GetHashCode(); + hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); + hashCode = (hashCode * 59) + this.Bunkering.GetHashCode(); + hashCode = (hashCode * 59) + this.ReplenishingTerminal.GetHashCode(); + hashCode = (hashCode * 59) + this.ReplenishingLock.GetHashCode(); + hashCode = (hashCode * 59) + this.Draft.GetHashCode(); if (this.TidalWindowFrom != null) { hashCode = (hashCode * 59) + this.TidalWindowFrom.GetHashCode(); @@ -7132,30 +7113,12 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.TidalWindowTo.GetHashCode(); } - if (this.RainSensitiveCargo != null) - { - hashCode = (hashCode * 59) + this.RainSensitiveCargo.GetHashCode(); - } - if (this.RecommendedTugs != null) - { - hashCode = (hashCode * 59) + this.RecommendedTugs.GetHashCode(); - } - if (this.Anchored != null) - { - hashCode = (hashCode * 59) + this.Anchored.GetHashCode(); - } - if (this.MooredLock != null) - { - hashCode = (hashCode * 59) + this.MooredLock.GetHashCode(); - } - if (this.Canceled != null) - { - hashCode = (hashCode * 59) + this.Canceled.GetHashCode(); - } - if (this.Evaluation != null) - { - hashCode = (hashCode * 59) + this.Evaluation.GetHashCode(); - } + hashCode = (hashCode * 59) + this.RainSensitiveCargo.GetHashCode(); + hashCode = (hashCode * 59) + this.RecommendedTugs.GetHashCode(); + hashCode = (hashCode * 59) + this.Anchored.GetHashCode(); + hashCode = (hashCode * 59) + this.MooredLock.GetHashCode(); + hashCode = (hashCode * 59) + this.Canceled.GetHashCode(); + hashCode = (hashCode * 59) + this.Evaluation.GetHashCode(); if (this.EvaluationMessage != null) { hashCode = (hashCode * 59) + this.EvaluationMessage.GetHashCode(); @@ -7197,7 +7160,47 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Model +{ + /// + /// Defines ShipcallType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ShipcallType + { + /// + /// Enum Undefined for value: undefined + /// + [EnumMember(Value = "undefined")] + Undefined = 1, + /// + /// Enum Arrival for value: arrival + /// + [EnumMember(Value = "arrival")] + Arrival = 2, + /// + /// Enum Departure for value: departure + /// + [EnumMember(Value = "departure")] + Departure = 3, + /// + /// Enum Shifting for value: shifting + /// + [EnumMember(Value = "shifting")] + Shifting = 4 + } +} + +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7209,6 +7212,11 @@ namespace BreCalClient.misc.Model [DataContract(Name = "times")] public partial class Times : IEquatable, IValidatableObject { + /// + /// Gets or Sets ParticipantType + /// + [DataMember(Name = "participant_type", EmitDefaultValue = true)] + public ParticipantType? ParticipantType { get; set; } /// /// Initializes a new instance of the class. /// @@ -7237,7 +7245,7 @@ namespace BreCalClient.misc.Model /// participantType. /// created. /// modified. - public Times(int id = default(int), DateTime? etaBerth = default(DateTime?), bool? etaBerthFixed = default(bool?), DateTime? etdBerth = default(DateTime?), bool? etdBerthFixed = default(bool?), DateTime? lockTime = default(DateTime?), bool? lockTimeFixed = default(bool?), DateTime? zoneEntry = default(DateTime?), bool? zoneEntryFixed = default(bool?), DateTime? operationsStart = default(DateTime?), DateTime? operationsEnd = default(DateTime?), string remarks = default(string), int shipcallId = default(int), int participantId = default(int), int? berthId = default(int?), string berthInfo = default(string), bool? pierSide = default(bool?), int? participantType = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) + public Times(int id = default(int), DateTime etaBerth = default(DateTime), bool etaBerthFixed = default(bool), DateTime etdBerth = default(DateTime), bool etdBerthFixed = default(bool), DateTime lockTime = default(DateTime), bool lockTimeFixed = default(bool), DateTime zoneEntry = default(DateTime), bool zoneEntryFixed = default(bool), DateTime operationsStart = default(DateTime), DateTime operationsEnd = default(DateTime), string remarks = default(string), int shipcallId = default(int), int participantId = default(int), int berthId = default(int), string berthInfo = default(string), bool pierSide = default(bool), ParticipantType? participantType = default(ParticipantType?), DateTime created = default(DateTime), DateTime modified = default(DateTime)) { this.ShipcallId = shipcallId; this.ParticipantId = participantId; @@ -7269,52 +7277,52 @@ namespace BreCalClient.misc.Model /// Gets or Sets EtaBerth /// [DataMember(Name = "eta_berth", EmitDefaultValue = true)] - public DateTime? EtaBerth { get; set; } + public DateTime EtaBerth { get; set; } /// /// Gets or Sets EtaBerthFixed /// [DataMember(Name = "eta_berth_fixed", EmitDefaultValue = true)] - public bool? EtaBerthFixed { get; set; } + public bool EtaBerthFixed { get; set; } /// /// Gets or Sets EtdBerth /// [DataMember(Name = "etd_berth", EmitDefaultValue = true)] - public DateTime? EtdBerth { get; set; } + public DateTime EtdBerth { get; set; } /// /// Gets or Sets EtdBerthFixed /// [DataMember(Name = "etd_berth_fixed", EmitDefaultValue = true)] - public bool? EtdBerthFixed { get; set; } + public bool EtdBerthFixed { get; set; } /// /// Gets or Sets LockTime /// [DataMember(Name = "lock_time", EmitDefaultValue = true)] - public DateTime? LockTime { get; set; } + public DateTime LockTime { get; set; } /// /// Gets or Sets LockTimeFixed /// [DataMember(Name = "lock_time_fixed", EmitDefaultValue = true)] - public bool? LockTimeFixed { get; set; } + public bool LockTimeFixed { get; set; } /// /// Gets or Sets ZoneEntry /// [DataMember(Name = "zone_entry", EmitDefaultValue = true)] - public DateTime? ZoneEntry { get; set; } + public DateTime ZoneEntry { get; set; } /// /// Gets or Sets ZoneEntryFixed /// [DataMember(Name = "zone_entry_fixed", EmitDefaultValue = true)] - public bool? ZoneEntryFixed { get; set; } + public bool ZoneEntryFixed { get; set; } /// /// Gets or Sets OperationsStart /// [DataMember(Name = "operations_start", EmitDefaultValue = true)] - public DateTime? OperationsStart { get; set; } + public DateTime OperationsStart { get; set; } /// /// Gets or Sets OperationsEnd /// [DataMember(Name = "operations_end", EmitDefaultValue = true)] - public DateTime? OperationsEnd { get; set; } + public DateTime OperationsEnd { get; set; } /// /// Gets or Sets Remarks /// @@ -7334,7 +7342,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets BerthId /// [DataMember(Name = "berth_id", EmitDefaultValue = true)] - public int? BerthId { get; set; } + public int BerthId { get; set; } /// /// Gets or Sets BerthInfo /// @@ -7344,12 +7352,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets PierSide /// [DataMember(Name = "pier_side", EmitDefaultValue = true)] - public bool? PierSide { get; set; } - /// - /// Gets or Sets ParticipantType - /// - [DataMember(Name = "participant_type", EmitDefaultValue = true)] - public int? ParticipantType { get; set; } + public bool PierSide { get; set; } /// /// Gets or Sets Created /// @@ -7359,7 +7362,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime? Modified { get; set; } + public DateTime Modified { get; set; } /// /// Returns the string presentation of the object /// @@ -7419,99 +7422,92 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.EtaBerth == input.EtaBerth || (this.EtaBerth != null && this.EtaBerth.Equals(input.EtaBerth)) - ) && + ) && ( this.EtaBerthFixed == input.EtaBerthFixed || - (this.EtaBerthFixed != null && - this.EtaBerthFixed.Equals(input.EtaBerthFixed)) - ) && + this.EtaBerthFixed.Equals(input.EtaBerthFixed) + ) && ( this.EtdBerth == input.EtdBerth || (this.EtdBerth != null && this.EtdBerth.Equals(input.EtdBerth)) - ) && + ) && ( this.EtdBerthFixed == input.EtdBerthFixed || - (this.EtdBerthFixed != null && - this.EtdBerthFixed.Equals(input.EtdBerthFixed)) - ) && + this.EtdBerthFixed.Equals(input.EtdBerthFixed) + ) && ( this.LockTime == input.LockTime || (this.LockTime != null && this.LockTime.Equals(input.LockTime)) - ) && + ) && ( this.LockTimeFixed == input.LockTimeFixed || - (this.LockTimeFixed != null && - this.LockTimeFixed.Equals(input.LockTimeFixed)) - ) && + this.LockTimeFixed.Equals(input.LockTimeFixed) + ) && ( this.ZoneEntry == input.ZoneEntry || (this.ZoneEntry != null && this.ZoneEntry.Equals(input.ZoneEntry)) - ) && + ) && ( this.ZoneEntryFixed == input.ZoneEntryFixed || - (this.ZoneEntryFixed != null && - this.ZoneEntryFixed.Equals(input.ZoneEntryFixed)) - ) && + this.ZoneEntryFixed.Equals(input.ZoneEntryFixed) + ) && ( this.OperationsStart == input.OperationsStart || (this.OperationsStart != null && this.OperationsStart.Equals(input.OperationsStart)) - ) && + ) && ( this.OperationsEnd == input.OperationsEnd || (this.OperationsEnd != null && this.OperationsEnd.Equals(input.OperationsEnd)) - ) && + ) && ( this.Remarks == input.Remarks || (this.Remarks != null && this.Remarks.Equals(input.Remarks)) - ) && + ) && ( this.ShipcallId == input.ShipcallId || this.ShipcallId.Equals(input.ShipcallId) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.BerthId == input.BerthId || - (this.BerthId != null && - this.BerthId.Equals(input.BerthId)) - ) && + this.BerthId.Equals(input.BerthId) + ) && ( this.BerthInfo == input.BerthInfo || (this.BerthInfo != null && this.BerthInfo.Equals(input.BerthInfo)) - ) && + ) && ( this.PierSide == input.PierSide || - (this.PierSide != null && - this.PierSide.Equals(input.PierSide)) - ) && + this.PierSide.Equals(input.PierSide) + ) && ( this.ParticipantType == input.ParticipantType || - (this.ParticipantType != null && - this.ParticipantType.Equals(input.ParticipantType)) - ) && + this.ParticipantType.Equals(input.ParticipantType) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -7532,34 +7528,22 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.EtaBerth.GetHashCode(); } - if (this.EtaBerthFixed != null) - { - hashCode = (hashCode * 59) + this.EtaBerthFixed.GetHashCode(); - } + hashCode = (hashCode * 59) + this.EtaBerthFixed.GetHashCode(); if (this.EtdBerth != null) { hashCode = (hashCode * 59) + this.EtdBerth.GetHashCode(); } - if (this.EtdBerthFixed != null) - { - hashCode = (hashCode * 59) + this.EtdBerthFixed.GetHashCode(); - } + hashCode = (hashCode * 59) + this.EtdBerthFixed.GetHashCode(); if (this.LockTime != null) { hashCode = (hashCode * 59) + this.LockTime.GetHashCode(); } - if (this.LockTimeFixed != null) - { - hashCode = (hashCode * 59) + this.LockTimeFixed.GetHashCode(); - } + hashCode = (hashCode * 59) + this.LockTimeFixed.GetHashCode(); if (this.ZoneEntry != null) { hashCode = (hashCode * 59) + this.ZoneEntry.GetHashCode(); } - if (this.ZoneEntryFixed != null) - { - hashCode = (hashCode * 59) + this.ZoneEntryFixed.GetHashCode(); - } + hashCode = (hashCode * 59) + this.ZoneEntryFixed.GetHashCode(); if (this.OperationsStart != null) { hashCode = (hashCode * 59) + this.OperationsStart.GetHashCode(); @@ -7574,22 +7558,13 @@ namespace BreCalClient.misc.Model } hashCode = (hashCode * 59) + this.ShipcallId.GetHashCode(); hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - if (this.BerthId != null) - { - hashCode = (hashCode * 59) + this.BerthId.GetHashCode(); - } + hashCode = (hashCode * 59) + this.BerthId.GetHashCode(); if (this.BerthInfo != null) { hashCode = (hashCode * 59) + this.BerthInfo.GetHashCode(); } - if (this.PierSide != null) - { - hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); - } - if (this.ParticipantType != null) - { - hashCode = (hashCode * 59) + this.ParticipantType.GetHashCode(); - } + hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); + hashCode = (hashCode * 59) + this.ParticipantType.GetHashCode(); if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -7623,7 +7598,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.6.0 + * The version of the OpenAPI document: 1.1.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7736,36 +7711,36 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.OldPassword == input.OldPassword || (this.OldPassword != null && this.OldPassword.Equals(input.OldPassword)) - ) && + ) && ( this.NewPassword == input.NewPassword || (this.NewPassword != null && this.NewPassword.Equals(input.NewPassword)) - ) && + ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) - ) && + ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) - ) && + ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) - ) && + ) && ( this.UserEmail == input.UserEmail || (this.UserEmail != null && diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index a3ccfc9..e014ffa 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -1,9 +1,9 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: - version: "0.6.0" + version: "1.1.0" title: "Bremen calling API" description: Administer DEBRE ship calls, times and notifications - termsOfService: "https://www.bsmd.de/" # url to terms page + termsOfService: "https://www.bsmd.de/" # TBD: url to terms page contact: name: "Bremen calling API" url: "https://www.textbausteine.net" @@ -13,8 +13,8 @@ info: url: "https://www.bsmd.de/license" servers: - - url: "https://brecaltest.bsmd-emswe.eu/" - description: "Test server hosted on vcup" + - url: "https://brecaldevel.bsmd-emswe.eu/" + description: "Development server hosted on vcup" paths: /login: @@ -353,8 +353,7 @@ components: ship_id: type: integer type: - type: integer - # TODO: use an enum + type: ShipcallType eta: type: string format: date-time @@ -507,8 +506,7 @@ components: type: boolean nullable: true participant_type: - type: integer - nullable: true + type: ParticipantType created: type: string format: date-time @@ -619,8 +617,7 @@ components: participant_id: type: integer notification_type: - type: string - enum: [undefined, email, push] + $ref: "#/components/schemas/NotificationType" timestamp: type: string format: date-time @@ -658,7 +655,7 @@ components: type: string maxLength: 64 type: - type: integer + type: ParticipantType flags: type: integer nullable: true @@ -741,6 +738,65 @@ components: description: A human readable error message type: string + ShipcallType: + type: string + enum: [undefined, arrival, departure, shifting] + + NotificationType: + type: string + enum: [undefined, email, push] + + ParticipantType: + type: integer + enum: + - 1 + - 2 + - 4 + - 8 + - 16 + - 32 + - 64 + x-enumDescriptions: + 1: bsmd + 2: terminal + 4: pilot + 8: agency + 16: mooring + 32: port_authority + 64: tug + + # this here works only with OpenAPI 3.1 + # ParticipantType: + # type: integer + # oneOf: + # - const: 1 + # title: bsmd + # description: Bremen Schiffsmeldedienst + + # - const: 2 + # title: terminal + # description: Terminal + + # - const: 4 + # title: pilot + # description: Pilot + + # - const: 8 + # title: agency + # description: Agency + + # - const: 16 + # title: mooring + # description: Mooring + + # - const: 32 + # title: port_authority + # description: Port Authority + + # - const: 64 + # title: tug + # description: Tug + securitySchemes: ApiKey: type: apiKey @@ -760,7 +816,7 @@ components: schema: $ref: "#/components/schemas/Id" 400: - description: Invalid input + description: Bad request content: application/json: schema: @@ -771,6 +827,18 @@ components: application/json: schema: $ref: "#/components/schemas/Error" + 403: + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 404: + description: Not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" 500: description: Unexpected error content: @@ -778,7 +846,7 @@ components: schema: $ref: "#/components/schemas/Error" 503: - description: Not available + description: Service unavailable content: application/json: schema: diff --git a/src/BreCalClient/BreCalClient.csproj b/src/BreCalClient/BreCalClient.csproj index 3d05079..5e67f3a 100644 --- a/src/BreCalClient/BreCalClient.csproj +++ b/src/BreCalClient/BreCalClient.csproj @@ -106,7 +106,7 @@ - + diff --git a/src/BreCalClient/EditShipcallControl.xaml.cs b/src/BreCalClient/EditShipcallControl.xaml.cs index 9032c1a..5c1043e 100644 --- a/src/BreCalClient/EditShipcallControl.xaml.cs +++ b/src/BreCalClient/EditShipcallControl.xaml.cs @@ -40,7 +40,7 @@ namespace BreCalClient this.comboBoxAgency.ItemsSource = BreCalLists.Participants_Agent; this.comboBoxShip.ItemsSource = BreCalLists.Ships; - this.comboBoxCategories.ItemsSource = Enum.GetValues(typeof(TypeEnum)); + this.comboBoxCategories.ItemsSource = Enum.GetValues(typeof(ShipcallType)); this.comboBoxArrivalBerth.ItemsSource = BreCalLists.Berths; this.comboBoxDepartureBerth.ItemsSource = BreCalLists.Berths; @@ -91,12 +91,12 @@ namespace BreCalClient private void comboBoxCategories_SelectionChanged(object? sender, SelectionChangedEventArgs? e) { - TypeEnum? type = this.comboBoxCategories.SelectedItem as TypeEnum?; + ShipcallType? type = this.comboBoxCategories.SelectedItem as ShipcallType?; if (type != null) { switch (type) { - case TypeEnum.Incoming: + case ShipcallType.Arrival: this.datePickerETA.IsEnabled = true; this.datePickerETD.IsEnabled = false; this.datePickerETD.Value = null; @@ -104,7 +104,7 @@ namespace BreCalClient this.comboBoxDepartureBerth.IsEnabled = false; this.comboBoxArrivalBerth.IsEnabled = true; break; - case TypeEnum.Outgoing: + case ShipcallType.Departure: this.datePickerETA.IsEnabled = false; this.datePickerETD.IsEnabled = true; this.datePickerETA.Value = null; @@ -112,7 +112,7 @@ namespace BreCalClient this.comboBoxArrivalBerth.IsEnabled = false; this.comboBoxDepartureBerth.IsEnabled = true; break; - case TypeEnum.Shifting: + case ShipcallType.Shifting: this.datePickerETA.IsEnabled = true; this.datePickerETD.IsEnabled = true; this.comboBoxArrivalBerth.IsEnabled = true; @@ -150,18 +150,18 @@ namespace BreCalClient } else { - TypeEnum callType = (TypeEnum)comboBoxCategories.SelectedItem; + ShipcallType callType = (ShipcallType)comboBoxCategories.SelectedItem; switch (callType) { - case TypeEnum.Outgoing: + case ShipcallType.Departure: isEnabled &= this.comboBoxDepartureBerth.SelectedItem != null; isEnabled &= this.datePickerETD.Value.HasValue; break; - case TypeEnum.Incoming: + case ShipcallType.Arrival: isEnabled &= this.comboBoxArrivalBerth.SelectedItem != null; isEnabled &= this.datePickerETA.Value.HasValue; break; - case TypeEnum.Shifting: + case ShipcallType.Shifting: isEnabled &= ((this.comboBoxDepartureBerth.SelectedItem != null) && (this.comboBoxArrivalBerth.SelectedItem != null)); isEnabled &= this.datePickerETD.Value.HasValue; isEnabled &= this.datePickerETA.Value.HasValue; @@ -178,7 +178,7 @@ namespace BreCalClient { if (this.ShipcallModel.Shipcall != null) { - this.ShipcallModel.Shipcall.Type = (int)this.comboBoxCategories.SelectedItem; + this.ShipcallModel.Shipcall.Type = (ShipcallType) this.comboBoxCategories.SelectedItem; this.ShipcallModel.Shipcall.Eta = this.datePickerETA.Value; this.ShipcallModel.Shipcall.Etd = this.datePickerETD.Value; @@ -186,7 +186,7 @@ namespace BreCalClient this.ShipcallModel.Ship = ((ShipModel)this.comboBoxShip.SelectedItem).Ship; this.ShipcallModel.Shipcall.Canceled = this.checkBoxCancelled.IsChecked; - if (this.ShipcallModel.Shipcall.Type != 3) // incoming, outgoing + if (this.ShipcallModel.Shipcall.Type != ShipcallType.Shifting) // incoming, outgoing { this.ShipcallModel.Shipcall.ArrivalBerthId = (this.comboBoxArrivalBerth.SelectedItem != null) ? ((Berth)this.comboBoxArrivalBerth.SelectedItem).Id : null; this.ShipcallModel.Shipcall.DepartureBerthId = (this.comboBoxDepartureBerth.SelectedItem != null) ? ((Berth)this.comboBoxDepartureBerth.SelectedItem).Id : null; @@ -204,6 +204,7 @@ namespace BreCalClient ParticipantAssignment pa = new() { ParticipantId = participant.Id, + Type = (int)Extensions.ParticipantType.AGENCY }; this.ShipcallModel.AssignedParticipants[Extensions.ParticipantType.AGENCY] = pa; diff --git a/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs b/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs index c602978..fd948de 100644 --- a/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs +++ b/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs @@ -31,7 +31,7 @@ namespace BreCalClient public Times Times { get; set; } = new(); - public Extensions.TypeEnum CallType { get; set; } + public ShipcallType CallType { get; set; } #endregion diff --git a/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs b/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs index 47301f7..b0084ef 100644 --- a/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs +++ b/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs @@ -30,7 +30,7 @@ namespace BreCalClient public Times Times { get; set; } = new(); - public Extensions.TypeEnum CallType { get; set; } + public ShipcallType CallType { get; set; } #endregion diff --git a/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs b/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs index 8c0cfcc..dfd52d5 100644 --- a/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs +++ b/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs @@ -30,7 +30,7 @@ namespace BreCalClient public Times Times { get; set; } = new(); - public Extensions.TypeEnum CallType { get; set; } + public ShipcallType CallType { get; set; } #endregion diff --git a/src/BreCalClient/EditTimesControl.xaml.cs b/src/BreCalClient/EditTimesControl.xaml.cs index 7746904..3a8163c 100644 --- a/src/BreCalClient/EditTimesControl.xaml.cs +++ b/src/BreCalClient/EditTimesControl.xaml.cs @@ -27,7 +27,7 @@ namespace BreCalClient public Times Times { get; set; } = new(); - public Extensions.TypeEnum CallType { get; set; } + public ShipcallType CallType { get; set; } #endregion diff --git a/src/BreCalClient/EditTimesTerminalControl.xaml.cs b/src/BreCalClient/EditTimesTerminalControl.xaml.cs index eaed03c..5092a39 100644 --- a/src/BreCalClient/EditTimesTerminalControl.xaml.cs +++ b/src/BreCalClient/EditTimesTerminalControl.xaml.cs @@ -21,7 +21,7 @@ namespace BreCalClient public Times Times { get; set; } = new(); - public Extensions.TypeEnum CallType { get; set; } + public ShipcallType CallType { get; set; } #endregion diff --git a/src/BreCalClient/Extensions.cs b/src/BreCalClient/Extensions.cs index 2d15fc9..23611f1 100644 --- a/src/BreCalClient/Extensions.cs +++ b/src/BreCalClient/Extensions.cs @@ -13,30 +13,6 @@ namespace BreCalClient #region Enum - /// - /// Copied from models clunky I know - /// - [Flags] - public enum ParticipantType - { - [Description("not assigned")] - NONE = 0, - [Description("BSMD")] - BSMD = 1, - [Description("Terminal")] - TERMINAL = 2, - [Description("Lotsen")] - PILOT = 4, - [Description("Agentur")] - AGENCY = 8, - [Description("Festmacher")] - MOORING = 16, - [Description("Hafenamt")] - PORT_ADMINISTRATION = 32, - [Description("Schlepper")] - TUG = 64, - } - /// /// Custom participant flags /// @@ -47,16 +23,6 @@ namespace BreCalClient ALLOW_BSMD = 1, } - /// - /// Should actually be defined in yaml - /// - public enum TypeEnum - { - Incoming = 1, - Outgoing = 2, - Shifting = 3 - } - public enum SortOrder { SHIP_NAME, diff --git a/src/BreCalClient/IEditTimesControl.cs b/src/BreCalClient/IEditTimesControl.cs index 8be49ff..00f97b0 100644 --- a/src/BreCalClient/IEditTimesControl.cs +++ b/src/BreCalClient/IEditTimesControl.cs @@ -13,7 +13,7 @@ namespace BreCalClient string Title { get; set; } - Extensions.TypeEnum CallType { get; set; } + ShipcallType CallType { get; set; } bool? ShowDialog(); diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index 4d13c6b..8776e46 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -662,7 +662,7 @@ namespace BreCalClient } } - private async void Sc_EditTimesRequested(ShipcallControl obj, Times? times, Extensions.ParticipantType participantType) + private async void Sc_EditTimesRequested(ShipcallControl obj, Times? times, ParticipantType participantType) { if( obj.ShipcallControlModel == null) { return; } @@ -673,7 +673,7 @@ namespace BreCalClient etc.Title = obj.ShipcallControlModel.Title; if(obj.ShipcallControlModel.Shipcall != null) - etc.CallType = (TypeEnum) obj.ShipcallControlModel.Shipcall.Type; + etc.CallType = (ShipcallType) obj.ShipcallControlModel.Shipcall.Type; bool wasEdit = false; if (times != null) diff --git a/src/BreCalClient/ShipcallControl.xaml.cs b/src/BreCalClient/ShipcallControl.xaml.cs index 6ce8681..5fdc40b 100644 --- a/src/BreCalClient/ShipcallControl.xaml.cs +++ b/src/BreCalClient/ShipcallControl.xaml.cs @@ -44,7 +44,7 @@ namespace BreCalClient public event Action? EditAgencyRequested; - internal event Action? EditTimesRequested; + internal event Action? EditTimesRequested; #endregion diff --git a/src/BreCalClient/ShipcallControlModel.cs b/src/BreCalClient/ShipcallControlModel.cs index 18d89f7..bc6df14 100644 --- a/src/BreCalClient/ShipcallControlModel.cs +++ b/src/BreCalClient/ShipcallControlModel.cs @@ -1,6 +1,6 @@ // Copyright (c) 2023 schick Informatik // Description: Container model for shipcall related info -// +// using BreCalClient.misc.Api; using BreCalClient.misc.Model; @@ -44,11 +44,11 @@ namespace BreCalClient public Shipcall? Shipcall { get; set; } - public Ship? Ship { get; set; } + public Ship? Ship { get; set; } public string? Berth { get; set; } - internal Dictionary AssignedParticipants { get; } = new(); + internal Dictionary AssignedParticipants { get; } = new(); public List Times { get; set; } = new(); @@ -56,7 +56,7 @@ namespace BreCalClient { get { - Times? agencyTimes = this.GetTimesForParticipantType(Extensions.ParticipantType.AGENCY); + Times? agencyTimes = this.GetTimesForParticipantType(ParticipantType.AGENCY); if((agencyTimes != null) && (agencyTimes.EtaBerth != null)) return agencyTimes.EtaBerth; return Shipcall?.Eta; @@ -88,7 +88,7 @@ namespace BreCalClient } } return tlm; - } + } } public string Title @@ -112,12 +112,12 @@ namespace BreCalClient { foreach (ParticipantAssignment participantAssignment in Shipcall.Participants) { - AssignedParticipants[(Extensions.ParticipantType)participantAssignment.Type] = participantAssignment; + AssignedParticipants[(ParticipantType)participantAssignment.Type] = participantAssignment; } } } - internal Times? GetTimesForParticipantType(Extensions.ParticipantType type) + internal Times? GetTimesForParticipantType(ParticipantType type) { if (AssignedParticipants.ContainsKey(type)) { @@ -127,14 +127,14 @@ namespace BreCalClient if ((times.ParticipantId == participantId) && (times.ParticipantType == (int) type)) return times; } - if(type == Extensions.ParticipantType.AGENCY) + if(type == ParticipantType.AGENCY) { // if I am BSMD and no agency entry was found this means we are editing the agency entry - if(App.Participant.Type == (int) Extensions.ParticipantType.BSMD) + if(App.Participant.Type == (int) ParticipantType.BSMD) { foreach(Times times in this.Times) { - if ((times.ParticipantId == App.Participant.Id) && (times.ParticipantType == (int) Extensions.ParticipantType.AGENCY)) + if ((times.ParticipantId == App.Participant.Id) && (times.ParticipantType == (int) ParticipantType.AGENCY)) return times; } } @@ -160,15 +160,15 @@ namespace BreCalClient public string? GetBerthText(Times times) { string? berthText = null; - if ((BreCalLists.AllBerths != null) && times.BerthId.HasValue && (this.Shipcall?.Type != (int)Extensions.TypeEnum.Shifting)) + if ((BreCalLists.Berths != null) && times.BerthId.HasValue && (this.Shipcall?.Type != ShipcallType.Shifting)) { Berth? berth = BreCalLists.AllBerths.Find((x) => x.Id == times.BerthId); berthText = berth?.Name; } - if ((berthText == null) && (times.ParticipantType != (int)Extensions.ParticipantType.TERMINAL)) + if ((berthText == null) && (times.ParticipantType != ParticipantType.TERMINAL)) { - if (this.Shipcall?.Type == (int)Extensions.TypeEnum.Incoming) + if (this.Shipcall?.Type == ShipcallType.Arrival) { Berth? berth = BreCalLists.AllBerths?.Find((x) => x.Id == this.Shipcall?.ArrivalBerthId); berthText = berth?.Name; @@ -191,7 +191,7 @@ namespace BreCalClient /// API reference to PUT eidted times internal async void UpdateTimesAssignments(DefaultApi _api) { - foreach (Extensions.ParticipantType participantType in this.AssignedParticipants.Keys) + foreach (ParticipantType participantType in this.AssignedParticipants.Keys) { Times? times = this.GetTimesForParticipantType(participantType); if(times == null) continue; @@ -236,11 +236,11 @@ namespace BreCalClient internal Participant? GetParticipantForType(Extensions.ParticipantType participantType) { - if(AssignedParticipants.ContainsKey(participantType) && BreCalLists.ParticipantLookupDict.ContainsKey(AssignedParticipants[participantType].ParticipantId)) + if(AssignedParticipants.ContainsKey(participantType) && BreCalLists.ParticipantLookupDict.ContainsKey(AssignedParticipants[participantType].ParticipantId)) return BreCalLists.ParticipantLookupDict[AssignedParticipants[participantType].ParticipantId]; - + return null; - } + } private bool IsFlagSet(StatusFlags flag) { @@ -248,7 +248,7 @@ namespace BreCalClient return (this.Shipcall.Flags & (int) flag) != 0; } - #endregion + #endregion } } From 5459d9909876dd76c4cf833276efb5b0fe2ccccf Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Fri, 15 Dec 2023 15:57:12 +0100 Subject: [PATCH 02/34] Improved OpenAPI doc in Stoplight, but still issues with ParticipantType and nullable Types. The client code does not compile. --- misc/BreCalApi.cs | 2686 ++++++++++++++++++++++++++----------------- misc/BreCalApi.yaml | 1743 ++++++++++++++-------------- 2 files changed, 2501 insertions(+), 1928 deletions(-) diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 8d04cf3..d153dad 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// Generated REST API Client Code Generator v1.9.1.0 on 15.12.2023 13:07:51 +// Generated REST API Client Code Generator v1.9.1.0 on 15.12.2023 15:53:58 // Using the tool OpenAPI Generator v7.1.0 // //---------------------- @@ -57,88 +57,59 @@ namespace BreCalClient.misc.Api /// /// Represents a collection of functions to interact with the API endpoints /// - public interface IDefaultApiSync : IApiAccessor + public interface IShipcallApiSync : IApiAccessor { #region Synchronous Operations /// - /// Gets a list of all berths registered - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// List<Berth> - List BerthsGet(int operationIndex = 0); - /// - /// Gets a list of all berths registered + /// Create a new ship call /// /// - /// + /// A new shipcall is created without times at this point. This is ususally done by the BSMD or a participant with that particular role. /// /// Thrown when fails to make API call + /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. - /// ApiResponse of List<Berth> - ApiResponse> BerthsGetWithHttpInfo(int operationIndex = 0); + /// Id + Id ShipcallCreate(Shipcall shipcall, int operationIndex = 0); /// - /// Returns a JWT session token and user data if successful - /// - /// Thrown when fails to make API call - /// Login credentials - /// Index associated with the operation. - /// LoginResult - LoginResult LoginPost(Credentials credentials, int operationIndex = 0); - /// - /// Returns a JWT session token and user data if successful + /// Create a new ship call /// /// - /// + /// A new shipcall is created without times at this point. This is ususally done by the BSMD or a participant with that particular role. /// /// Thrown when fails to make API call - /// Login credentials + /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. - /// ApiResponse of LoginResult - ApiResponse LoginPostWithHttpInfo(Credentials credentials, int operationIndex = 0); + /// ApiResponse of Id + ApiResponse ShipcallCreateWithHttpInfo(Shipcall shipcall, int operationIndex = 0); /// - /// Gets a list of notifications pursuant to a specified participant and ship call - /// - /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list - /// Index associated with the operation. - /// Notification - Notification NotificationsGet(int participantId, int shipcallId, int operationIndex = 0); - /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Updates a ship call /// /// - /// + /// Updates a shipcall. Usually done if the participant assignments change. /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. - /// ApiResponse of Notification - ApiResponse NotificationsGetWithHttpInfo(int participantId, int shipcallId, int operationIndex = 0); + /// Id + Id ShipcallUpdate(Shipcall shipcall, int operationIndex = 0); /// - /// gets a particular participant entry corresponding to user id - /// - /// Thrown when fails to make API call - /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) - /// Index associated with the operation. - /// List<Participant> - List ParticipantsGet(int? userId = default(int?), int operationIndex = 0); - /// - /// gets a particular participant entry corresponding to user id + /// Updates a ship call /// /// - /// + /// Updates a shipcall. Usually done if the participant assignments change. /// /// Thrown when fails to make API call - /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) + /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. - /// ApiResponse of List<Participant> - ApiResponse> ParticipantsGetWithHttpInfo(int? userId = default(int?), int operationIndex = 0); + /// ApiResponse of Id + ApiResponse ShipcallUpdateWithHttpInfo(Shipcall shipcall, int operationIndex = 0); /// /// Gets a list of ship calls /// + /// + /// Get current ship calls + /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. @@ -148,272 +119,74 @@ namespace BreCalClient.misc.Api /// Gets a list of ship calls /// /// - /// + /// Get current ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// ApiResponse of List<Shipcall> ApiResponse> ShipcallsGetWithHttpInfo(int? pastDays = default(int?), int operationIndex = 0); - /// - /// Create a new ship call - /// - /// Thrown when fails to make API call - /// Creates a new ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// Id - Id ShipcallsPost(Shipcall shipcall, int operationIndex = 0); - /// - /// Create a new ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Creates a new ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// ApiResponse of Id - ApiResponse ShipcallsPostWithHttpInfo(Shipcall shipcall, int operationIndex = 0); - /// - /// Updates a ship call - /// - /// Thrown when fails to make API call - /// Creates a new ship call. The id parameter is **required**. - /// Index associated with the operation. - /// Id - Id ShipcallsPut(Shipcall shipcall, int operationIndex = 0); - /// - /// Updates a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Creates a new ship call. The id parameter is **required**. - /// Index associated with the operation. - /// ApiResponse of Id - ApiResponse ShipcallsPutWithHttpInfo(Shipcall shipcall, int operationIndex = 0); - /// - /// gets a list of registered shipcalls - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// List<Ship> - List ShipsGet(int operationIndex = 0); - /// - /// gets a list of registered shipcalls - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// ApiResponse of List<Ship> - ApiResponse> ShipsGetWithHttpInfo(int operationIndex = 0); - /// - /// Delete a times entry for a ship call. - /// - /// Thrown when fails to make API call - /// - /// Index associated with the operation. - /// - void TimesDelete(int id, int operationIndex = 0); - /// - /// Delete a times entry for a ship call. - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Index associated with the operation. - /// ApiResponse of Object(void) - ApiResponse TimesDeleteWithHttpInfo(int id, int operationIndex = 0); - /// - /// Get all recorded times for a a ship call - /// - /// Thrown when fails to make API call - /// **Id**. *Example: 42*. Id of referenced ship call. (optional) - /// Index associated with the operation. - /// List<Times> - List TimesGet(int? shipcallId = default(int?), int operationIndex = 0); - /// - /// Get all recorded times for a a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// **Id**. *Example: 42*. Id of referenced ship call. (optional) - /// Index associated with the operation. - /// ApiResponse of List<Times> - ApiResponse> TimesGetWithHttpInfo(int? shipcallId = default(int?), int operationIndex = 0); - /// - /// Create a new times entry for a ship call - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// Id - Id TimesPost(Times times, int operationIndex = 0); - /// - /// Create a new times entry for a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// ApiResponse of Id - ApiResponse TimesPostWithHttpInfo(Times times, int operationIndex = 0); - /// - /// Update a times entry for a ship call - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. The id parameter is **required**. - /// Index associated with the operation. - /// Id - Id TimesPut(Times times, int operationIndex = 0); - /// - /// Update a times entry for a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. The id parameter is **required**. - /// Index associated with the operation. - /// ApiResponse of Id - ApiResponse TimesPutWithHttpInfo(Times times, int operationIndex = 0); - /// - /// Update user details (first/last name, phone, password) - /// - /// Thrown when fails to make API call - /// User details - /// Index associated with the operation. - /// - void UserPut(UserDetails userDetails, int operationIndex = 0); - /// - /// Update user details (first/last name, phone, password) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// User details - /// Index associated with the operation. - /// ApiResponse of Object(void) - ApiResponse UserPutWithHttpInfo(UserDetails userDetails, int operationIndex = 0); #endregion Synchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// - public interface IDefaultApiAsync : IApiAccessor + public interface IShipcallApiAsync : IApiAccessor { #region Asynchronous Operations /// - /// Gets a list of all berths registered + /// Create a new ship call /// /// - /// + /// A new shipcall is created without times at this point. This is ususally done by the BSMD or a participant with that particular role. /// /// Thrown when fails to make API call + /// Creates a new ship call. **Do not** provide id parameter. /// 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)); + /// Task of Id + System.Threading.Tasks.Task ShipcallCreateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets a list of all berths registered + /// Create a new ship call /// /// - /// + /// A new shipcall is created without times at this point. This is ususally done by the BSMD or a participant with that particular role. /// /// Thrown when fails to make API call + /// Creates a new ship call. **Do not** provide id parameter. /// 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)); + /// Task of ApiResponse (Id) + System.Threading.Tasks.Task> ShipcallCreateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Returns a JWT session token and user data if successful + /// Updates a ship call /// /// - /// + /// Updates a shipcall. Usually done if the participant assignments change. /// /// Thrown when fails to make API call - /// Login credentials + /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of LoginResult - System.Threading.Tasks.Task LoginPostAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// Task of Id + System.Threading.Tasks.Task ShipcallUpdateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Returns a JWT session token and user data if successful + /// Updates a ship call /// /// - /// + /// Updates a shipcall. Usually done if the participant assignments change. /// /// Thrown when fails to make API call - /// Login credentials + /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of ApiResponse (LoginResult) - System.Threading.Tasks.Task> LoginPostWithHttpInfoAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Gets a list of notifications pursuant to a specified participant and ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Notification - System.Threading.Tasks.Task NotificationsGetAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Gets a list of notifications pursuant to a specified participant and ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Notification) - System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// gets a particular participant entry corresponding to user id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) - /// 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)); - /// - /// gets a particular participant entry corresponding to user id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) - /// 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)); + /// Task of ApiResponse (Id) + System.Threading.Tasks.Task> ShipcallUpdateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets a list of ship calls /// /// - /// + /// Get current ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -425,7 +198,7 @@ namespace BreCalClient.misc.Api /// Gets a list of ship calls /// /// - /// + /// Get current ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -433,222 +206,32 @@ namespace BreCalClient.misc.Api /// 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)); - /// - /// Create a new ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Creates a new ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Id - System.Threading.Tasks.Task ShipcallsPostAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Create a new ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Creates a new ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> ShipcallsPostWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Updates a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Creates a new ship call. The id parameter is **required**. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Id - System.Threading.Tasks.Task ShipcallsPutAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Updates a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Creates a new ship call. The id parameter is **required**. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> ShipcallsPutWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// gets a list of registered shipcalls - /// - /// - /// - /// - /// Thrown when fails to make API call - /// 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)); - /// - /// gets a list of registered shipcalls - /// - /// - /// - /// - /// Thrown when fails to make API call - /// 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)); - /// - /// Delete a times entry for a ship call. - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of void - System.Threading.Tasks.Task TimesDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Delete a times entry for a ship call. - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - System.Threading.Tasks.Task> TimesDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Get all recorded times for a a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// **Id**. *Example: 42*. Id of referenced ship call. (optional) - /// 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)); - /// - /// Get all recorded times for a a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// **Id**. *Example: 42*. Id of referenced ship call. (optional) - /// 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)); - /// - /// Create a new times entry for a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Id - System.Threading.Tasks.Task TimesPostAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Create a new times entry for a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> TimesPostWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Update a times entry for a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. The id parameter is **required**. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Id - System.Threading.Tasks.Task TimesPutAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Update a times entry for a ship call - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. The id parameter is **required**. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Id) - System.Threading.Tasks.Task> TimesPutWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Update user details (first/last name, phone, password) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// User details - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of void - System.Threading.Tasks.Task UserPutAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Update user details (first/last name, phone, password) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// User details - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - System.Threading.Tasks.Task> UserPutWithHttpInfoAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// - public interface IDefaultApi : IDefaultApiSync, IDefaultApiAsync + public interface IShipcallApi : IShipcallApiSync, IShipcallApiAsync { } /// /// Represents a collection of functions to interact with the API endpoints /// - public partial class DefaultApi : IDefaultApi + public partial class ShipcallApi : IShipcallApi { private BreCalClient.misc.Client.ExceptionFactory _exceptionFactory = (name, response) => null; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - public DefaultApi() : this((string)null) + public ShipcallApi() : this((string)null) { } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - public DefaultApi(string basePath) + public ShipcallApi(string basePath) { this.Configuration = BreCalClient.misc.Client.Configuration.MergeConfigurations( BreCalClient.misc.Client.GlobalConfiguration.Instance, @@ -659,12 +242,12 @@ namespace BreCalClient.misc.Api this.ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// using Configuration object /// /// An instance of Configuration /// - public DefaultApi(BreCalClient.misc.Client.Configuration configuration) + public ShipcallApi(BreCalClient.misc.Client.Configuration configuration) { if (configuration == null) throw new ArgumentNullException("configuration"); this.Configuration = BreCalClient.misc.Client.Configuration.MergeConfigurations( @@ -676,13 +259,13 @@ namespace BreCalClient.misc.Api ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// using a Configuration object and client instance. /// /// The client interface for synchronous API access. /// The client interface for asynchronous API access. /// The configuration object. - public DefaultApi(BreCalClient.misc.Client.ISynchronousClient client, BreCalClient.misc.Client.IAsynchronousClient asyncClient, BreCalClient.misc.Client.IReadableConfiguration configuration) + public ShipcallApi(BreCalClient.misc.Client.ISynchronousClient client, BreCalClient.misc.Client.IAsynchronousClient asyncClient, BreCalClient.misc.Client.IReadableConfiguration configuration) { if (client == null) throw new ArgumentNullException("client"); if (asyncClient == null) throw new ArgumentNullException("asyncClient"); @@ -729,142 +312,30 @@ namespace BreCalClient.misc.Api set { _exceptionFactory = value; } } /// - /// Gets a list of all berths registered + /// Create a new ship call A new shipcall is created without times at this point. This is ususally done by the BSMD or a participant with that particular role. /// /// Thrown when fails to make API call + /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. - /// List<Berth> - public List BerthsGet(int operationIndex = 0) + /// Id + public Id ShipcallCreate(Shipcall shipcall, int operationIndex = 0) { - BreCalClient.misc.Client.ApiResponse> localVarResponse = BerthsGetWithHttpInfo(); + BreCalClient.misc.Client.ApiResponse localVarResponse = ShipcallCreateWithHttpInfo(shipcall); return localVarResponse.Data; } /// - /// Gets a list of all berths registered + /// Create a new ship call A new shipcall is created without times at this point. This is ususally done by the BSMD or a participant with that particular role. /// /// Thrown when fails to make API call + /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. - /// ApiResponse of List<Berth> - public BreCalClient.misc.Client.ApiResponse> BerthsGetWithHttpInfo(int operationIndex = 0) + /// ApiResponse of Id + public BreCalClient.misc.Client.ApiResponse ShipcallCreateWithHttpInfo(Shipcall shipcall, int operationIndex = 0) { - BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); - string[] _contentTypes = new string[] { - }; - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) + // verify the required parameter 'shipcall' is set + if (shipcall == null) { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - localVarRequestOptions.Operation = "DefaultApi.BerthsGet"; - localVarRequestOptions.OperationIndex = operationIndex; - // authentication (ApiKey) required - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); - } - // make the HTTP request - var localVarResponse = this.Client.Get>("/berths", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("BerthsGet", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - return localVarResponse; - } - /// - /// Gets a list of all berths registered - /// - /// Thrown when fails to make API call - /// 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)) - { - BreCalClient.misc.Client.ApiResponse> localVarResponse = await BerthsGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - /// - /// Gets a list of all berths registered - /// - /// Thrown when fails to make API call - /// 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)) - { - BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); - string[] _contentTypes = new string[] { - }; - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - localVarRequestOptions.Operation = "DefaultApi.BerthsGet"; - localVarRequestOptions.OperationIndex = operationIndex; - // authentication (ApiKey) required - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); - } - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/berths", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("BerthsGet", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - return localVarResponse; - } - /// - /// Returns a JWT session token and user data if successful - /// - /// Thrown when fails to make API call - /// Login credentials - /// Index associated with the operation. - /// LoginResult - public LoginResult LoginPost(Credentials credentials, int operationIndex = 0) - { - BreCalClient.misc.Client.ApiResponse localVarResponse = LoginPostWithHttpInfo(credentials); - return localVarResponse.Data; - } - /// - /// Returns a JWT session token and user data if successful - /// - /// Thrown when fails to make API call - /// Login credentials - /// Index associated with the operation. - /// ApiResponse of LoginResult - public BreCalClient.misc.Client.ApiResponse LoginPostWithHttpInfo(Credentials credentials, int operationIndex = 0) - { - // verify the required parameter 'credentials' is set - if (credentials == null) - { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'credentials' when calling DefaultApi->LoginPost"); + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'shipcall' when calling ShipcallApi->ShipcallCreate"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -884,8 +355,8 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Data = credentials; - localVarRequestOptions.Operation = "DefaultApi.LoginPost"; + localVarRequestOptions.Data = shipcall; + localVarRequestOptions.Operation = "ShipcallApi.ShipcallCreate"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -893,10 +364,10 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = this.Client.Post("/login", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Post("/shipcalls", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("LoginPost", localVarResponse); + Exception _exception = this.ExceptionFactory("ShipcallCreate", localVarResponse); if (_exception != null) { throw _exception; @@ -905,32 +376,32 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Returns a JWT session token and user data if successful + /// Create a new ship call A new shipcall is created without times at this point. This is ususally done by the BSMD or a participant with that particular role. /// /// Thrown when fails to make API call - /// Login credentials + /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of LoginResult - public async System.Threading.Tasks.Task LoginPostAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of Id + public async System.Threading.Tasks.Task ShipcallCreateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - BreCalClient.misc.Client.ApiResponse localVarResponse = await LoginPostWithHttpInfoAsync(credentials, operationIndex, cancellationToken).ConfigureAwait(false); + BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipcallCreateWithHttpInfoAsync(shipcall, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// - /// Returns a JWT session token and user data if successful + /// Create a new ship call A new shipcall is created without times at this point. This is ususally done by the BSMD or a participant with that particular role. /// /// Thrown when fails to make API call - /// Login credentials + /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of ApiResponse (LoginResult) - public async System.Threading.Tasks.Task> LoginPostWithHttpInfoAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of ApiResponse (Id) + public async System.Threading.Tasks.Task> ShipcallCreateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // verify the required parameter 'credentials' is set - if (credentials == null) + // verify the required parameter 'shipcall' is set + if (shipcall == null) { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'credentials' when calling DefaultApi->LoginPost"); + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'shipcall' when calling ShipcallApi->ShipcallCreate"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -950,8 +421,8 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Data = credentials; - localVarRequestOptions.Operation = "DefaultApi.LoginPost"; + localVarRequestOptions.Data = shipcall; + localVarRequestOptions.Operation = "ShipcallApi.ShipcallCreate"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -959,10 +430,10 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/login", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.PostAsync("/shipcalls", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("LoginPost", localVarResponse); + Exception _exception = this.ExceptionFactory("ShipcallCreate", localVarResponse); if (_exception != null) { throw _exception; @@ -971,30 +442,34 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Updates a ship call Updates a shipcall. Usually done if the participant assignments change. /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. - /// Notification - public Notification NotificationsGet(int participantId, int shipcallId, int operationIndex = 0) + /// Id + public Id ShipcallUpdate(Shipcall shipcall, int operationIndex = 0) { - BreCalClient.misc.Client.ApiResponse localVarResponse = NotificationsGetWithHttpInfo(participantId, shipcallId); + BreCalClient.misc.Client.ApiResponse localVarResponse = ShipcallUpdateWithHttpInfo(shipcall); return localVarResponse.Data; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Updates a ship call Updates a shipcall. Usually done if the participant assignments change. /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. - /// ApiResponse of Notification - public BreCalClient.misc.Client.ApiResponse NotificationsGetWithHttpInfo(int participantId, int shipcallId, int operationIndex = 0) + /// ApiResponse of Id + public BreCalClient.misc.Client.ApiResponse ShipcallUpdateWithHttpInfo(Shipcall shipcall, int operationIndex = 0) { + // verify the required parameter 'shipcall' is set + if (shipcall == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'shipcall' when calling ShipcallApi->ShipcallUpdate"); + } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { + "application/json" }; // to determine the Accept header string[] _accepts = new string[] { @@ -1010,9 +485,8 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "participant_id", participantId)); - localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); - localVarRequestOptions.Operation = "DefaultApi.NotificationsGet"; + localVarRequestOptions.Data = shipcall; + localVarRequestOptions.Operation = "ShipcallApi.ShipcallUpdate"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1020,10 +494,10 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = this.Client.Get("/notifications", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Put("/shipcalls", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("NotificationsGet", localVarResponse); + Exception _exception = this.ExceptionFactory("ShipcallUpdate", localVarResponse); if (_exception != null) { throw _exception; @@ -1032,32 +506,36 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Updates a ship call Updates a shipcall. Usually done if the participant assignments change. /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of Notification - public async System.Threading.Tasks.Task NotificationsGetAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of Id + public async System.Threading.Tasks.Task ShipcallUpdateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - BreCalClient.misc.Client.ApiResponse localVarResponse = await NotificationsGetWithHttpInfoAsync(participantId, shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); + BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipcallUpdateWithHttpInfoAsync(shipcall, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Updates a ship call Updates a shipcall. Usually done if the participant assignments change. /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Notification) - public async System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of ApiResponse (Id) + public async System.Threading.Tasks.Task> ShipcallUpdateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + // verify the required parameter 'shipcall' is set + if (shipcall == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'shipcall' when calling ShipcallApi->ShipcallUpdate"); + } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { + "application/json" }; // to determine the Accept header string[] _accepts = new string[] { @@ -1073,9 +551,8 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "participant_id", participantId)); - localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); - localVarRequestOptions.Operation = "DefaultApi.NotificationsGet"; + localVarRequestOptions.Data = shipcall; + localVarRequestOptions.Operation = "ShipcallApi.ShipcallUpdate"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1083,10 +560,10 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/notifications", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.PutAsync("/shipcalls", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("NotificationsGet", localVarResponse); + Exception _exception = this.ExceptionFactory("ShipcallUpdate", localVarResponse); if (_exception != null) { throw _exception; @@ -1095,131 +572,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a particular participant entry corresponding to user id - /// - /// Thrown when fails to make API call - /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) - /// Index associated with the operation. - /// List<Participant> - public List ParticipantsGet(int? userId = default(int?), int operationIndex = 0) - { - BreCalClient.misc.Client.ApiResponse> localVarResponse = ParticipantsGetWithHttpInfo(userId); - return localVarResponse.Data; - } - /// - /// gets a particular participant entry corresponding to user id - /// - /// Thrown when fails to make API call - /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) - /// Index associated with the operation. - /// ApiResponse of List<Participant> - public BreCalClient.misc.Client.ApiResponse> ParticipantsGetWithHttpInfo(int? userId = default(int?), int operationIndex = 0) - { - BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); - string[] _contentTypes = new string[] { - }; - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - if (userId != null) - { - localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "user_id", userId)); - } - localVarRequestOptions.Operation = "DefaultApi.ParticipantsGet"; - localVarRequestOptions.OperationIndex = operationIndex; - // authentication (ApiKey) required - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); - } - // make the HTTP request - var localVarResponse = this.Client.Get>("/participants", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("ParticipantsGet", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - return localVarResponse; - } - /// - /// gets a particular participant entry corresponding to user id - /// - /// Thrown when fails to make API call - /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) - /// 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)) - { - BreCalClient.misc.Client.ApiResponse> localVarResponse = await ParticipantsGetWithHttpInfoAsync(userId, operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - /// - /// gets a particular participant entry corresponding to user id - /// - /// Thrown when fails to make API call - /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) - /// 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)) - { - BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); - string[] _contentTypes = new string[] { - }; - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - if (userId != null) - { - localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "user_id", userId)); - } - localVarRequestOptions.Operation = "DefaultApi.ParticipantsGet"; - localVarRequestOptions.OperationIndex = operationIndex; - // authentication (ApiKey) required - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); - } - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/participants", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("ParticipantsGet", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - return localVarResponse; - } - /// - /// Gets a list of ship calls + /// Gets a list of ship calls Get current ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -1231,7 +584,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls Get current ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -1260,7 +613,7 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "past_days", pastDays)); } - localVarRequestOptions.Operation = "DefaultApi.ShipcallsGet"; + localVarRequestOptions.Operation = "ShipcallApi.ShipcallsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1280,7 +633,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls Get current ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -1293,7 +646,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls Get current ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) @@ -1323,7 +676,7 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "past_days", pastDays)); } - localVarRequestOptions.Operation = "DefaultApi.ShipcallsGet"; + localVarRequestOptions.Operation = "ShipcallApi.ShipcallsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1342,35 +695,340 @@ namespace BreCalClient.misc.Api } return localVarResponse; } + } +} + +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStaticApiSync : IApiAccessor + { + #region Synchronous Operations /// - /// Create a new ship call + /// Gets a list of all berths registered + /// + /// + /// Returns a list of berths, including berths that are (logically) deleted + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Berth> + List BerthsGet(int operationIndex = 0); + /// + /// Gets a list of all berths registered + /// + /// + /// Returns a list of berths, including berths that are (logically) deleted + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Berth> + ApiResponse> BerthsGetWithHttpInfo(int operationIndex = 0); + /// + /// Gets a list of notifications pursuant to a specified participant and ship call + /// + /// + /// List of notifications (tbd) + /// + /// Thrown when fails to make API call + /// **Id of participant**. *Example: 2*. Id returned through loading of participant + /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Index associated with the operation. + /// Notification + Notification NotificationsGet(int participantId, int shipcallId, int operationIndex = 0); + /// + /// Gets a list of notifications pursuant to a specified participant and ship call + /// + /// + /// List of notifications (tbd) + /// + /// Thrown when fails to make API call + /// **Id of participant**. *Example: 2*. Id returned through loading of participant + /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Index associated with the operation. + /// ApiResponse of Notification + ApiResponse NotificationsGetWithHttpInfo(int participantId, int shipcallId, int operationIndex = 0); + /// + /// gets one or all participants + /// + /// + /// If no parameter is given, all participants are returned. The list can be used to display participant information in the context of ship calls. + /// + /// Thrown when fails to make API call + /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) + /// Index associated with the operation. + /// List<Participant> + List ParticipantsGet(int? userId = default(int?), int operationIndex = 0); + /// + /// gets one or all participants + /// + /// + /// If no parameter is given, all participants are returned. The list can be used to display participant information in the context of ship calls. + /// + /// Thrown when fails to make API call + /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) + /// Index associated with the operation. + /// ApiResponse of List<Participant> + ApiResponse> ParticipantsGetWithHttpInfo(int? userId = default(int?), int operationIndex = 0); + /// + /// gets a list of ships + /// + /// + /// Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Ship> + List ShipsGet(int operationIndex = 0); + /// + /// gets a list of ships + /// + /// + /// Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Ship> + ApiResponse> ShipsGetWithHttpInfo(int operationIndex = 0); + #endregion Synchronous Operations + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStaticApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Gets a list of all berths registered + /// + /// + /// Returns a list of berths, including berths that are (logically) deleted + /// + /// Thrown when fails to make API call + /// 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)); + /// + /// Gets a list of all berths registered + /// + /// + /// Returns a list of berths, including berths that are (logically) deleted + /// + /// Thrown when fails to make API call + /// 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)); + /// + /// Gets a list of notifications pursuant to a specified participant and ship call + /// + /// + /// List of notifications (tbd) + /// + /// Thrown when fails to make API call + /// **Id of participant**. *Example: 2*. Id returned through loading of participant + /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Notification + System.Threading.Tasks.Task NotificationsGetAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Gets a list of notifications pursuant to a specified participant and ship call + /// + /// + /// List of notifications (tbd) + /// + /// Thrown when fails to make API call + /// **Id of participant**. *Example: 2*. Id returned through loading of participant + /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Notification) + System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// gets one or all participants + /// + /// + /// If no parameter is given, all participants are returned. The list can be used to display participant information in the context of ship calls. + /// + /// Thrown when fails to make API call + /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) + /// 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)); + /// + /// gets one or all participants + /// + /// + /// If no parameter is given, all participants are returned. The list can be used to display participant information in the context of ship calls. + /// + /// Thrown when fails to make API call + /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) + /// 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)); + /// + /// gets a list of ships + /// + /// + /// Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// 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)); + /// + /// gets a list of ships + /// + /// + /// Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// 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)); + #endregion Asynchronous Operations + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStaticApi : IStaticApiSync, IStaticApiAsync + { + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StaticApi : IStaticApi + { + private BreCalClient.misc.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + /// + /// Initializes a new instance of the class. + /// + /// + public StaticApi() : this((string)null) + { + } + /// + /// Initializes a new instance of the class. + /// + /// + public StaticApi(string basePath) + { + this.Configuration = BreCalClient.misc.Client.Configuration.MergeConfigurations( + BreCalClient.misc.Client.GlobalConfiguration.Instance, + new BreCalClient.misc.Client.Configuration { BasePath = basePath } + ); + this.Client = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public StaticApi(BreCalClient.misc.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + this.Configuration = BreCalClient.misc.Client.Configuration.MergeConfigurations( + BreCalClient.misc.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public StaticApi(BreCalClient.misc.Client.ISynchronousClient client, BreCalClient.misc.Client.IAsynchronousClient asyncClient, BreCalClient.misc.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// The client for accessing this underlying API asynchronously. + /// + public BreCalClient.misc.Client.IAsynchronousClient AsynchronousClient { get; set; } + /// + /// The client for accessing this underlying API synchronously. + /// + public BreCalClient.misc.Client.ISynchronousClient Client { get; set; } + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public BreCalClient.misc.Client.IReadableConfiguration Configuration { get; set; } + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public BreCalClient.misc.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + /// + /// Gets a list of all berths registered Returns a list of berths, including berths that are (logically) deleted /// /// Thrown when fails to make API call - /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. - /// Id - public Id ShipcallsPost(Shipcall shipcall, int operationIndex = 0) + /// List<Berth> + public List BerthsGet(int operationIndex = 0) { - BreCalClient.misc.Client.ApiResponse localVarResponse = ShipcallsPostWithHttpInfo(shipcall); + BreCalClient.misc.Client.ApiResponse> localVarResponse = BerthsGetWithHttpInfo(); return localVarResponse.Data; } /// - /// Create a new ship call + /// Gets a list of all berths registered Returns a list of berths, including berths that are (logically) deleted /// /// Thrown when fails to make API call - /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. - /// ApiResponse of Id - public BreCalClient.misc.Client.ApiResponse ShipcallsPostWithHttpInfo(Shipcall shipcall, int operationIndex = 0) + /// ApiResponse of List<Berth> + public BreCalClient.misc.Client.ApiResponse> BerthsGetWithHttpInfo(int operationIndex = 0) { - // verify the required parameter 'shipcall' is set - if (shipcall == null) - { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'shipcall' when calling DefaultApi->ShipcallsPost"); - } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { - "application/json" }; // to determine the Accept header string[] _accepts = new string[] { @@ -1386,8 +1044,7 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Data = shipcall; - localVarRequestOptions.Operation = "DefaultApi.ShipcallsPost"; + localVarRequestOptions.Operation = "StaticApi.BerthsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1395,10 +1052,10 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = this.Client.Post("/shipcalls", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Get>("/berths", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("ShipcallsPost", localVarResponse); + Exception _exception = this.ExceptionFactory("BerthsGet", localVarResponse); if (_exception != null) { throw _exception; @@ -1407,36 +1064,28 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Create a new ship call + /// Gets a list of all berths registered Returns a list of berths, including berths that are (logically) deleted /// /// Thrown when fails to make API call - /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of Id - public async System.Threading.Tasks.Task ShipcallsPostAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of List<Berth> + public async System.Threading.Tasks.Task> BerthsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipcallsPostWithHttpInfoAsync(shipcall, operationIndex, cancellationToken).ConfigureAwait(false); + BreCalClient.misc.Client.ApiResponse> localVarResponse = await BerthsGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// - /// Create a new ship call + /// Gets a list of all berths registered Returns a list of berths, including berths that are (logically) deleted /// /// Thrown when fails to make API call - /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> ShipcallsPostWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of ApiResponse (List<Berth>) + public async System.Threading.Tasks.Task>> BerthsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // verify the required parameter 'shipcall' is set - if (shipcall == null) - { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'shipcall' when calling DefaultApi->ShipcallsPost"); - } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { - "application/json" }; // to determine the Accept header string[] _accepts = new string[] { @@ -1452,8 +1101,7 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Data = shipcall; - localVarRequestOptions.Operation = "DefaultApi.ShipcallsPost"; + localVarRequestOptions.Operation = "StaticApi.BerthsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1461,10 +1109,10 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/shipcalls", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/berths", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("ShipcallsPost", localVarResponse); + Exception _exception = this.ExceptionFactory("BerthsGet", localVarResponse); if (_exception != null) { throw _exception; @@ -1473,34 +1121,30 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Updates a ship call + /// Gets a list of notifications pursuant to a specified participant and ship call List of notifications (tbd) /// /// Thrown when fails to make API call - /// Creates a new ship call. The id parameter is **required**. + /// **Id of participant**. *Example: 2*. Id returned through loading of participant + /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. - /// Id - public Id ShipcallsPut(Shipcall shipcall, int operationIndex = 0) + /// Notification + public Notification NotificationsGet(int participantId, int shipcallId, int operationIndex = 0) { - BreCalClient.misc.Client.ApiResponse localVarResponse = ShipcallsPutWithHttpInfo(shipcall); + BreCalClient.misc.Client.ApiResponse localVarResponse = NotificationsGetWithHttpInfo(participantId, shipcallId); return localVarResponse.Data; } /// - /// Updates a ship call + /// Gets a list of notifications pursuant to a specified participant and ship call List of notifications (tbd) /// /// Thrown when fails to make API call - /// Creates a new ship call. The id parameter is **required**. + /// **Id of participant**. *Example: 2*. Id returned through loading of participant + /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. - /// ApiResponse of Id - public BreCalClient.misc.Client.ApiResponse ShipcallsPutWithHttpInfo(Shipcall shipcall, int operationIndex = 0) + /// ApiResponse of Notification + public BreCalClient.misc.Client.ApiResponse NotificationsGetWithHttpInfo(int participantId, int shipcallId, int operationIndex = 0) { - // verify the required parameter 'shipcall' is set - if (shipcall == null) - { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'shipcall' when calling DefaultApi->ShipcallsPut"); - } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { - "application/json" }; // to determine the Accept header string[] _accepts = new string[] { @@ -1516,8 +1160,9 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Data = shipcall; - localVarRequestOptions.Operation = "DefaultApi.ShipcallsPut"; + localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "participant_id", participantId)); + localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); + localVarRequestOptions.Operation = "StaticApi.NotificationsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1525,10 +1170,10 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = this.Client.Put("/shipcalls", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Get("/notifications", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("ShipcallsPut", localVarResponse); + Exception _exception = this.ExceptionFactory("NotificationsGet", localVarResponse); if (_exception != null) { throw _exception; @@ -1537,36 +1182,32 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Updates a ship call + /// Gets a list of notifications pursuant to a specified participant and ship call List of notifications (tbd) /// /// Thrown when fails to make API call - /// Creates a new ship call. The id parameter is **required**. + /// **Id of participant**. *Example: 2*. Id returned through loading of participant + /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of Id - public async System.Threading.Tasks.Task ShipcallsPutAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of Notification + public async System.Threading.Tasks.Task NotificationsGetAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipcallsPutWithHttpInfoAsync(shipcall, operationIndex, cancellationToken).ConfigureAwait(false); + BreCalClient.misc.Client.ApiResponse localVarResponse = await NotificationsGetWithHttpInfoAsync(participantId, shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// - /// Updates a ship call + /// Gets a list of notifications pursuant to a specified participant and ship call List of notifications (tbd) /// /// Thrown when fails to make API call - /// Creates a new ship call. The id parameter is **required**. + /// **Id of participant**. *Example: 2*. Id returned through loading of participant + /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> ShipcallsPutWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of ApiResponse (Notification) + public async System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // verify the required parameter 'shipcall' is set - if (shipcall == null) - { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'shipcall' when calling DefaultApi->ShipcallsPut"); - } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { - "application/json" }; // to determine the Accept header string[] _accepts = new string[] { @@ -1582,8 +1223,9 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Data = shipcall; - localVarRequestOptions.Operation = "DefaultApi.ShipcallsPut"; + localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "participant_id", participantId)); + localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); + localVarRequestOptions.Operation = "StaticApi.NotificationsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1591,10 +1233,10 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/shipcalls", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.GetAsync("/notifications", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("ShipcallsPut", localVarResponse); + Exception _exception = this.ExceptionFactory("NotificationsGet", localVarResponse); if (_exception != null) { throw _exception; @@ -1603,7 +1245,131 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a list of registered shipcalls + /// gets one or all participants If no parameter is given, all participants are returned. The list can be used to display participant information in the context of ship calls. + /// + /// Thrown when fails to make API call + /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) + /// Index associated with the operation. + /// List<Participant> + public List ParticipantsGet(int? userId = default(int?), int operationIndex = 0) + { + BreCalClient.misc.Client.ApiResponse> localVarResponse = ParticipantsGetWithHttpInfo(userId); + return localVarResponse.Data; + } + /// + /// gets one or all participants If no parameter is given, all participants are returned. The list can be used to display participant information in the context of ship calls. + /// + /// Thrown when fails to make API call + /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) + /// Index associated with the operation. + /// ApiResponse of List<Participant> + public BreCalClient.misc.Client.ApiResponse> ParticipantsGetWithHttpInfo(int? userId = default(int?), int operationIndex = 0) + { + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + if (userId != null) + { + localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "user_id", userId)); + } + localVarRequestOptions.Operation = "StaticApi.ParticipantsGet"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = this.Client.Get>("/participants", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ParticipantsGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// gets one or all participants If no parameter is given, all participants are returned. The list can be used to display participant information in the context of ship calls. + /// + /// Thrown when fails to make API call + /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) + /// 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)) + { + BreCalClient.misc.Client.ApiResponse> localVarResponse = await ParticipantsGetWithHttpInfoAsync(userId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + /// + /// gets one or all participants If no parameter is given, all participants are returned. The list can be used to display participant information in the context of ship calls. + /// + /// Thrown when fails to make API call + /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) + /// 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)) + { + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + if (userId != null) + { + localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "user_id", userId)); + } + localVarRequestOptions.Operation = "StaticApi.ParticipantsGet"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/participants", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ParticipantsGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1614,7 +1380,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// gets a list of registered shipcalls + /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1638,7 +1404,7 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Operation = "DefaultApi.ShipsGet"; + localVarRequestOptions.Operation = "StaticApi.ShipsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1658,7 +1424,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a list of registered shipcalls + /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1670,7 +1436,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// gets a list of registered shipcalls + /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1695,7 +1461,7 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Operation = "DefaultApi.ShipsGet"; + localVarRequestOptions.Operation = "StaticApi.ShipsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1714,25 +1480,473 @@ namespace BreCalClient.misc.Api } return localVarResponse; } + } +} + +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITimesApiSync : IApiAccessor + { + #region Synchronous Operations /// - /// Delete a times entry for a ship call. + /// Create a new times entry for a ship call /// + /// + /// The times entry for a shipcall is created with reference to a participant. For each participant type there should be only one times data record. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. **Do not** provide id parameter. + /// Index associated with the operation. + /// Id + Id TimesCreate(Times times, int operationIndex = 0); + /// + /// Create a new times entry for a ship call + /// + /// + /// The times entry for a shipcall is created with reference to a participant. For each participant type there should be only one times data record. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. **Do not** provide id parameter. + /// Index associated with the operation. + /// ApiResponse of Id + ApiResponse TimesCreateWithHttpInfo(Times times, int operationIndex = 0); + /// + /// Delete a times entry for a ship call. + /// + /// + /// A times entry is typically deleted if the agent for example changes or removes the participant assignment for a particular role. + /// /// Thrown when fails to make API call /// /// Index associated with the operation. + /// Id + Id TimesDelete(int id, int operationIndex = 0); + /// + /// Delete a times entry for a ship call. + /// + /// + /// A times entry is typically deleted if the agent for example changes or removes the participant assignment for a particular role. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Id + ApiResponse TimesDeleteWithHttpInfo(int id, int operationIndex = 0); + /// + /// Gets list of times + /// + /// + /// Get all times assigned to a shipcall. These might not be complete. + /// + /// Thrown when fails to make API call + /// **Id**. *Example: 42*. Id of referenced ship call. (optional) + /// Index associated with the operation. + /// List<Times> + List TimesGet(int? shipcallId = default(int?), int operationIndex = 0); + /// + /// Gets list of times + /// + /// + /// Get all times assigned to a shipcall. These might not be complete. + /// + /// Thrown when fails to make API call + /// **Id**. *Example: 42*. Id of referenced ship call. (optional) + /// Index associated with the operation. + /// ApiResponse of List<Times> + ApiResponse> TimesGetWithHttpInfo(int? shipcallId = default(int?), int operationIndex = 0); + /// + /// Update a times entry for a ship call + /// + /// + /// Updating a times entry for a ship for a particular participant. The times entries are required for a shipcall to pass the validation rules. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. The id parameter is **required**. + /// Index associated with the operation. + /// Id + Id TimesUpdate(Times times, int operationIndex = 0); + /// + /// Update a times entry for a ship call + /// + /// + /// Updating a times entry for a ship for a particular participant. The times entries are required for a shipcall to pass the validation rules. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. The id parameter is **required**. + /// Index associated with the operation. + /// ApiResponse of Id + ApiResponse TimesUpdateWithHttpInfo(Times times, int operationIndex = 0); + #endregion Synchronous Operations + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITimesApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Create a new times entry for a ship call + /// + /// + /// The times entry for a shipcall is created with reference to a participant. For each participant type there should be only one times data record. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. **Do not** provide id parameter. + /// 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)); + /// + /// Create a new times entry for a ship call + /// + /// + /// The times entry for a shipcall is created with reference to a participant. For each participant type there should be only one times data record. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. **Do not** provide id parameter. + /// 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)); + /// + /// Delete a times entry for a ship call. + /// + /// + /// A times entry is typically deleted if the agent for example changes or removes the participant assignment for a particular role. + /// + /// Thrown when fails to make API call + /// + /// 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)); + /// + /// Delete a times entry for a ship call. + /// + /// + /// A times entry is typically deleted if the agent for example changes or removes the participant assignment for a particular role. + /// + /// Thrown when fails to make API call + /// + /// 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)); + /// + /// Gets list of times + /// + /// + /// Get all times assigned to a shipcall. These might not be complete. + /// + /// Thrown when fails to make API call + /// **Id**. *Example: 42*. Id of referenced ship call. (optional) + /// 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)); + /// + /// Gets list of times + /// + /// + /// Get all times assigned to a shipcall. These might not be complete. + /// + /// Thrown when fails to make API call + /// **Id**. *Example: 42*. Id of referenced ship call. (optional) + /// 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)); + /// + /// Update a times entry for a ship call + /// + /// + /// Updating a times entry for a ship for a particular participant. The times entries are required for a shipcall to pass the validation rules. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. The id parameter is **required**. + /// 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)); + /// + /// Update a times entry for a ship call + /// + /// + /// Updating a times entry for a ship for a particular participant. The times entries are required for a shipcall to pass the validation rules. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. The id parameter is **required**. + /// 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)); + #endregion Asynchronous Operations + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITimesApi : ITimesApiSync, ITimesApiAsync + { + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class TimesApi : ITimesApi + { + private BreCalClient.misc.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + /// + /// Initializes a new instance of the class. + /// /// - public void TimesDelete(int id, int operationIndex = 0) + public TimesApi() : this((string)null) { - TimesDeleteWithHttpInfo(id); } /// - /// Delete a times entry for a ship call. + /// Initializes a new instance of the class. + /// + /// + public TimesApi(string basePath) + { + this.Configuration = BreCalClient.misc.Client.Configuration.MergeConfigurations( + BreCalClient.misc.Client.GlobalConfiguration.Instance, + new BreCalClient.misc.Client.Configuration { BasePath = basePath } + ); + this.Client = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public TimesApi(BreCalClient.misc.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + this.Configuration = BreCalClient.misc.Client.Configuration.MergeConfigurations( + BreCalClient.misc.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public TimesApi(BreCalClient.misc.Client.ISynchronousClient client, BreCalClient.misc.Client.IAsynchronousClient asyncClient, BreCalClient.misc.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// The client for accessing this underlying API asynchronously. + /// + public BreCalClient.misc.Client.IAsynchronousClient AsynchronousClient { get; set; } + /// + /// The client for accessing this underlying API synchronously. + /// + public BreCalClient.misc.Client.ISynchronousClient Client { get; set; } + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public BreCalClient.misc.Client.IReadableConfiguration Configuration { get; set; } + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public BreCalClient.misc.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + /// + /// Create a new times entry for a ship call The times entry for a shipcall is created with reference to a participant. For each participant type there should be only one times data record. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. **Do not** provide id parameter. + /// Index associated with the operation. + /// Id + public Id TimesCreate(Times times, int operationIndex = 0) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = TimesCreateWithHttpInfo(times); + return localVarResponse.Data; + } + /// + /// Create a new times entry for a ship call The times entry for a shipcall is created with reference to a participant. For each participant type there should be only one times data record. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. **Do not** provide id parameter. + /// Index associated with the operation. + /// ApiResponse of Id + public BreCalClient.misc.Client.ApiResponse TimesCreateWithHttpInfo(Times times, int operationIndex = 0) + { + // verify the required parameter 'times' is set + if (times == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling TimesApi->TimesCreate"); + } + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + "application/json" + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Data = times; + localVarRequestOptions.Operation = "TimesApi.TimesCreate"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = this.Client.Post("/times", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TimesCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// Create a new times entry for a ship call The times entry for a shipcall is created with reference to a participant. For each participant type there should be only one times data record. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. **Do not** provide id parameter. + /// 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)) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesCreateWithHttpInfoAsync(times, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + /// + /// Create a new times entry for a ship call The times entry for a shipcall is created with reference to a participant. For each participant type there should be only one times data record. + /// + /// Thrown when fails to make API call + /// Times entry that will be added to the ship call. **Do not** provide id parameter. + /// 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)) + { + // verify the required parameter 'times' is set + if (times == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling TimesApi->TimesCreate"); + } + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + "application/json" + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Data = times; + localVarRequestOptions.Operation = "TimesApi.TimesCreate"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/times", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TimesCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// Delete a times entry for a ship call. A times entry is typically deleted if the agent for example changes or removes the participant assignment for a particular role. /// /// Thrown when fails to make API call /// /// Index associated with the operation. - /// ApiResponse of Object(void) - public BreCalClient.misc.Client.ApiResponse TimesDeleteWithHttpInfo(int id, int operationIndex = 0) + /// Id + public Id TimesDelete(int id, int operationIndex = 0) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = TimesDeleteWithHttpInfo(id); + return localVarResponse.Data; + } + /// + /// Delete a times entry for a ship call. A times entry is typically deleted if the agent for example changes or removes the participant assignment for a particular role. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Id + public BreCalClient.misc.Client.ApiResponse TimesDeleteWithHttpInfo(int id, int operationIndex = 0) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -1752,7 +1966,7 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "id", id)); - localVarRequestOptions.Operation = "DefaultApi.TimesDelete"; + localVarRequestOptions.Operation = "TimesApi.TimesDelete"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1760,7 +1974,7 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = this.Client.Delete("/times", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Delete("/times", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TimesDelete", localVarResponse); @@ -1772,26 +1986,27 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Delete a times entry for a ship call. + /// Delete a times entry for a ship call. A times entry is typically deleted if the agent for example changes or removes the participant assignment for a particular role. /// /// Thrown when fails to make API call /// /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of void - public async System.Threading.Tasks.Task TimesDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of Id + public async System.Threading.Tasks.Task TimesDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TimesDeleteWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesDeleteWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; } /// - /// Delete a times entry for a ship call. + /// Delete a times entry for a ship call. A times entry is typically deleted if the agent for example changes or removes the participant assignment for a particular role. /// /// Thrown when fails to make API call /// /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> TimesDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of ApiResponse (Id) + public async System.Threading.Tasks.Task> TimesDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -1811,7 +2026,7 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "id", id)); - localVarRequestOptions.Operation = "DefaultApi.TimesDelete"; + localVarRequestOptions.Operation = "TimesApi.TimesDelete"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1819,7 +2034,7 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/times", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/times", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TimesDelete", localVarResponse); @@ -1831,7 +2046,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Get all recorded times for a a ship call + /// Gets list of times Get all times assigned to a shipcall. These might not be complete. /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1843,7 +2058,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Get all recorded times for a a ship call + /// Gets list of times Get all times assigned to a shipcall. These might not be complete. /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1872,7 +2087,7 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); } - localVarRequestOptions.Operation = "DefaultApi.TimesGet"; + localVarRequestOptions.Operation = "TimesApi.TimesGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1892,7 +2107,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Get all recorded times for a a ship call + /// Gets list of times Get all times assigned to a shipcall. These might not be complete. /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1905,7 +2120,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Get all recorded times for a a ship call + /// Gets list of times Get all times assigned to a shipcall. These might not be complete. /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1935,7 +2150,7 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); } - localVarRequestOptions.Operation = "DefaultApi.TimesGet"; + localVarRequestOptions.Operation = "TimesApi.TimesGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -1955,160 +2170,30 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Create a new times entry for a ship call - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// Id - public Id TimesPost(Times times, int operationIndex = 0) - { - BreCalClient.misc.Client.ApiResponse localVarResponse = TimesPostWithHttpInfo(times); - return localVarResponse.Data; - } - /// - /// Create a new times entry for a ship call - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// ApiResponse of Id - public BreCalClient.misc.Client.ApiResponse TimesPostWithHttpInfo(Times times, int operationIndex = 0) - { - // verify the required parameter 'times' is set - if (times == null) - { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling DefaultApi->TimesPost"); - } - BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); - string[] _contentTypes = new string[] { - "application/json" - }; - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - localVarRequestOptions.Data = times; - localVarRequestOptions.Operation = "DefaultApi.TimesPost"; - localVarRequestOptions.OperationIndex = operationIndex; - // authentication (ApiKey) required - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); - } - // make the HTTP request - var localVarResponse = this.Client.Post("/times", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("TimesPost", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - return localVarResponse; - } - /// - /// Create a new times entry for a ship call - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of Id - public async System.Threading.Tasks.Task TimesPostAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesPostWithHttpInfoAsync(times, operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - /// - /// Create a new times entry for a ship call - /// - /// Thrown when fails to make API call - /// Times entry that will be added to the ship call. **Do not** provide id parameter. - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> TimesPostWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // verify the required parameter 'times' is set - if (times == null) - { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling DefaultApi->TimesPost"); - } - BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); - string[] _contentTypes = new string[] { - "application/json" - }; - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - localVarRequestOptions.Data = times; - localVarRequestOptions.Operation = "DefaultApi.TimesPost"; - localVarRequestOptions.OperationIndex = operationIndex; - // authentication (ApiKey) required - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); - } - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/times", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("TimesPost", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - return localVarResponse; - } - /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call Updating a times entry for a ship for a particular participant. The times entries are required for a shipcall to pass the validation rules. /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// Id - public Id TimesPut(Times times, int operationIndex = 0) + public Id TimesUpdate(Times times, int operationIndex = 0) { - BreCalClient.misc.Client.ApiResponse localVarResponse = TimesPutWithHttpInfo(times); + BreCalClient.misc.Client.ApiResponse localVarResponse = TimesUpdateWithHttpInfo(times); return localVarResponse.Data; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call Updating a times entry for a ship for a particular participant. The times entries are required for a shipcall to pass the validation rules. /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// ApiResponse of Id - public BreCalClient.misc.Client.ApiResponse TimesPutWithHttpInfo(Times times, int operationIndex = 0) + public BreCalClient.misc.Client.ApiResponse TimesUpdateWithHttpInfo(Times times, int operationIndex = 0) { // verify the required parameter 'times' is set if (times == null) { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling DefaultApi->TimesPut"); + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling TimesApi->TimesUpdate"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -2129,7 +2214,7 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = times; - localVarRequestOptions.Operation = "DefaultApi.TimesPut"; + localVarRequestOptions.Operation = "TimesApi.TimesUpdate"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -2140,7 +2225,7 @@ namespace BreCalClient.misc.Api var localVarResponse = this.Client.Put("/times", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("TimesPut", localVarResponse); + Exception _exception = this.ExceptionFactory("TimesUpdate", localVarResponse); if (_exception != null) { throw _exception; @@ -2149,32 +2234,32 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call Updating a times entry for a ship for a particular participant. The times entries are required for a shipcall to pass the validation rules. /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id - public async System.Threading.Tasks.Task TimesPutAsync(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(System.Threading.CancellationToken)) { - BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesPutWithHttpInfoAsync(times, operationIndex, cancellationToken).ConfigureAwait(false); + BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesUpdateWithHttpInfoAsync(times, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call Updating a times entry for a ship for a particular participant. The times entries are required for a shipcall to pass the validation rules. /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) - public async System.Threading.Tasks.Task> TimesPutWithHttpInfoAsync(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(System.Threading.CancellationToken)) { // verify the required parameter 'times' is set if (times == null) { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling DefaultApi->TimesPut"); + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling TimesApi->TimesUpdate"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -2195,7 +2280,7 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = times; - localVarRequestOptions.Operation = "DefaultApi.TimesPut"; + localVarRequestOptions.Operation = "TimesApi.TimesUpdate"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -2206,7 +2291,7 @@ namespace BreCalClient.misc.Api var localVarResponse = await this.AsynchronousClient.PutAsync("/times", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("TimesPut", localVarResponse); + Exception _exception = this.ExceptionFactory("TimesUpdate", localVarResponse); if (_exception != null) { throw _exception; @@ -2214,30 +2299,256 @@ namespace BreCalClient.misc.Api } return localVarResponse; } + } +} + +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApiSync : IApiAccessor + { + #region Synchronous Operations /// - /// Update user details (first/last name, phone, password) + /// Returns a JWT session token and user data if successful /// + /// + /// Perform login + /// + /// Thrown when fails to make API call + /// Login credentials + /// Index associated with the operation. + /// LoginResult + LoginResult Login(Credentials credentials, int operationIndex = 0); + /// + /// Returns a JWT session token and user data if successful + /// + /// + /// Perform login + /// + /// Thrown when fails to make API call + /// Login credentials + /// Index associated with the operation. + /// ApiResponse of LoginResult + ApiResponse LoginWithHttpInfo(Credentials credentials, int operationIndex = 0); + /// + /// Update user details (first/last name, phone, password) + /// + /// + /// Update user information + /// /// Thrown when fails to make API call /// User details /// Index associated with the operation. + /// Id + Id UserUpdate(UserDetails userDetails, int operationIndex = 0); + /// + /// Update user details (first/last name, phone, password) + /// + /// + /// Update user information + /// + /// Thrown when fails to make API call + /// User details + /// Index associated with the operation. + /// ApiResponse of Id + ApiResponse UserUpdateWithHttpInfo(UserDetails userDetails, int operationIndex = 0); + #endregion Synchronous Operations + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Returns a JWT session token and user data if successful + /// + /// + /// Perform login + /// + /// Thrown when fails to make API call + /// Login credentials + /// 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)); + /// + /// Returns a JWT session token and user data if successful + /// + /// + /// Perform login + /// + /// Thrown when fails to make API call + /// Login credentials + /// 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)); + /// + /// Update user details (first/last name, phone, password) + /// + /// + /// Update user information + /// + /// Thrown when fails to make API call + /// User details + /// 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)); + /// + /// Update user details (first/last name, phone, password) + /// + /// + /// Update user information + /// + /// Thrown when fails to make API call + /// User details + /// 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)); + #endregion Asynchronous Operations + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApi : IUserApiSync, IUserApiAsync + { + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class UserApi : IUserApi + { + private BreCalClient.misc.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + /// + /// Initializes a new instance of the class. + /// /// - public void UserPut(UserDetails userDetails, int operationIndex = 0) + public UserApi() : this((string)null) { - UserPutWithHttpInfo(userDetails); } /// - /// Update user details (first/last name, phone, password) + /// Initializes a new instance of the class. + /// + /// + public UserApi(string basePath) + { + this.Configuration = BreCalClient.misc.Client.Configuration.MergeConfigurations( + BreCalClient.misc.Client.GlobalConfiguration.Instance, + new BreCalClient.misc.Client.Configuration { BasePath = basePath } + ); + this.Client = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public UserApi(BreCalClient.misc.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + this.Configuration = BreCalClient.misc.Client.Configuration.MergeConfigurations( + BreCalClient.misc.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public UserApi(BreCalClient.misc.Client.ISynchronousClient client, BreCalClient.misc.Client.IAsynchronousClient asyncClient, BreCalClient.misc.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// The client for accessing this underlying API asynchronously. + /// + public BreCalClient.misc.Client.IAsynchronousClient AsynchronousClient { get; set; } + /// + /// The client for accessing this underlying API synchronously. + /// + public BreCalClient.misc.Client.ISynchronousClient Client { get; set; } + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public BreCalClient.misc.Client.IReadableConfiguration Configuration { get; set; } + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public BreCalClient.misc.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + /// + /// Returns a JWT session token and user data if successful Perform login /// /// Thrown when fails to make API call - /// User details + /// Login credentials /// Index associated with the operation. - /// ApiResponse of Object(void) - public BreCalClient.misc.Client.ApiResponse UserPutWithHttpInfo(UserDetails userDetails, int operationIndex = 0) + /// LoginResult + public LoginResult Login(Credentials credentials, int operationIndex = 0) { - // verify the required parameter 'userDetails' is set - if (userDetails == null) + BreCalClient.misc.Client.ApiResponse localVarResponse = LoginWithHttpInfo(credentials); + return localVarResponse.Data; + } + /// + /// Returns a JWT session token and user data if successful Perform login + /// + /// Thrown when fails to make API call + /// Login credentials + /// Index associated with the operation. + /// ApiResponse of LoginResult + public BreCalClient.misc.Client.ApiResponse LoginWithHttpInfo(Credentials credentials, int operationIndex = 0) + { + // verify the required parameter 'credentials' is set + if (credentials == null) { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'userDetails' when calling DefaultApi->UserPut"); + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'credentials' when calling UserApi->Login"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -2257,8 +2568,8 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Data = userDetails; - localVarRequestOptions.Operation = "DefaultApi.UserPut"; + localVarRequestOptions.Data = credentials; + localVarRequestOptions.Operation = "UserApi.Login"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -2266,10 +2577,10 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = this.Client.Put("/user", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Post("/login", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("UserPut", localVarResponse); + Exception _exception = this.ExceptionFactory("Login", localVarResponse); if (_exception != null) { throw _exception; @@ -2278,31 +2589,96 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Update user details (first/last name, phone, password) + /// Returns a JWT session token and user data if successful Perform login /// /// Thrown when fails to make API call - /// User details + /// Login credentials /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of void - public async System.Threading.Tasks.Task UserPutAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Task of LoginResult + public async System.Threading.Tasks.Task LoginAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UserPutWithHttpInfoAsync(userDetails, operationIndex, cancellationToken).ConfigureAwait(false); + BreCalClient.misc.Client.ApiResponse localVarResponse = await LoginWithHttpInfoAsync(credentials, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; } /// - /// Update user details (first/last name, phone, password) + /// Returns a JWT session token and user data if successful Perform login + /// + /// Thrown when fails to make API call + /// Login credentials + /// 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)) + { + // verify the required parameter 'credentials' is set + if (credentials == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'credentials' when calling UserApi->Login"); + } + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + "application/json" + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Data = credentials; + localVarRequestOptions.Operation = "UserApi.Login"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/login", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Login", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// Update user details (first/last name, phone, password) Update user information /// /// Thrown when fails to make API call /// User details /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UserPutWithHttpInfoAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// Id + public Id UserUpdate(UserDetails userDetails, int operationIndex = 0) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = UserUpdateWithHttpInfo(userDetails); + return localVarResponse.Data; + } + /// + /// Update user details (first/last name, phone, password) Update user information + /// + /// Thrown when fails to make API call + /// User details + /// Index associated with the operation. + /// ApiResponse of Id + public BreCalClient.misc.Client.ApiResponse UserUpdateWithHttpInfo(UserDetails userDetails, int operationIndex = 0) { // verify the required parameter 'userDetails' is set if (userDetails == null) { - throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'userDetails' when calling DefaultApi->UserPut"); + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'userDetails' when calling UserApi->UserUpdate"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -2323,7 +2699,7 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = userDetails; - localVarRequestOptions.Operation = "DefaultApi.UserPut"; + localVarRequestOptions.Operation = "UserApi.UserUpdate"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) @@ -2331,10 +2707,76 @@ namespace BreCalClient.misc.Api localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = this.Client.Put("/user", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("UserPut", localVarResponse); + Exception _exception = this.ExceptionFactory("UserUpdate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// Update user details (first/last name, phone, password) Update user information + /// + /// Thrown when fails to make API call + /// User details + /// 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)) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = await UserUpdateWithHttpInfoAsync(userDetails, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + /// + /// Update user details (first/last name, phone, password) Update user information + /// + /// Thrown when fails to make API call + /// User details + /// 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)) + { + // verify the required parameter 'userDetails' is set + if (userDetails == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'userDetails' when calling UserApi->UserUpdate"); + } + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + "application/json" + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Data = userDetails; + localVarRequestOptions.Operation = "UserApi.UserUpdate"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UserUpdate", localVarResponse); if (_exception != null) { throw _exception; @@ -5961,11 +6403,6 @@ namespace BreCalClient.misc.Model [DataContract(Name = "participant")] public partial class Participant : IEquatable, IValidatableObject { - /// - /// Gets or Sets Type - /// - [DataMember(Name = "type", EmitDefaultValue = true)] - public ParticipantType? Type { get; set; } /// /// Initializes a new instance of the class. /// @@ -5974,12 +6411,12 @@ namespace BreCalClient.misc.Model /// street. /// postalCode. /// city. - /// type. + /// a logical combinat. /// flags. /// created. /// modified. /// deleted (default to false). - public Participant(int id = default(int), string name = default(string), string street = default(string), string postalCode = default(string), string city = default(string), ParticipantType? type = default(ParticipantType?), int flags = default(int), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) + public Participant(int id = default(int), string name = default(string), string street = default(string), string postalCode = default(string), string city = default(string), int type = default(int), int flags = default(int), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) { this.Id = id; this.Name = name; @@ -6018,6 +6455,12 @@ namespace BreCalClient.misc.Model [DataMember(Name = "city", EmitDefaultValue = true)] public string City { get; set; } /// + /// a logical combinat + /// + /// a logical combinat + [DataMember(Name = "type", EmitDefaultValue = true)] + public int Type { get; set; } + /// /// Gets or Sets Flags /// [DataMember(Name = "flags", EmitDefaultValue = true)] @@ -6372,6 +6815,95 @@ namespace BreCalClient.misc.Model } } +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Model +{ + /// + /// Enumeration that can take particular values + /// + [DataContract(Name = "ParticipantType2")] + public partial class ParticipantType2 : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public ParticipantType2() + { + } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ParticipantType2 {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ParticipantType2); + } + /// + /// Returns true if ParticipantType2 instances are equal + /// + /// Instance of ParticipantType2 to be compared + /// Boolean + public bool Equals(ParticipantType2 input) + { + if (input == null) + { + return false; + } + return false; + } + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } +} + /* * Bremen calling API * @@ -7212,11 +7744,6 @@ namespace BreCalClient.misc.Model [DataContract(Name = "times")] public partial class Times : IEquatable, IValidatableObject { - /// - /// Gets or Sets ParticipantType - /// - [DataMember(Name = "participant_type", EmitDefaultValue = true)] - public ParticipantType? ParticipantType { get; set; } /// /// Initializes a new instance of the class. /// @@ -7245,7 +7772,7 @@ namespace BreCalClient.misc.Model /// participantType. /// created. /// modified. - public Times(int id = default(int), DateTime etaBerth = default(DateTime), bool etaBerthFixed = default(bool), DateTime etdBerth = default(DateTime), bool etdBerthFixed = default(bool), DateTime lockTime = default(DateTime), bool lockTimeFixed = default(bool), DateTime zoneEntry = default(DateTime), bool zoneEntryFixed = default(bool), DateTime operationsStart = default(DateTime), DateTime operationsEnd = default(DateTime), string remarks = default(string), int shipcallId = default(int), int participantId = default(int), int berthId = default(int), string berthInfo = default(string), bool pierSide = default(bool), ParticipantType? participantType = default(ParticipantType?), DateTime created = default(DateTime), DateTime modified = default(DateTime)) + public Times(int id = default(int), DateTime etaBerth = default(DateTime), bool etaBerthFixed = default(bool), DateTime etdBerth = default(DateTime), bool etdBerthFixed = default(bool), DateTime lockTime = default(DateTime), bool lockTimeFixed = default(bool), DateTime zoneEntry = default(DateTime), bool zoneEntryFixed = default(bool), DateTime operationsStart = default(DateTime), DateTime operationsEnd = default(DateTime), string remarks = default(string), int shipcallId = default(int), int participantId = default(int), int berthId = default(int), string berthInfo = default(string), bool pierSide = default(bool), ParticipantType2 participantType = default(ParticipantType2), DateTime created = default(DateTime), DateTime modified = default(DateTime)) { this.ShipcallId = shipcallId; this.ParticipantId = participantId; @@ -7354,6 +7881,11 @@ namespace BreCalClient.misc.Model [DataMember(Name = "pier_side", EmitDefaultValue = true)] public bool PierSide { get; set; } /// + /// Gets or Sets ParticipantType + /// + [DataMember(Name = "participant_type", EmitDefaultValue = true)] + public ParticipantType2 ParticipantType { get; set; } + /// /// Gets or Sets Created /// [DataMember(Name = "created", EmitDefaultValue = true)] @@ -7501,7 +8033,8 @@ namespace BreCalClient.misc.Model ) && ( this.ParticipantType == input.ParticipantType || - this.ParticipantType.Equals(input.ParticipantType) + (this.ParticipantType != null && + this.ParticipantType.Equals(input.ParticipantType)) ) && ( this.Created == input.Created || @@ -7564,7 +8097,10 @@ namespace BreCalClient.misc.Model hashCode = (hashCode * 59) + this.BerthInfo.GetHashCode(); } hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); - hashCode = (hashCode * 59) + this.ParticipantType.GetHashCode(); + if (this.ParticipantType != null) + { + hashCode = (hashCode * 59) + this.ParticipantType.GetHashCode(); + } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index e014ffa..5c3ad92 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -1,859 +1,896 @@ -openapi: "3.1.0" +openapi: 3.1.0 +x-stoplight: + id: iucm9tq7jgu7j info: - version: "1.1.0" - title: "Bremen calling API" - description: Administer DEBRE ship calls, times and notifications - termsOfService: "https://www.bsmd.de/" # TBD: url to terms page - contact: - name: "Bremen calling API" - url: "https://www.textbausteine.net" - email: "info@textbausteine.net" - license: - name: "Use at your own risk" - url: "https://www.bsmd.de/license" - + version: 1.1.0 + title: Bremen calling API + description: 'Administer DEBRE ship calls, times and notifications' + termsOfService: 'https://www.bsmd.de/' + contact: + name: Bremen calling API + url: 'https://www.textbausteine.net' + email: info@textbausteine.net + license: + name: Use at your own risk + url: 'https://www.bsmd.de/license' + summary: Bremen calling servers: - - url: "https://brecaldevel.bsmd-emswe.eu/" - description: "Development server hosted on vcup" - + - url: 'https://brecaldevel.bsmd-emswe.eu' + description: Development server hosted on vcup +tags: + - name: user + - name: shipcall + - name: times + - name: static paths: - /login: - post: - summary: Returns a JWT session token and user data if successful - requestBody: - description: Login credentials - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/credentials" - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: "#/components/schemas/login_result" - 400: - $ref: "#/components/responses/400" - 403: - $ref: "#/components/responses/403" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - - /user: - put: - summary: Update user details (first/last name, phone, password) - requestBody: - description: User details - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/user_details" - responses: - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - - /shipcalls: - get: - summary: Gets a list of ship calls - parameters: - - name: past_days - in: query - required: false - description: "number of days in the past to include in the result. *Example: 7*." - schema: - type: integer - responses: - 200: - description: ship call list - content: - application/json: - schema: - $ref: "#/components/schemas/shipcalls" - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - post: - summary: Create a new ship call - requestBody: - description: Creates a new ship call. **Do not** provide id parameter. - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/shipcall" - responses: - 201: - $ref: "#/components/responses/201" - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - - put: - summary: Updates a ship call - requestBody: - description: Creates a new ship call. The id parameter is **required**. - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/shipcall" - responses: - 200: - $ref: "#/components/responses/200" - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - - /ships: - get: - summary: gets a list of registered shipcalls - responses: - 200: - description: list of ships - content: - application/json: - schema: - $ref: "#/components/schemas/ship_list" - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - - /participants: - get: - summary: gets a particular participant entry corresponding to user id - parameters: - - name: user_id - in: query - required: false - description: "**Id of user**. *Example: 2*. User id returned by verify call." - schema: - type: integer - responses: - 200: - description: ship call list - content: - application/json: - schema: - $ref: "#/components/schemas/participant_list" - 400: - $ref: "#/components/responses/400" - 404: - $ref: "#/components/responses/404" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - - /times: - get: - summary: Get all recorded times for a a ship call - parameters: - - name: shipcall_id - in: query - description: "**Id**. *Example: 42*. Id of referenced ship call." - schema: - type: integer - responses: - 200: - description: list of recorded times - content: - application/json: - schema: - $ref: "#/components/schemas/times_list" - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - - post: - summary: Create a new times entry for a ship call - requestBody: - description: Times entry that will be added to the ship call. **Do not** provide id parameter. - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/times" - responses: - 201: - $ref: "#/components/responses/201" - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - - put: - summary: Update a times entry for a ship call - requestBody: - description: Times entry that will be added to the ship call. The id parameter is **required**. - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/times" - responses: - 200: - $ref: "#/components/responses/200" - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - - delete: - summary: Delete a times entry for a ship call. - parameters: - - name: id - in: query - required: true - schema: - $ref: "#/components/schemas/timesId" - responses: - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - - /notifications: - get: - summary: Gets a list of notifications pursuant to a specified participant and ship call - parameters: - - name: participant_id - in: query - required: true - description: "**Id of participant**. *Example: 2*. Id returned through loading of participant" - schema: - type: integer - - name: shipcall_id - in: query - required: true - description: "**Id of ship call**. *Example: 52*. Id given in ship call list" - schema: - $ref: "#/components/schemas/shipcallId" - responses: - 200: - description: notification list - content: - application/json: - schema: - $ref: "#/components/schemas/notification" - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" - /berths: - get: - summary: Gets a list of all berths registered - responses: - 200: - description: list of berths - content: - application/json: - schema: - $ref: "#/components/schemas/berth_list" - 400: - $ref: "#/components/responses/400" - 401: - $ref: "#/components/responses/401" - 500: - $ref: "#/components/responses/500" - 503: - $ref: "#/components/responses/503" + /login: + post: + description: Perform login + summary: Returns a JWT session token and user data if successful + tags: + - user + operationId: login + requestBody: + description: Login credentials + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/credentials' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/login_result' + '400': + $ref: '#/components/responses/400' + '403': + $ref: '#/components/responses/403' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + /user: + put: + description: Update user information + summary: 'Update user details (first/last name, phone, password)' + tags: + - user + operationId: userUpdate + requestBody: + description: User details + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/user_details' + responses: + '200': + $ref: '#/components/responses/200' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + /shipcalls: + get: + description: Get current ship calls + summary: Gets a list of ship calls + tags: + - shipcall + operationId: shipcallsGet + parameters: + - name: past_days + in: query + required: false + description: 'number of days in the past to include in the result. *Example: 7*.' + schema: + type: integer + responses: + '200': + description: ship call list + content: + application/json: + schema: + $ref: '#/components/schemas/shipcalls' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + post: + summary: Create a new ship call + description: A new shipcall is created without times at this point. This is ususally done by the BSMD or a participant with that particular role. + tags: + - shipcall + operationId: shipcallCreate + requestBody: + description: Creates a new ship call. **Do not** provide id parameter. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/shipcall' + responses: + '201': + $ref: '#/components/responses/201' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + put: + summary: Updates a ship call + description: Updates a shipcall. Usually done if the participant assignments change. + tags: + - shipcall + operationId: shipcallUpdate + requestBody: + description: Creates a new ship call. The id parameter is **required**. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/shipcall' + responses: + '200': + $ref: '#/components/responses/200' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + /ships: + get: + summary: gets a list of ships + description: Gets a list of ships including logically deleted ships to be used with shipcalls + tags: + - static + operationId: shipsGet + responses: + '200': + description: list of ships + content: + application/json: + schema: + $ref: '#/components/schemas/ship_list' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + /participants: + get: + summary: gets one or all participants + description: 'If no parameter is given, all participants are returned. The list can be used to display participant information in the context of ship calls.' + tags: + - static + operationId: participantsGet + parameters: + - name: user_id + in: query + required: false + description: '**Id of user**. *Example: 2*. User id returned by verify call.' + schema: + type: integer + responses: + '200': + description: ship call list + content: + application/json: + schema: + $ref: '#/components/schemas/participant_list' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '404': + $ref: '#/components/responses/404' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + /times: + get: + summary: Gets list of times + description: Get all times assigned to a shipcall. These might not be complete. + tags: + - times + operationId: timesGet + parameters: + - name: shipcall_id + in: query + description: '**Id**. *Example: 42*. Id of referenced ship call.' + schema: + type: integer + responses: + '200': + description: list of recorded times + content: + application/json: + schema: + $ref: '#/components/schemas/times_list' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + post: + summary: Create a new times entry for a ship call + description: The times entry for a shipcall is created with reference to a participant. For each participant type there should be only one times data record. + tags: + - times + operationId: timesCreate + requestBody: + description: Times entry that will be added to the ship call. **Do not** provide id parameter. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/times' + responses: + '201': + $ref: '#/components/responses/201' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + put: + summary: Update a times entry for a ship call + description: Updating a times entry for a ship for a particular participant. The times entries are required for a shipcall to pass the validation rules. + tags: + - times + operationId: timesUpdate + requestBody: + description: Times entry that will be added to the ship call. The id parameter is **required**. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/times' + responses: + '200': + $ref: '#/components/responses/200' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + delete: + summary: Delete a times entry for a ship call. + description: A times entry is typically deleted if the agent for example changes or removes the participant assignment for a particular role. + tags: + - times + operationId: timesDelete + parameters: + - name: id + in: query + required: true + schema: + $ref: '#/components/schemas/timesId' + responses: + '200': + $ref: '#/components/responses/200' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + /notifications: + get: + summary: Gets a list of notifications pursuant to a specified participant and ship call + description: List of notifications (tbd) + tags: + - static + operationId: notificationsGet + parameters: + - name: participant_id + in: query + required: true + description: '**Id of participant**. *Example: 2*. Id returned through loading of participant' + schema: + type: integer + - name: shipcall_id + in: query + required: true + description: '**Id of ship call**. *Example: 52*. Id given in ship call list' + schema: + $ref: '#/components/schemas/shipcallId' + responses: + '200': + description: notification list + content: + application/json: + schema: + $ref: '#/components/schemas/notification' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + /berths: + get: + description: 'Returns a list of berths, including berths that are (logically) deleted' + summary: Gets a list of all berths registered + tags: + - static + operationId: berthsGet + responses: + '200': + description: list of berths + content: + application/json: + schema: + $ref: '#/components/schemas/berth_list' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' components: - schemas: - credentials: - type: object - required: - - username - - password - properties: - username: - type: string - password: - type: string - format: password - timesId: - description: The unique identifier for a times entry - type: integer - shipcallId: - description: The unique identifier of a ship call - type: integer - participant_assignment: - description: Participant assigned to a shipcall with a given role (type) - type: object - required: - - participant_id - - type - properties: - participant_id: - type: integer - type: - type: integer - shipcall: - type: object - required: - - id - - ship_id - - type - properties: - id: - $ref: "#/components/schemas/shipcallId" - ship_id: - type: integer - type: - type: ShipcallType - eta: - type: string - format: date-time - nullable: true - voyage: - type: string - maxLength: 16 - nullable: true - etd: - type: string - format: date-time - nullable: true - arrival_berth_id: - type: integer - nullable: true - departure_berth_id: - type: integer - nullable: true - tug_required: - type: boolean - nullable: true - pilot_required: - type: boolean - nullable: true - flags: - type: integer - nullable: true - pier_side: - type: boolean - nullable: true - bunkering: - type: boolean - nullable: true - replenishing_terminal: - type: boolean - nullable: true - replenishing_lock: - type: boolean - nullable: true - draft: - type: number - format: float - nullable: true - tidal_window_from: - type: string - format: date-time - nullable: true - tidal_window_to: - type: string - format: date-time - nullable: true - rain_sensitive_cargo: - type: boolean - nullable: true - recommended_tugs: - type: integer - nullable: true - anchored: - type: boolean - nullable: true - moored_lock: - type: boolean - nullable: true - canceled: - type: boolean - nullable: true - evaluation: - type: integer - nullable: true - evaluation_message: - type: string - nullable: true - participants: - type: array - items: - $ref: "#/components/schemas/participant_assignment" - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true - - shipcalls: - type: array - items: - $ref: "#/components/schemas/shipcall" - - times: - type: object - description: the id parameter needs to be missing on POST and to be present on PUT (Update) calls, otherwise a 400 response will be generated - required: - - shipcall_id - - participant_id - properties: - id: - type: integer - eta_berth: - type: string - format: date-time - nullable: true - eta_berth_fixed: - type: boolean - nullable: true - etd_berth: - type: string - format: date-time - nullable: true - etd_berth_fixed: - type: boolean - nullable: true - lock_time: - type: string - format: date-time - nullable: true - lock_time_fixed: - type: boolean - nullable: true - zone_entry: - type: string - format: date-time - nullable: true - zone_entry_fixed: - type: boolean - nullable: true - operations_start: - type: string - format: date-time - nullable: true - operations_end: - type: string - format: date-time - nullable: true - remarks: - type: string - maxLength: 512 - nullable: true - shipcall_id: - type: integer - participant_id: - type: integer - berth_id: - type: integer - nullable: true - berth_info: - type: string - nullable: true - pier_side: - type: boolean - nullable: true - participant_type: - type: ParticipantType - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true - - times_list: - type: array - items: - $ref: "#/components/schemas/times" - - berth: - type: object - description: Ship berth used for a ship call - properties: - id: - type: integer - name: - type: string - maxLength: 128 - owner_id: - type: integer - nullable: true - authority_id: - type: integer - nullable: true - lock: - type: boolean - nullable: true - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true - deleted: - type: boolean - default: false - - berth_list: - type: array - items: - $ref: "#/components/schemas/berth" - - ship: - type: object - description: a ship - properties: - id: - type: integer - name: - type: string - maxLength: 64 - imo: - type: integer - nullable: true - callsign: - type: string - maxLength: 8 - nullable: true - participant_id: - type: integer - nullable: true - length: - type: number - format: float - nullable: true - width: - type: number - format: float - nullable: true - is_tug: - type: boolean - default: false - bollard_pull: - type: integer - nullable: true - eni: - type: integer - nullable: true - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true - deleted: - type: boolean - default: false - - ship_list: - type: array - items: - $ref: "#/components/schemas/ship" - - notification: - type: object - description: a notification created by the engine if a times entry violates a rule - properties: - id: - type: integer - times_id: - type: integer - participant_id: - type: integer - notification_type: - $ref: "#/components/schemas/NotificationType" - timestamp: - type: string - format: date-time - acknowledged: - type: boolean - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true - - notification_list: - type: array - items: - $ref: "#/components/schemas/notification" - - participant: - type: object - description: A organisational entity that participates in Bremen Calling - properties: - id: - type: integer - name: - type: string - maxLength: 128 - street: - type: string - maxLength: 128 - postal code: - type: string - maxLength: 5 - city: - type: string - maxLength: 64 - type: - type: ParticipantType - flags: - type: integer - nullable: true - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true - deleted: - type: boolean - default: false - - participant_list: - type: array - items: - $ref: "#/components/schemas/participant" - - login_result: - type: object - description: result structure of a successful login attempt - properties: - id: - type: integer - participant_id: - type: integer - first_name: - type: string - last_name: - type: string - user_name: - type: string - user_phone: - type: string - user_email: - type: string - exp: - type: number - format: float - token: - type: string - - user_details: - type: object - description: fields that a user may change - properties: - id: - type: integer - old_password: - type: string - nullable: true - new_password: - type: string - nullable: true - first_name: - type: string - nullable: true - last_name: - type: string - nullable: true - user_phone: - type: string - nullable: true - user_email: - type: string - nullable: true - Id: - type: object - description: A unique identifier for an entity - properties: - id: - type: integer - Error: - type: object - required: - - message - properties: - message: - description: A human readable error message - type: string - - ShipcallType: - type: string - enum: [undefined, arrival, departure, shifting] - - NotificationType: - type: string - enum: [undefined, email, push] - - ParticipantType: - type: integer - enum: - - 1 - - 2 - - 4 - - 8 - - 16 - - 32 - - 64 - x-enumDescriptions: - 1: bsmd - 2: terminal - 4: pilot - 8: agency - 16: mooring - 32: port_authority - 64: tug - - # this here works only with OpenAPI 3.1 - # ParticipantType: - # type: integer - # oneOf: - # - const: 1 - # title: bsmd - # description: Bremen Schiffsmeldedienst - - # - const: 2 - # title: terminal - # description: Terminal - - # - const: 4 - # title: pilot - # description: Pilot - - # - const: 8 - # title: agency - # description: Agency - - # - const: 16 - # title: mooring - # description: Mooring - - # - const: 32 - # title: port_authority - # description: Port Authority - - # - const: 64 - # title: tug - # description: Tug - - securitySchemes: - ApiKey: - type: apiKey - in: header - name: Authorization - responses: - 200: - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/Id" - 201: - description: Created - content: - application/json: - schema: - $ref: "#/components/schemas/Id" - 400: - description: Bad request - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - 401: - description: Not authorized - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - 403: - description: Forbidden - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - 404: - description: Not found - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - 500: - description: Unexpected error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - 503: - description: Service unavailable - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - + schemas: + credentials: + type: object + properties: + username: + type: string + password: + type: string + format: password + required: + - username + - password + timesId: + description: The unique identifier for a times entry + type: integer + shipcallId: + description: The unique identifier of a ship call + type: integer + participant_assignment: + description: Participant assigned to a shipcall with a given role (type) + type: object + required: + - participant_id + - type + properties: + participant_id: + type: integer + type: + type: integer + shipcall: + type: object + required: + - id + - ship_id + - type + properties: + id: + $ref: '#/components/schemas/shipcallId' + ship_id: + type: integer + type: + $ref: '#/components/schemas/ShipcallType' + eta: + type: string + format: date-time + nullable: true + voyage: + type: string + maxLength: 16 + nullable: true + etd: + type: string + format: date-time + nullable: true + arrival_berth_id: + type: integer + nullable: true + departure_berth_id: + type: integer + nullable: true + tug_required: + type: boolean + nullable: true + pilot_required: + type: boolean + nullable: true + flags: + type: integer + nullable: true + pier_side: + type: boolean + nullable: true + bunkering: + type: boolean + nullable: true + replenishing_terminal: + type: boolean + nullable: true + replenishing_lock: + type: boolean + nullable: true + draft: + type: number + format: float + nullable: true + tidal_window_from: + type: string + format: date-time + nullable: true + tidal_window_to: + type: string + format: date-time + nullable: true + rain_sensitive_cargo: + type: boolean + nullable: true + recommended_tugs: + type: integer + nullable: true + anchored: + type: boolean + nullable: true + moored_lock: + type: boolean + nullable: true + canceled: + type: boolean + nullable: true + evaluation: + type: integer + nullable: true + evaluation_message: + type: string + nullable: true + participants: + type: array + items: + $ref: '#/components/schemas/participant_assignment' + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true + shipcalls: + type: array + items: + $ref: '#/components/schemas/shipcall' + times: + type: object + description: 'the id parameter needs to be missing on POST and to be present on PUT (Update) calls, otherwise a 400 response will be generated' + required: + - shipcall_id + - participant_id + properties: + id: + type: integer + eta_berth: + type: string + format: date-time + nullable: true + eta_berth_fixed: + type: boolean + nullable: true + etd_berth: + type: string + format: date-time + nullable: true + etd_berth_fixed: + type: boolean + nullable: true + lock_time: + type: string + format: date-time + nullable: true + lock_time_fixed: + type: boolean + nullable: true + zone_entry: + type: string + format: date-time + nullable: true + zone_entry_fixed: + type: boolean + nullable: true + operations_start: + type: string + format: date-time + nullable: true + operations_end: + type: string + format: date-time + nullable: true + remarks: + type: string + maxLength: 512 + nullable: true + shipcall_id: + type: integer + participant_id: + type: integer + berth_id: + type: integer + nullable: true + berth_info: + type: string + nullable: true + pier_side: + type: boolean + nullable: true + participant_type: + $ref: '#/components/schemas/ParticipantType2' + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true + times_list: + type: array + items: + $ref: '#/components/schemas/times' + berth: + type: object + description: Ship berth used for a ship call + properties: + id: + type: integer + name: + type: string + maxLength: 128 + owner_id: + type: integer + nullable: true + authority_id: + type: integer + nullable: true + lock: + type: boolean + nullable: true + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true + deleted: + type: boolean + default: false + berth_list: + type: array + items: + $ref: '#/components/schemas/berth' + ship: + type: object + description: a ship + properties: + id: + type: integer + name: + type: string + maxLength: 64 + imo: + type: integer + nullable: true + callsign: + type: string + maxLength: 8 + nullable: true + participant_id: + type: integer + nullable: true + length: + type: number + format: float + nullable: true + width: + type: number + format: float + nullable: true + is_tug: + type: boolean + default: false + bollard_pull: + type: integer + nullable: true + eni: + type: integer + nullable: true + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true + deleted: + type: boolean + default: false + ship_list: + type: array + items: + $ref: '#/components/schemas/ship' + notification: + type: object + description: a notification created by the engine if a times entry violates a rule + properties: + id: + type: integer + times_id: + type: integer + participant_id: + type: integer + notification_type: + $ref: '#/components/schemas/NotificationType' + timestamp: + type: string + format: date-time + acknowledged: + type: boolean + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true + participant: + type: object + description: A organisational entity that participates in Bremen Calling + properties: + id: + type: integer + name: + type: string + maxLength: 128 + street: + type: string + maxLength: 128 + postal code: + type: string + maxLength: 5 + city: + type: string + maxLength: 64 + type: + type: integer + description: a logical combinat + flags: + type: integer + nullable: true + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true + deleted: + type: boolean + default: false + participant_list: + type: array + items: + $ref: '#/components/schemas/participant' + login_result: + type: object + description: result structure of a successful login attempt + properties: + id: + type: integer + participant_id: + type: integer + first_name: + type: string + last_name: + type: string + user_name: + type: string + user_phone: + type: string + user_email: + type: string + exp: + type: number + format: float + token: + type: string + user_details: + type: object + description: fields that a user may change + properties: + id: + type: integer + old_password: + type: string + nullable: true + new_password: + type: string + nullable: true + first_name: + type: string + nullable: true + last_name: + type: string + nullable: true + user_phone: + type: string + nullable: true + user_email: + type: string + nullable: true + Id: + type: object + description: A unique identifier for an entity + properties: + id: + type: integer + Error: + type: object + required: + - message + properties: + message: + description: A human readable error message + type: string + ShipcallType: + type: string + enum: + - undefined + - arrival + - departure + - shifting + x-internal: false + description: '' + NotificationType: + type: string + enum: + - undefined + - email + - push + ParticipantType: + type: integer + enum: + - 1 + - 2 + - 4 + - 8 + - 16 + - 32 + - 64 + x-enumDescriptions: + '1': bsmd + '2': terminal + '4': pilot + '8': agency + '16': mooring + '32': port_authority + '64': tug + ParticipantType2: + title: ParticipantType2 + x-stoplight: + id: whw0m8x8dq6cg + type: integer + oneOf: + - const: 1 + title: bsmd + description: Bremen Schiffsmeldedienst + - const: 2 + title: terminal + description: Terminal + - const: 4 + title: pilot + description: Pilot + - const: 8 + title: agency + description: Agency + - const: 16 + title: mooring + description: Mooring + - const: 32 + title: port_authority + description: Port Authority + - const: 64 + title: tug + description: Tug + description: Enumeration that can take particular values + securitySchemes: + ApiKey: + type: apiKey + in: header + name: Authorization + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Id' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Id' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Service unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' security: - - ApiKey: [] + - ApiKey: [] externalDocs: - url: http://textbausteine.net/ - description: Extra documentation and conditions for Bremen Calling + url: 'http://textbausteine.net/' + description: Extra documentation and conditions for Bremen Calling +x-internal: true From bd81f01d76dbfeced8ba713f6470618faa4cf08f Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 18 Dec 2023 18:10:58 +0100 Subject: [PATCH 03/34] fixed a lot of small problems in yaml file, returned to OpenApi 3.0 format --- misc/BreCalApi.cs | 819 ++++++++++++----------- misc/BreCalApi.yaml | 84 +-- src/BreCalClient/Extensions.cs | 30 +- src/BreCalClient/ShipcallControl.xaml.cs | 24 +- src/BreCalClient/ShipcallControlModel.cs | 21 +- 5 files changed, 488 insertions(+), 490 deletions(-) diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index d153dad..a99de65 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// Generated REST API Client Code Generator v1.9.1.0 on 15.12.2023 15:53:58 +// Generated REST API Client Code Generator v1.9.1.0 on 18.12.2023 18:02:05 // Using the tool OpenAPI Generator v7.1.0 // //---------------------- @@ -4087,7 +4087,7 @@ namespace BreCalClient.misc.Client /// /// Gets or sets the base path for API access. /// - public virtual string BasePath + public virtual string BasePath { get { return _basePath; } set { _basePath = value; } @@ -5383,7 +5383,7 @@ namespace BreCalClient.misc.Model /// created. /// modified. /// deleted (default to false). - public Berth(int id = default(int), string name = default(string), int ownerId = default(int), int authorityId = default(int), bool varLock = default(bool), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) + public Berth(int id = default(int), string name = default(string), int? ownerId = default(int?), int? authorityId = default(int?), bool? varLock = default(bool?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; @@ -5408,17 +5408,17 @@ namespace BreCalClient.misc.Model /// Gets or Sets OwnerId /// [DataMember(Name = "owner_id", EmitDefaultValue = true)] - public int OwnerId { get; set; } + public int? OwnerId { get; set; } /// /// Gets or Sets AuthorityId /// [DataMember(Name = "authority_id", EmitDefaultValue = true)] - public int AuthorityId { get; set; } + public int? AuthorityId { get; set; } /// /// Gets or Sets VarLock /// [DataMember(Name = "lock", EmitDefaultValue = true)] - public bool VarLock { get; set; } + public bool? VarLock { get; set; } /// /// Gets or Sets Created /// @@ -5428,7 +5428,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Gets or Sets Deleted /// @@ -5481,38 +5481,41 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.OwnerId == input.OwnerId || - this.OwnerId.Equals(input.OwnerId) - ) && + (this.OwnerId != null && + this.OwnerId.Equals(input.OwnerId)) + ) && ( this.AuthorityId == input.AuthorityId || - this.AuthorityId.Equals(input.AuthorityId) - ) && + (this.AuthorityId != null && + this.AuthorityId.Equals(input.AuthorityId)) + ) && ( this.VarLock == input.VarLock || - this.VarLock.Equals(input.VarLock) - ) && + (this.VarLock != null && + this.VarLock.Equals(input.VarLock)) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -5532,9 +5535,18 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } - hashCode = (hashCode * 59) + this.OwnerId.GetHashCode(); - hashCode = (hashCode * 59) + this.AuthorityId.GetHashCode(); - hashCode = (hashCode * 59) + this.VarLock.GetHashCode(); + if (this.OwnerId != null) + { + hashCode = (hashCode * 59) + this.OwnerId.GetHashCode(); + } + if (this.AuthorityId != null) + { + hashCode = (hashCode * 59) + this.AuthorityId.GetHashCode(); + } + if (this.VarLock != null) + { + hashCode = (hashCode * 59) + this.VarLock.GetHashCode(); + } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -5657,12 +5669,12 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Username == input.Username || (this.Username != null && this.Username.Equals(input.Username)) - ) && + ) && ( this.Password == input.Password || (this.Password != null && @@ -5782,7 +5794,7 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Message == input.Message || (this.Message != null && @@ -5887,7 +5899,7 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.VarId == input.VarId || this.VarId.Equals(input.VarId) @@ -6052,44 +6064,44 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) - ) && + ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) - ) && + ) && ( this.UserName == input.UserName || (this.UserName != null && this.UserName.Equals(input.UserName)) - ) && + ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) - ) && + ) && ( this.UserEmail == input.UserEmail || (this.UserEmail != null && this.UserEmail.Equals(input.UserEmail)) - ) && + ) && ( this.Exp == input.Exp || this.Exp.Equals(input.Exp) - ) && + ) && ( this.Token == input.Token || (this.Token != null && @@ -6178,9 +6190,9 @@ namespace BreCalClient.misc.Model /// notificationType. /// timestamp. /// acknowledged. - /// created. - /// modified. - public Notification(int id = default(int), int timesId = default(int), int participantId = default(int), NotificationType? notificationType = default(NotificationType?), DateTime timestamp = default(DateTime), bool acknowledged = default(bool), DateTime created = default(DateTime), DateTime modified = default(DateTime)) + /// Readonly field set by the database. + /// Readonly field set by the database. + public Notification(int id = default(int), int timesId = default(int), int participantId = default(int), NotificationType? notificationType = default(NotificationType?), DateTime timestamp = default(DateTime), bool acknowledged = default(bool), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.TimesId = timesId; @@ -6217,15 +6229,17 @@ namespace BreCalClient.misc.Model [DataMember(Name = "acknowledged", EmitDefaultValue = true)] public bool Acknowledged { get; set; } /// - /// Gets or Sets Created + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// - /// Gets or Sets Modified + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Returns the string presentation of the object /// @@ -6273,37 +6287,37 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.TimesId == input.TimesId || this.TimesId.Equals(input.TimesId) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.NotificationType == input.NotificationType || this.NotificationType.Equals(input.NotificationType) - ) && + ) && ( this.Timestamp == input.Timestamp || (this.Timestamp != null && this.Timestamp.Equals(input.Timestamp)) - ) && + ) && ( this.Acknowledged == input.Acknowledged || this.Acknowledged.Equals(input.Acknowledged) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -6411,12 +6425,12 @@ namespace BreCalClient.misc.Model /// street. /// postalCode. /// city. - /// a logical combinat. + /// a logical combination (bitflag) of possible values. This cannot be encoded in a Enumeration type with discrete values in OpenAPI version < 3.1. The values are 1=. /// flags. - /// created. - /// modified. + /// Readonly field set by the database. + /// Readonly field set by the database. /// deleted (default to false). - public Participant(int id = default(int), string name = default(string), string street = default(string), string postalCode = default(string), string city = default(string), int type = default(int), int flags = default(int), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) + public Participant(int id = default(int), string name = default(string), string street = default(string), string postalCode = default(string), string city = default(string), int type = default(int), int? flags = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; @@ -6455,26 +6469,28 @@ namespace BreCalClient.misc.Model [DataMember(Name = "city", EmitDefaultValue = true)] public string City { get; set; } /// - /// a logical combinat + /// a logical combination (bitflag) of possible values. This cannot be encoded in a Enumeration type with discrete values in OpenAPI version < 3.1. The values are 1= /// - /// a logical combinat + /// a logical combination (bitflag) of possible values. This cannot be encoded in a Enumeration type with discrete values in OpenAPI version < 3.1. The values are 1= [DataMember(Name = "type", EmitDefaultValue = true)] public int Type { get; set; } /// /// Gets or Sets Flags /// [DataMember(Name = "flags", EmitDefaultValue = true)] - public int Flags { get; set; } + public int? Flags { get; set; } /// - /// Gets or Sets Created + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// - /// Gets or Sets Modified + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Gets or Sets Deleted /// @@ -6529,49 +6545,50 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.Street == input.Street || (this.Street != null && this.Street.Equals(input.Street)) - ) && + ) && ( this.PostalCode == input.PostalCode || (this.PostalCode != null && this.PostalCode.Equals(input.PostalCode)) - ) && + ) && ( this.City == input.City || (this.City != null && this.City.Equals(input.City)) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) - ) && + ) && ( this.Flags == input.Flags || - this.Flags.Equals(input.Flags) - ) && + (this.Flags != null && + this.Flags.Equals(input.Flags)) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -6604,7 +6621,10 @@ namespace BreCalClient.misc.Model hashCode = (hashCode * 59) + this.City.GetHashCode(); } hashCode = (hashCode * 59) + this.Type.GetHashCode(); - hashCode = (hashCode * 59) + this.Flags.GetHashCode(); + if (this.Flags != null) + { + hashCode = (hashCode * 59) + this.Flags.GetHashCode(); + } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -6732,11 +6752,11 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) @@ -6768,142 +6788,6 @@ namespace BreCalClient.misc.Model } } -/* - * Bremen calling API - * - * Administer DEBRE ship calls, times and notifications - * - * The version of the OpenAPI document: 1.1.0 - * Contact: info@textbausteine.net - * Generated by: https://github.com/openapitools/openapi-generator.git - */ -namespace BreCalClient.misc.Model -{ - /// - /// Defines ParticipantType - /// - public enum ParticipantType - { - /// - /// Enum NUMBER_1 for value: 1 - /// - NUMBER_1 = 1, - /// - /// Enum NUMBER_2 for value: 2 - /// - NUMBER_2 = 2, - /// - /// Enum NUMBER_4 for value: 4 - /// - NUMBER_4 = 4, - /// - /// Enum NUMBER_8 for value: 8 - /// - NUMBER_8 = 8, - /// - /// Enum NUMBER_16 for value: 16 - /// - NUMBER_16 = 16, - /// - /// Enum NUMBER_32 for value: 32 - /// - NUMBER_32 = 32, - /// - /// Enum NUMBER_64 for value: 64 - /// - NUMBER_64 = 64 - } -} - -/* - * Bremen calling API - * - * Administer DEBRE ship calls, times and notifications - * - * The version of the OpenAPI document: 1.1.0 - * Contact: info@textbausteine.net - * Generated by: https://github.com/openapitools/openapi-generator.git - */ -namespace BreCalClient.misc.Model -{ - /// - /// Enumeration that can take particular values - /// - [DataContract(Name = "ParticipantType2")] - public partial class ParticipantType2 : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public ParticipantType2() - { - } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - StringBuilder sb = new StringBuilder(); - sb.Append("class ParticipantType2 {\n"); - sb.Append("}\n"); - return sb.ToString(); - } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ParticipantType2); - } - /// - /// Returns true if ParticipantType2 instances are equal - /// - /// Instance of ParticipantType2 to be compared - /// Boolean - public bool Equals(ParticipantType2 input) - { - if (input == null) - { - return false; - } - return false; - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } -} - /* * Bremen calling API * @@ -6937,7 +6821,7 @@ namespace BreCalClient.misc.Model /// created. /// modified. /// deleted (default to false). - public Ship(int id = default(int), string name = default(string), int imo = default(int), string callsign = default(string), int participantId = default(int), float length = default(float), float width = default(float), bool isTug = false, int bollardPull = default(int), int eni = default(int), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) + public Ship(int id = default(int), string name = default(string), int? imo = default(int?), string callsign = default(string), int? participantId = default(int?), float? length = default(float?), float? width = default(float?), bool isTug = false, int? bollardPull = default(int?), int? eni = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; @@ -6967,7 +6851,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Imo /// [DataMember(Name = "imo", EmitDefaultValue = true)] - public int Imo { get; set; } + public int? Imo { get; set; } /// /// Gets or Sets Callsign /// @@ -6977,17 +6861,17 @@ namespace BreCalClient.misc.Model /// Gets or Sets ParticipantId /// [DataMember(Name = "participant_id", EmitDefaultValue = true)] - public int ParticipantId { get; set; } + public int? ParticipantId { get; set; } /// /// Gets or Sets Length /// [DataMember(Name = "length", EmitDefaultValue = true)] - public float Length { get; set; } + public float? Length { get; set; } /// /// Gets or Sets Width /// [DataMember(Name = "width", EmitDefaultValue = true)] - public float Width { get; set; } + public float? Width { get; set; } /// /// Gets or Sets IsTug /// @@ -6997,12 +6881,12 @@ namespace BreCalClient.misc.Model /// Gets or Sets BollardPull /// [DataMember(Name = "bollard_pull", EmitDefaultValue = true)] - public int BollardPull { get; set; } + public int? BollardPull { get; set; } /// /// Gets or Sets Eni /// [DataMember(Name = "eni", EmitDefaultValue = true)] - public int Eni { get; set; } + public int? Eni { get; set; } /// /// Gets or Sets Created /// @@ -7012,7 +6896,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Gets or Sets Deleted /// @@ -7070,59 +6954,65 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.Imo == input.Imo || - this.Imo.Equals(input.Imo) - ) && + (this.Imo != null && + this.Imo.Equals(input.Imo)) + ) && ( this.Callsign == input.Callsign || (this.Callsign != null && this.Callsign.Equals(input.Callsign)) - ) && + ) && ( this.ParticipantId == input.ParticipantId || - this.ParticipantId.Equals(input.ParticipantId) - ) && + (this.ParticipantId != null && + this.ParticipantId.Equals(input.ParticipantId)) + ) && ( this.Length == input.Length || - this.Length.Equals(input.Length) - ) && + (this.Length != null && + this.Length.Equals(input.Length)) + ) && ( this.Width == input.Width || - this.Width.Equals(input.Width) - ) && + (this.Width != null && + this.Width.Equals(input.Width)) + ) && ( this.IsTug == input.IsTug || this.IsTug.Equals(input.IsTug) - ) && + ) && ( this.BollardPull == input.BollardPull || - this.BollardPull.Equals(input.BollardPull) - ) && + (this.BollardPull != null && + this.BollardPull.Equals(input.BollardPull)) + ) && ( this.Eni == input.Eni || - this.Eni.Equals(input.Eni) - ) && + (this.Eni != null && + this.Eni.Equals(input.Eni)) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -7142,17 +7032,35 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } - hashCode = (hashCode * 59) + this.Imo.GetHashCode(); + if (this.Imo != null) + { + hashCode = (hashCode * 59) + this.Imo.GetHashCode(); + } if (this.Callsign != null) { hashCode = (hashCode * 59) + this.Callsign.GetHashCode(); } - hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - hashCode = (hashCode * 59) + this.Length.GetHashCode(); - hashCode = (hashCode * 59) + this.Width.GetHashCode(); + if (this.ParticipantId != null) + { + hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); + } + if (this.Length != null) + { + hashCode = (hashCode * 59) + this.Length.GetHashCode(); + } + if (this.Width != null) + { + hashCode = (hashCode * 59) + this.Width.GetHashCode(); + } hashCode = (hashCode * 59) + this.IsTug.GetHashCode(); - hashCode = (hashCode * 59) + this.BollardPull.GetHashCode(); - hashCode = (hashCode * 59) + this.Eni.GetHashCode(); + if (this.BollardPull != null) + { + hashCode = (hashCode * 59) + this.BollardPull.GetHashCode(); + } + if (this.Eni != null) + { + hashCode = (hashCode * 59) + this.Eni.GetHashCode(); + } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -7243,9 +7151,9 @@ namespace BreCalClient.misc.Model /// evaluation. /// evaluationMessage. /// participants. - /// created. - /// modified. - 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), float draft = default(float), 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), int evaluation = default(int), string evaluationMessage = default(string), List participants = default(List), DateTime created = default(DateTime), DateTime modified = default(DateTime)) + /// 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?), float? draft = default(float?), 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?), int? evaluation = default(int?), string evaluationMessage = default(string), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.ShipId = shipId; @@ -7291,7 +7199,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Eta /// [DataMember(Name = "eta", EmitDefaultValue = true)] - public DateTime Eta { get; set; } + public DateTime? Eta { get; set; } /// /// Gets or Sets Voyage /// @@ -7301,97 +7209,97 @@ namespace BreCalClient.misc.Model /// Gets or Sets Etd /// [DataMember(Name = "etd", EmitDefaultValue = true)] - public DateTime Etd { get; set; } + public DateTime? Etd { get; set; } /// /// Gets or Sets ArrivalBerthId /// [DataMember(Name = "arrival_berth_id", EmitDefaultValue = true)] - public int ArrivalBerthId { get; set; } + public int? ArrivalBerthId { get; set; } /// /// Gets or Sets DepartureBerthId /// [DataMember(Name = "departure_berth_id", EmitDefaultValue = true)] - public int DepartureBerthId { get; set; } + public int? DepartureBerthId { get; set; } /// /// Gets or Sets TugRequired /// [DataMember(Name = "tug_required", EmitDefaultValue = true)] - public bool TugRequired { get; set; } + public bool? TugRequired { get; set; } /// /// Gets or Sets PilotRequired /// [DataMember(Name = "pilot_required", EmitDefaultValue = true)] - public bool PilotRequired { get; set; } + public bool? PilotRequired { get; set; } /// /// Gets or Sets Flags /// [DataMember(Name = "flags", EmitDefaultValue = true)] - public int Flags { get; set; } + public int? Flags { get; set; } /// /// Gets or Sets PierSide /// [DataMember(Name = "pier_side", EmitDefaultValue = true)] - public bool PierSide { get; set; } + public bool? PierSide { get; set; } /// /// Gets or Sets Bunkering /// [DataMember(Name = "bunkering", EmitDefaultValue = true)] - public bool Bunkering { get; set; } + public bool? Bunkering { get; set; } /// /// Gets or Sets ReplenishingTerminal /// [DataMember(Name = "replenishing_terminal", EmitDefaultValue = true)] - public bool ReplenishingTerminal { get; set; } + public bool? ReplenishingTerminal { get; set; } /// /// Gets or Sets ReplenishingLock /// [DataMember(Name = "replenishing_lock", EmitDefaultValue = true)] - public bool ReplenishingLock { get; set; } + public bool? ReplenishingLock { get; set; } /// /// Gets or Sets Draft /// [DataMember(Name = "draft", EmitDefaultValue = true)] - public float Draft { get; set; } + public float? Draft { get; set; } /// /// Gets or Sets TidalWindowFrom /// [DataMember(Name = "tidal_window_from", EmitDefaultValue = true)] - public DateTime TidalWindowFrom { get; set; } + public DateTime? TidalWindowFrom { get; set; } /// /// Gets or Sets TidalWindowTo /// [DataMember(Name = "tidal_window_to", EmitDefaultValue = true)] - public DateTime TidalWindowTo { get; set; } + public DateTime? TidalWindowTo { get; set; } /// /// Gets or Sets RainSensitiveCargo /// [DataMember(Name = "rain_sensitive_cargo", EmitDefaultValue = true)] - public bool RainSensitiveCargo { get; set; } + public bool? RainSensitiveCargo { get; set; } /// /// Gets or Sets RecommendedTugs /// [DataMember(Name = "recommended_tugs", EmitDefaultValue = true)] - public int RecommendedTugs { get; set; } + public int? RecommendedTugs { get; set; } /// /// Gets or Sets Anchored /// [DataMember(Name = "anchored", EmitDefaultValue = true)] - public bool Anchored { get; set; } + public bool? Anchored { get; set; } /// /// Gets or Sets MooredLock /// [DataMember(Name = "moored_lock", EmitDefaultValue = true)] - public bool MooredLock { get; set; } + public bool? MooredLock { get; set; } /// /// Gets or Sets Canceled /// [DataMember(Name = "canceled", EmitDefaultValue = true)] - public bool Canceled { get; set; } + public bool? Canceled { get; set; } /// /// Gets or Sets Evaluation /// [DataMember(Name = "evaluation", EmitDefaultValue = true)] - public int Evaluation { get; set; } + public int? Evaluation { get; set; } /// /// Gets or Sets EvaluationMessage /// @@ -7403,15 +7311,17 @@ namespace BreCalClient.misc.Model [DataMember(Name = "participants", EmitDefaultValue = true)] public List Participants { get; set; } /// - /// Gets or Sets Created + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// - /// Gets or Sets Modified + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Returns the string presentation of the object /// @@ -7479,124 +7389,140 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ShipId == input.ShipId || this.ShipId.Equals(input.ShipId) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) - ) && + ) && ( this.Eta == input.Eta || (this.Eta != null && this.Eta.Equals(input.Eta)) - ) && + ) && ( this.Voyage == input.Voyage || (this.Voyage != null && this.Voyage.Equals(input.Voyage)) - ) && + ) && ( this.Etd == input.Etd || (this.Etd != null && this.Etd.Equals(input.Etd)) - ) && + ) && ( this.ArrivalBerthId == input.ArrivalBerthId || - this.ArrivalBerthId.Equals(input.ArrivalBerthId) - ) && + (this.ArrivalBerthId != null && + this.ArrivalBerthId.Equals(input.ArrivalBerthId)) + ) && ( this.DepartureBerthId == input.DepartureBerthId || - this.DepartureBerthId.Equals(input.DepartureBerthId) - ) && + (this.DepartureBerthId != null && + this.DepartureBerthId.Equals(input.DepartureBerthId)) + ) && ( this.TugRequired == input.TugRequired || - this.TugRequired.Equals(input.TugRequired) - ) && + (this.TugRequired != null && + this.TugRequired.Equals(input.TugRequired)) + ) && ( this.PilotRequired == input.PilotRequired || - this.PilotRequired.Equals(input.PilotRequired) - ) && + (this.PilotRequired != null && + this.PilotRequired.Equals(input.PilotRequired)) + ) && ( this.Flags == input.Flags || - this.Flags.Equals(input.Flags) - ) && + (this.Flags != null && + this.Flags.Equals(input.Flags)) + ) && ( this.PierSide == input.PierSide || - this.PierSide.Equals(input.PierSide) - ) && + (this.PierSide != null && + this.PierSide.Equals(input.PierSide)) + ) && ( this.Bunkering == input.Bunkering || - this.Bunkering.Equals(input.Bunkering) - ) && + (this.Bunkering != null && + this.Bunkering.Equals(input.Bunkering)) + ) && ( this.ReplenishingTerminal == input.ReplenishingTerminal || - this.ReplenishingTerminal.Equals(input.ReplenishingTerminal) - ) && + (this.ReplenishingTerminal != null && + this.ReplenishingTerminal.Equals(input.ReplenishingTerminal)) + ) && ( this.ReplenishingLock == input.ReplenishingLock || - this.ReplenishingLock.Equals(input.ReplenishingLock) - ) && + (this.ReplenishingLock != null && + this.ReplenishingLock.Equals(input.ReplenishingLock)) + ) && ( this.Draft == input.Draft || - this.Draft.Equals(input.Draft) - ) && + (this.Draft != null && + this.Draft.Equals(input.Draft)) + ) && ( this.TidalWindowFrom == input.TidalWindowFrom || (this.TidalWindowFrom != null && this.TidalWindowFrom.Equals(input.TidalWindowFrom)) - ) && + ) && ( this.TidalWindowTo == input.TidalWindowTo || (this.TidalWindowTo != null && this.TidalWindowTo.Equals(input.TidalWindowTo)) - ) && + ) && ( this.RainSensitiveCargo == input.RainSensitiveCargo || - this.RainSensitiveCargo.Equals(input.RainSensitiveCargo) - ) && + (this.RainSensitiveCargo != null && + this.RainSensitiveCargo.Equals(input.RainSensitiveCargo)) + ) && ( this.RecommendedTugs == input.RecommendedTugs || - this.RecommendedTugs.Equals(input.RecommendedTugs) - ) && + (this.RecommendedTugs != null && + this.RecommendedTugs.Equals(input.RecommendedTugs)) + ) && ( this.Anchored == input.Anchored || - this.Anchored.Equals(input.Anchored) - ) && + (this.Anchored != null && + this.Anchored.Equals(input.Anchored)) + ) && ( this.MooredLock == input.MooredLock || - this.MooredLock.Equals(input.MooredLock) - ) && + (this.MooredLock != null && + this.MooredLock.Equals(input.MooredLock)) + ) && ( this.Canceled == input.Canceled || - this.Canceled.Equals(input.Canceled) - ) && + (this.Canceled != null && + this.Canceled.Equals(input.Canceled)) + ) && ( this.Evaluation == input.Evaluation || - this.Evaluation.Equals(input.Evaluation) - ) && + (this.Evaluation != null && + this.Evaluation.Equals(input.Evaluation)) + ) && ( this.EvaluationMessage == input.EvaluationMessage || (this.EvaluationMessage != null && this.EvaluationMessage.Equals(input.EvaluationMessage)) - ) && + ) && ( this.Participants == input.Participants || this.Participants != null && input.Participants != null && this.Participants.SequenceEqual(input.Participants) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -7627,16 +7553,46 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Etd.GetHashCode(); } - hashCode = (hashCode * 59) + this.ArrivalBerthId.GetHashCode(); - hashCode = (hashCode * 59) + this.DepartureBerthId.GetHashCode(); - hashCode = (hashCode * 59) + this.TugRequired.GetHashCode(); - hashCode = (hashCode * 59) + this.PilotRequired.GetHashCode(); - hashCode = (hashCode * 59) + this.Flags.GetHashCode(); - hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); - hashCode = (hashCode * 59) + this.Bunkering.GetHashCode(); - hashCode = (hashCode * 59) + this.ReplenishingTerminal.GetHashCode(); - hashCode = (hashCode * 59) + this.ReplenishingLock.GetHashCode(); - hashCode = (hashCode * 59) + this.Draft.GetHashCode(); + if (this.ArrivalBerthId != null) + { + hashCode = (hashCode * 59) + this.ArrivalBerthId.GetHashCode(); + } + if (this.DepartureBerthId != null) + { + hashCode = (hashCode * 59) + this.DepartureBerthId.GetHashCode(); + } + if (this.TugRequired != null) + { + hashCode = (hashCode * 59) + this.TugRequired.GetHashCode(); + } + if (this.PilotRequired != null) + { + hashCode = (hashCode * 59) + this.PilotRequired.GetHashCode(); + } + if (this.Flags != null) + { + hashCode = (hashCode * 59) + this.Flags.GetHashCode(); + } + if (this.PierSide != null) + { + hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); + } + if (this.Bunkering != null) + { + hashCode = (hashCode * 59) + this.Bunkering.GetHashCode(); + } + if (this.ReplenishingTerminal != null) + { + hashCode = (hashCode * 59) + this.ReplenishingTerminal.GetHashCode(); + } + if (this.ReplenishingLock != null) + { + hashCode = (hashCode * 59) + this.ReplenishingLock.GetHashCode(); + } + if (this.Draft != null) + { + hashCode = (hashCode * 59) + this.Draft.GetHashCode(); + } if (this.TidalWindowFrom != null) { hashCode = (hashCode * 59) + this.TidalWindowFrom.GetHashCode(); @@ -7645,12 +7601,30 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.TidalWindowTo.GetHashCode(); } - hashCode = (hashCode * 59) + this.RainSensitiveCargo.GetHashCode(); - hashCode = (hashCode * 59) + this.RecommendedTugs.GetHashCode(); - hashCode = (hashCode * 59) + this.Anchored.GetHashCode(); - hashCode = (hashCode * 59) + this.MooredLock.GetHashCode(); - hashCode = (hashCode * 59) + this.Canceled.GetHashCode(); - hashCode = (hashCode * 59) + this.Evaluation.GetHashCode(); + if (this.RainSensitiveCargo != null) + { + hashCode = (hashCode * 59) + this.RainSensitiveCargo.GetHashCode(); + } + if (this.RecommendedTugs != null) + { + hashCode = (hashCode * 59) + this.RecommendedTugs.GetHashCode(); + } + if (this.Anchored != null) + { + hashCode = (hashCode * 59) + this.Anchored.GetHashCode(); + } + if (this.MooredLock != null) + { + hashCode = (hashCode * 59) + this.MooredLock.GetHashCode(); + } + if (this.Canceled != null) + { + hashCode = (hashCode * 59) + this.Canceled.GetHashCode(); + } + if (this.Evaluation != null) + { + hashCode = (hashCode * 59) + this.Evaluation.GetHashCode(); + } if (this.EvaluationMessage != null) { hashCode = (hashCode * 59) + this.EvaluationMessage.GetHashCode(); @@ -7754,25 +7728,25 @@ namespace BreCalClient.misc.Model /// /// id. /// etaBerth. - /// etaBerthFixed. + /// currently unused. /// etdBerth. - /// etdBerthFixed. + /// currently unused. /// lockTime. - /// lockTimeFixed. + /// currently unused. /// zoneEntry. - /// zoneEntryFixed. - /// operationsStart. - /// operationsEnd. + /// currently unused. + /// Start time for terminal operations. + /// End time for terminal operations. /// remarks. - /// shipcallId (required). - /// participantId (required). - /// berthId. + /// Reference to a shipcall id (required). + /// Reference to a participant id (required). + /// Reference to a berth id. /// berthInfo. /// pierSide. /// participantType. - /// created. - /// modified. - public Times(int id = default(int), DateTime etaBerth = default(DateTime), bool etaBerthFixed = default(bool), DateTime etdBerth = default(DateTime), bool etdBerthFixed = default(bool), DateTime lockTime = default(DateTime), bool lockTimeFixed = default(bool), DateTime zoneEntry = default(DateTime), bool zoneEntryFixed = default(bool), DateTime operationsStart = default(DateTime), DateTime operationsEnd = default(DateTime), string remarks = default(string), int shipcallId = default(int), int participantId = default(int), int berthId = default(int), string berthInfo = default(string), bool pierSide = default(bool), ParticipantType2 participantType = default(ParticipantType2), DateTime created = default(DateTime), DateTime modified = default(DateTime)) + /// Readonly field set by the database. + /// Readonly field set by the database. + public Times(int id = default(int), DateTime? etaBerth = default(DateTime?), bool? etaBerthFixed = default(bool?), DateTime? etdBerth = default(DateTime?), bool? etdBerthFixed = default(bool?), DateTime? lockTime = default(DateTime?), bool? lockTimeFixed = default(bool?), DateTime? zoneEntry = default(DateTime?), bool? zoneEntryFixed = default(bool?), DateTime? operationsStart = default(DateTime?), DateTime? operationsEnd = default(DateTime?), string remarks = default(string), int shipcallId = default(int), int participantId = default(int), int? berthId = default(int?), string berthInfo = default(string), bool? pierSide = default(bool?), int participantType = default(int), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.ShipcallId = shipcallId; this.ParticipantId = participantId; @@ -7804,72 +7778,81 @@ namespace BreCalClient.misc.Model /// Gets or Sets EtaBerth /// [DataMember(Name = "eta_berth", EmitDefaultValue = true)] - public DateTime EtaBerth { get; set; } + public DateTime? EtaBerth { get; set; } /// - /// Gets or Sets EtaBerthFixed + /// currently unused /// + /// currently unused [DataMember(Name = "eta_berth_fixed", EmitDefaultValue = true)] - public bool EtaBerthFixed { get; set; } + public bool? EtaBerthFixed { get; set; } /// /// Gets or Sets EtdBerth /// [DataMember(Name = "etd_berth", EmitDefaultValue = true)] - public DateTime EtdBerth { get; set; } + public DateTime? EtdBerth { get; set; } /// - /// Gets or Sets EtdBerthFixed + /// currently unused /// + /// currently unused [DataMember(Name = "etd_berth_fixed", EmitDefaultValue = true)] - public bool EtdBerthFixed { get; set; } + public bool? EtdBerthFixed { get; set; } /// /// Gets or Sets LockTime /// [DataMember(Name = "lock_time", EmitDefaultValue = true)] - public DateTime LockTime { get; set; } + public DateTime? LockTime { get; set; } /// - /// Gets or Sets LockTimeFixed + /// currently unused /// + /// currently unused [DataMember(Name = "lock_time_fixed", EmitDefaultValue = true)] - public bool LockTimeFixed { get; set; } + public bool? LockTimeFixed { get; set; } /// /// Gets or Sets ZoneEntry /// [DataMember(Name = "zone_entry", EmitDefaultValue = true)] - public DateTime ZoneEntry { get; set; } + public DateTime? ZoneEntry { get; set; } /// - /// Gets or Sets ZoneEntryFixed + /// currently unused /// + /// currently unused [DataMember(Name = "zone_entry_fixed", EmitDefaultValue = true)] - public bool ZoneEntryFixed { get; set; } + public bool? ZoneEntryFixed { get; set; } /// - /// Gets or Sets OperationsStart + /// Start time for terminal operations /// + /// Start time for terminal operations [DataMember(Name = "operations_start", EmitDefaultValue = true)] - public DateTime OperationsStart { get; set; } + public DateTime? OperationsStart { get; set; } /// - /// Gets or Sets OperationsEnd + /// End time for terminal operations /// + /// End time for terminal operations [DataMember(Name = "operations_end", EmitDefaultValue = true)] - public DateTime OperationsEnd { get; set; } + public DateTime? OperationsEnd { get; set; } /// /// Gets or Sets Remarks /// [DataMember(Name = "remarks", EmitDefaultValue = true)] public string Remarks { get; set; } /// - /// Gets or Sets ShipcallId + /// Reference to a shipcall id /// + /// Reference to a shipcall id [DataMember(Name = "shipcall_id", IsRequired = true, EmitDefaultValue = true)] public int ShipcallId { get; set; } /// - /// Gets or Sets ParticipantId + /// Reference to a participant id /// + /// Reference to a participant id [DataMember(Name = "participant_id", IsRequired = true, EmitDefaultValue = true)] public int ParticipantId { get; set; } /// - /// Gets or Sets BerthId + /// Reference to a berth id /// + /// Reference to a berth id [DataMember(Name = "berth_id", EmitDefaultValue = true)] - public int BerthId { get; set; } + public int? BerthId { get; set; } /// /// Gets or Sets BerthInfo /// @@ -7879,22 +7862,24 @@ namespace BreCalClient.misc.Model /// Gets or Sets PierSide /// [DataMember(Name = "pier_side", EmitDefaultValue = true)] - public bool PierSide { get; set; } + public bool? PierSide { get; set; } /// /// Gets or Sets ParticipantType /// [DataMember(Name = "participant_type", EmitDefaultValue = true)] - public ParticipantType2 ParticipantType { get; set; } + public int ParticipantType { get; set; } /// - /// Gets or Sets Created + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// - /// Gets or Sets Modified + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Returns the string presentation of the object /// @@ -7954,93 +7939,98 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.EtaBerth == input.EtaBerth || (this.EtaBerth != null && this.EtaBerth.Equals(input.EtaBerth)) - ) && + ) && ( this.EtaBerthFixed == input.EtaBerthFixed || - this.EtaBerthFixed.Equals(input.EtaBerthFixed) - ) && + (this.EtaBerthFixed != null && + this.EtaBerthFixed.Equals(input.EtaBerthFixed)) + ) && ( this.EtdBerth == input.EtdBerth || (this.EtdBerth != null && this.EtdBerth.Equals(input.EtdBerth)) - ) && + ) && ( this.EtdBerthFixed == input.EtdBerthFixed || - this.EtdBerthFixed.Equals(input.EtdBerthFixed) - ) && + (this.EtdBerthFixed != null && + this.EtdBerthFixed.Equals(input.EtdBerthFixed)) + ) && ( this.LockTime == input.LockTime || (this.LockTime != null && this.LockTime.Equals(input.LockTime)) - ) && + ) && ( this.LockTimeFixed == input.LockTimeFixed || - this.LockTimeFixed.Equals(input.LockTimeFixed) - ) && + (this.LockTimeFixed != null && + this.LockTimeFixed.Equals(input.LockTimeFixed)) + ) && ( this.ZoneEntry == input.ZoneEntry || (this.ZoneEntry != null && this.ZoneEntry.Equals(input.ZoneEntry)) - ) && + ) && ( this.ZoneEntryFixed == input.ZoneEntryFixed || - this.ZoneEntryFixed.Equals(input.ZoneEntryFixed) - ) && + (this.ZoneEntryFixed != null && + this.ZoneEntryFixed.Equals(input.ZoneEntryFixed)) + ) && ( this.OperationsStart == input.OperationsStart || (this.OperationsStart != null && this.OperationsStart.Equals(input.OperationsStart)) - ) && + ) && ( this.OperationsEnd == input.OperationsEnd || (this.OperationsEnd != null && this.OperationsEnd.Equals(input.OperationsEnd)) - ) && + ) && ( this.Remarks == input.Remarks || (this.Remarks != null && this.Remarks.Equals(input.Remarks)) - ) && + ) && ( this.ShipcallId == input.ShipcallId || this.ShipcallId.Equals(input.ShipcallId) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.BerthId == input.BerthId || - this.BerthId.Equals(input.BerthId) - ) && + (this.BerthId != null && + this.BerthId.Equals(input.BerthId)) + ) && ( this.BerthInfo == input.BerthInfo || (this.BerthInfo != null && this.BerthInfo.Equals(input.BerthInfo)) - ) && + ) && ( this.PierSide == input.PierSide || - this.PierSide.Equals(input.PierSide) - ) && + (this.PierSide != null && + this.PierSide.Equals(input.PierSide)) + ) && ( this.ParticipantType == input.ParticipantType || - (this.ParticipantType != null && - this.ParticipantType.Equals(input.ParticipantType)) - ) && + this.ParticipantType.Equals(input.ParticipantType) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -8061,22 +8051,34 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.EtaBerth.GetHashCode(); } - hashCode = (hashCode * 59) + this.EtaBerthFixed.GetHashCode(); + if (this.EtaBerthFixed != null) + { + hashCode = (hashCode * 59) + this.EtaBerthFixed.GetHashCode(); + } if (this.EtdBerth != null) { hashCode = (hashCode * 59) + this.EtdBerth.GetHashCode(); } - hashCode = (hashCode * 59) + this.EtdBerthFixed.GetHashCode(); + if (this.EtdBerthFixed != null) + { + hashCode = (hashCode * 59) + this.EtdBerthFixed.GetHashCode(); + } if (this.LockTime != null) { hashCode = (hashCode * 59) + this.LockTime.GetHashCode(); } - hashCode = (hashCode * 59) + this.LockTimeFixed.GetHashCode(); + if (this.LockTimeFixed != null) + { + hashCode = (hashCode * 59) + this.LockTimeFixed.GetHashCode(); + } if (this.ZoneEntry != null) { hashCode = (hashCode * 59) + this.ZoneEntry.GetHashCode(); } - hashCode = (hashCode * 59) + this.ZoneEntryFixed.GetHashCode(); + if (this.ZoneEntryFixed != null) + { + hashCode = (hashCode * 59) + this.ZoneEntryFixed.GetHashCode(); + } if (this.OperationsStart != null) { hashCode = (hashCode * 59) + this.OperationsStart.GetHashCode(); @@ -8091,16 +8093,19 @@ namespace BreCalClient.misc.Model } hashCode = (hashCode * 59) + this.ShipcallId.GetHashCode(); hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - hashCode = (hashCode * 59) + this.BerthId.GetHashCode(); + if (this.BerthId != null) + { + hashCode = (hashCode * 59) + this.BerthId.GetHashCode(); + } if (this.BerthInfo != null) { hashCode = (hashCode * 59) + this.BerthInfo.GetHashCode(); } - hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); - if (this.ParticipantType != null) + if (this.PierSide != null) { - hashCode = (hashCode * 59) + this.ParticipantType.GetHashCode(); + hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); } + hashCode = (hashCode * 59) + this.ParticipantType.GetHashCode(); if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -8247,36 +8252,36 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.OldPassword == input.OldPassword || (this.OldPassword != null && this.OldPassword.Equals(input.OldPassword)) - ) && + ) && ( this.NewPassword == input.NewPassword || (this.NewPassword != null && this.NewPassword.Equals(input.NewPassword)) - ) && + ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) - ) && + ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) - ) && + ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) - ) && + ) && ( this.UserEmail == input.UserEmail || (this.UserEmail != null && diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 5c3ad92..980963a 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.0.0 x-stoplight: id: iucm9tq7jgu7j info: @@ -13,7 +13,6 @@ info: license: name: Use at your own risk url: 'https://www.bsmd.de/license' - summary: Bremen calling servers: - url: 'https://brecaldevel.bsmd-emswe.eu' description: Development server hosted on vcup @@ -395,10 +394,6 @@ components: type: integer shipcall: type: object - required: - - id - - ship_id - - type properties: id: $ref: '#/components/schemas/shipcallId' @@ -485,10 +480,16 @@ components: created: type: string format: date-time + description: Readonly field set by the database modified: type: string format: date-time nullable: true + description: Readonly field set by the database + required: + - id + - ship_id + - type shipcalls: type: array items: @@ -496,9 +497,6 @@ components: times: type: object description: 'the id parameter needs to be missing on POST and to be present on PUT (Update) calls, otherwise a 400 response will be generated' - required: - - shipcall_id - - participant_id properties: id: type: integer @@ -509,6 +507,7 @@ components: eta_berth_fixed: type: boolean nullable: true + description: currently unused etd_berth: type: string format: date-time @@ -516,6 +515,7 @@ components: etd_berth_fixed: type: boolean nullable: true + description: currently unused lock_time: type: string format: date-time @@ -523,6 +523,7 @@ components: lock_time_fixed: type: boolean nullable: true + description: currently unused zone_entry: type: string format: date-time @@ -530,25 +531,31 @@ components: zone_entry_fixed: type: boolean nullable: true + description: currently unused operations_start: type: string format: date-time nullable: true + description: Start time for terminal operations operations_end: type: string format: date-time nullable: true + description: End time for terminal operations remarks: type: string maxLength: 512 nullable: true shipcall_id: type: integer + description: Reference to a shipcall id participant_id: type: integer + description: Reference to a participant id berth_id: type: integer nullable: true + description: Reference to a berth id berth_info: type: string nullable: true @@ -556,14 +563,19 @@ components: type: boolean nullable: true participant_type: - $ref: '#/components/schemas/ParticipantType2' + type: integer created: type: string format: date-time + description: Readonly field set by the database modified: type: string format: date-time nullable: true + description: Readonly field set by the database + required: + - shipcall_id + - participant_id times_list: type: array items: @@ -670,10 +682,12 @@ components: created: type: string format: date-time + description: Readonly field set by the database modified: type: string format: date-time nullable: true + description: Readonly field set by the database participant: type: object description: A organisational entity that participates in Bremen Calling @@ -694,17 +708,19 @@ components: maxLength: 64 type: type: integer - description: a logical combinat + description: a logical combination (bitflag) of possible values. This cannot be encoded in a Enumeration type with discrete values in OpenAPI version < 3.1. The values are 1= flags: type: integer nullable: true created: type: string format: date-time + description: Readonly field set by the database modified: type: string format: date-time nullable: true + description: Readonly field set by the database deleted: type: boolean default: false @@ -788,52 +804,6 @@ components: - undefined - email - push - ParticipantType: - type: integer - enum: - - 1 - - 2 - - 4 - - 8 - - 16 - - 32 - - 64 - x-enumDescriptions: - '1': bsmd - '2': terminal - '4': pilot - '8': agency - '16': mooring - '32': port_authority - '64': tug - ParticipantType2: - title: ParticipantType2 - x-stoplight: - id: whw0m8x8dq6cg - type: integer - oneOf: - - const: 1 - title: bsmd - description: Bremen Schiffsmeldedienst - - const: 2 - title: terminal - description: Terminal - - const: 4 - title: pilot - description: Pilot - - const: 8 - title: agency - description: Agency - - const: 16 - title: mooring - description: Mooring - - const: 32 - title: port_authority - description: Port Authority - - const: 64 - title: tug - description: Tug - description: Enumeration that can take particular values securitySchemes: ApiKey: type: apiKey diff --git a/src/BreCalClient/Extensions.cs b/src/BreCalClient/Extensions.cs index 23611f1..e92bd4b 100644 --- a/src/BreCalClient/Extensions.cs +++ b/src/BreCalClient/Extensions.cs @@ -1,6 +1,6 @@ // Copyright (c) 2023 schick Informatik // Description: some helpers -// +// using BreCalClient.misc.Model; using System; @@ -11,7 +11,31 @@ namespace BreCalClient public static class Extensions { - #region Enum + #region Enum + + /// + /// Copied from models clunky I know + /// + [Flags] + public enum ParticipantType + { + [Description("not assigned")] + NONE = 0, + [Description("BSMD")] + BSMD = 1, + [Description("Terminal")] + TERMINAL = 2, + [Description("Lotsen")] + PILOT = 4, + [Description("Agentur")] + AGENCY = 8, + [Description("Festmacher")] + MOORING = 16, + [Description("Hafenamt")] + PORT_ADMINISTRATION = 32, + [Description("Schlepper")] + TUG = 64, + } /// /// Custom participant flags @@ -42,7 +66,7 @@ namespace BreCalClient public static bool IsFlagSet(this Participant participant, ParticipantFlag flag) { return (participant.Flags & (uint)flag) != 0; - } + } public static string Truncate(this string value, int maxLength) { diff --git a/src/BreCalClient/ShipcallControl.xaml.cs b/src/BreCalClient/ShipcallControl.xaml.cs index 5fdc40b..c897c5d 100644 --- a/src/BreCalClient/ShipcallControl.xaml.cs +++ b/src/BreCalClient/ShipcallControl.xaml.cs @@ -209,13 +209,13 @@ namespace BreCalClient // this.labelShipName.Content = this.ShipcallControlModel?.Ship?.Name; switch (this.ShipcallControlModel?.Shipcall?.Type) { - case 1: // incoming + case ShipcallType.Arrival: // incoming this.imageShipcallType.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalDevelClient;component/Resources/arrow_down_red.png")); break; - case 2: // outgoing + case ShipcallType.Departure: // outgoing this.imageShipcallType.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalDevelClient;component/Resources/arrow_up_blue.png")); break; - case 3: // shifting + case ShipcallType.Shifting: // shifting this.imageShipcallType.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalDevelClient;component/Resources/arrow_right_green.png")); break; default: @@ -274,11 +274,11 @@ namespace BreCalClient this.textBlockBerth.Text = this.ShipcallControlModel?.Berth; this.textBlockCallsign.Text = this.ShipcallControlModel?.Ship?.Callsign; - if (this.ShipcallControlModel?.Shipcall?.Type == 1) + if (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival) { this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta?.ToString("dd.MM. HH:mm"); } - if ((this.ShipcallControlModel?.Shipcall?.Type == 2) || (this.ShipcallControlModel?.Shipcall?.Type == 3)) + if ((this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Departure) || (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Shifting)) { this.labelETA.Text = "ETD"; this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Etd?.ToString("dd.MM. HH:mm"); @@ -290,7 +290,7 @@ namespace BreCalClient // rename labels if this is not an incoming // must be here because there may not be a times record for each participant (yet) - if (this.ShipcallControlModel?.Shipcall?.Type != 1) + if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival) { this.labelETAETDAgent.Content = "ETD"; this.labelETAETDMooring.Content = "ETD"; @@ -310,7 +310,7 @@ namespace BreCalClient this.labelAgencyETAETDValue.Content = agencyTimes.EtaBerth.HasValue ? agencyTimes.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; this.textBlockAgencyRemarks.Text = agencyTimes.Remarks; this.textBlockAgencyBerthRemarks.Text = agencyTimes.BerthInfo; - if (this.ShipcallControlModel?.Shipcall?.Type != 1) + if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival) { this.labelAgencyETAETDValue.Content = agencyTimes.EtdBerth.HasValue ? agencyTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; } @@ -330,7 +330,7 @@ namespace BreCalClient this.labelMooringETAETDValue.Content = mooringTimes.EtaBerth.HasValue ? mooringTimes.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; this.textBlockMooringRemarks.Text = mooringTimes.Remarks; - if (this.ShipcallControlModel?.Shipcall?.Type != 1) + if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival) { this.labelMooringETAETDValue.Content = mooringTimes.EtdBerth.HasValue ? mooringTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; } @@ -346,7 +346,7 @@ namespace BreCalClient { this.labelPortAuthorityETAETDValue.Content = portAuthorityTimes.EtaBerth.HasValue ? portAuthorityTimes.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; this.textBlockPortAuthorityRemarks.Text = portAuthorityTimes.Remarks; - if (this.ShipcallControlModel?.Shipcall?.Type != 1) + if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival) { this.labelPortAuthorityETAETDValue.Content = portAuthorityTimes.EtdBerth.HasValue ? portAuthorityTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; } @@ -362,7 +362,7 @@ namespace BreCalClient { this.labelPilotETAETDValue.Content = pilotTimes.EtaBerth.HasValue ? pilotTimes.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; this.textBlockPilotRemarks.Text = pilotTimes.Remarks; - if (this.ShipcallControlModel?.Shipcall?.Type != 1) + if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival) { this.labelPilotETAETDValue.Content = pilotTimes.EtdBerth.HasValue ? pilotTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; } @@ -378,7 +378,7 @@ namespace BreCalClient { this.labelTugETAETDValue.Content = tugTimes.EtaBerth.HasValue ? tugTimes.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; this.textBlockTugRemarks.Text = tugTimes.Remarks; - if (this.ShipcallControlModel?.Shipcall?.Type != 1) + if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival) { this.labelTugETAETDValue.Content = tugTimes.EtdBerth.HasValue ? tugTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; } @@ -395,7 +395,7 @@ namespace BreCalClient this.labelTerminalBerth.Content = this.ShipcallControlModel?.GetBerthText(terminalTimes); this.labelOperationsStart.Content = terminalTimes.OperationsStart.HasValue ? terminalTimes.OperationsStart.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; this.textBlockTerminalRemarks.Text = terminalTimes.Remarks; - if (this.ShipcallControlModel?.Shipcall?.Type != 1) + if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival) { this.labelOperationsStart.Content = terminalTimes.OperationsEnd.HasValue ? terminalTimes.OperationsEnd.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; } diff --git a/src/BreCalClient/ShipcallControlModel.cs b/src/BreCalClient/ShipcallControlModel.cs index bc6df14..52f056c 100644 --- a/src/BreCalClient/ShipcallControlModel.cs +++ b/src/BreCalClient/ShipcallControlModel.cs @@ -48,7 +48,7 @@ namespace BreCalClient public string? Berth { get; set; } - internal Dictionary AssignedParticipants { get; } = new(); + internal Dictionary AssignedParticipants { get; } = new(); public List Times { get; set; } = new(); @@ -56,7 +56,7 @@ namespace BreCalClient { get { - Times? agencyTimes = this.GetTimesForParticipantType(ParticipantType.AGENCY); + Times? agencyTimes = this.GetTimesForParticipantType(Extensions.ParticipantType.AGENCY); if((agencyTimes != null) && (agencyTimes.EtaBerth != null)) return agencyTimes.EtaBerth; return Shipcall?.Eta; @@ -96,8 +96,7 @@ namespace BreCalClient get { if (this.Shipcall == null) return ""; - Extensions.TypeEnum callType = (Extensions.TypeEnum) this.Shipcall.Type; - return string.Format("{0} {1}", callType, this.Ship?.Name); + return string.Format("{0} {1}", this.Shipcall.Type, this.Ship?.Name); } } @@ -112,12 +111,12 @@ namespace BreCalClient { foreach (ParticipantAssignment participantAssignment in Shipcall.Participants) { - AssignedParticipants[(ParticipantType)participantAssignment.Type] = participantAssignment; + AssignedParticipants[(Extensions.ParticipantType)participantAssignment.Type] = participantAssignment; } } } - internal Times? GetTimesForParticipantType(ParticipantType type) + internal Times? GetTimesForParticipantType(Extensions.ParticipantType type) { if (AssignedParticipants.ContainsKey(type)) { @@ -127,14 +126,14 @@ namespace BreCalClient if ((times.ParticipantId == participantId) && (times.ParticipantType == (int) type)) return times; } - if(type == ParticipantType.AGENCY) + if(type == Extensions.ParticipantType.AGENCY) { // if I am BSMD and no agency entry was found this means we are editing the agency entry - if(App.Participant.Type == (int) ParticipantType.BSMD) + if(App.Participant.Type == (int) Extensions.ParticipantType.BSMD) { foreach(Times times in this.Times) { - if ((times.ParticipantId == App.Participant.Id) && (times.ParticipantType == (int) ParticipantType.AGENCY)) + if ((times.ParticipantId == App.Participant.Id) && (times.ParticipantType == (int) Extensions.ParticipantType.AGENCY)) return times; } } @@ -166,7 +165,7 @@ namespace BreCalClient berthText = berth?.Name; } - if ((berthText == null) && (times.ParticipantType != ParticipantType.TERMINAL)) + if ((berthText == null) && (times.ParticipantType != (int) Extensions.ParticipantType.TERMINAL)) { if (this.Shipcall?.Type == ShipcallType.Arrival) { @@ -191,7 +190,7 @@ namespace BreCalClient /// API reference to PUT eidted times internal async void UpdateTimesAssignments(DefaultApi _api) { - foreach (ParticipantType participantType in this.AssignedParticipants.Keys) + foreach (Extensions.ParticipantType participantType in this.AssignedParticipants.Keys) { Times? times = this.GetTimesForParticipantType(participantType); if(times == null) continue; From 23a903997a2f0b45d37db6919273878f46d5007a Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Tue, 19 Dec 2023 08:10:49 +0100 Subject: [PATCH 04/34] now the code is compiling. Yaml file documented via description tags. --- misc/BreCalApi.cs | 157 ++++++++++++++---- misc/BreCalApi.yaml | 28 +++- src/BreCalClient/EditShipcallControl.xaml.cs | 4 +- src/BreCalClient/EditTimesControl.xaml.cs | 16 +- .../EditTimesTerminalControl.xaml.cs | 20 +-- src/BreCalClient/Extensions.cs | 6 +- src/BreCalClient/MainWindow.xaml.cs | 143 +++++++++------- src/BreCalClient/SearchFilterControl.xaml.cs | 8 +- src/BreCalClient/SearchFilterModel.cs | 2 +- src/BreCalClient/ShipcallControl.xaml.cs | 28 ++-- src/BreCalClient/ShipcallControlModel.cs | 6 +- 11 files changed, 275 insertions(+), 143 deletions(-) diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index a99de65..7d96edc 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// Generated REST API Client Code Generator v1.9.1.0 on 18.12.2023 18:02:05 +// Generated REST API Client Code Generator v1.9.1.0 on 19.12.2023 07:58:27 // Using the tool OpenAPI Generator v7.1.0 // //---------------------- @@ -5377,9 +5377,9 @@ namespace BreCalClient.misc.Model /// /// id. /// name. - /// ownerId. - /// authorityId. - /// varLock. + /// Optional reference to a participant (terminal). + /// Optional reference to a participant (port authority). + /// If true lock must be passed. /// created. /// modified. /// deleted (default to false). @@ -5405,18 +5405,21 @@ namespace BreCalClient.misc.Model [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } /// - /// Gets or Sets OwnerId + /// Optional reference to a participant (terminal) /// + /// Optional reference to a participant (terminal) [DataMember(Name = "owner_id", EmitDefaultValue = true)] public int? OwnerId { get; set; } /// - /// Gets or Sets AuthorityId + /// Optional reference to a participant (port authority) /// + /// Optional reference to a participant (port authority) [DataMember(Name = "authority_id", EmitDefaultValue = true)] public int? AuthorityId { get; set; } /// - /// Gets or Sets VarLock + /// If true lock must be passed /// + /// If true lock must be passed [DataMember(Name = "lock", EmitDefaultValue = true)] public bool? VarLock { get; set; } /// @@ -5829,6 +5832,46 @@ namespace BreCalClient.misc.Model } } +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Model +{ + /// + /// Defines EvaluationType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EvaluationType + { + /// + /// Enum Undefined for value: undefined + /// + [EnumMember(Value = "undefined")] + Undefined = 1, + /// + /// Enum Green for value: green + /// + [EnumMember(Value = "green")] + Green = 2, + /// + /// Enum Yellow for value: yellow + /// + [EnumMember(Value = "yellow")] + Yellow = 3, + /// + /// Enum Red for value: red + /// + [EnumMember(Value = "red")] + Red = 4 + } +} + /* * Bremen calling API * @@ -6812,12 +6855,12 @@ namespace BreCalClient.misc.Model /// name. /// imo. /// callsign. - /// participantId. + /// Optional reference to participant (tug role). /// length. /// width. /// isTug (default to false). /// bollardPull. - /// eni. + /// BSMD internal use. /// created. /// modified. /// deleted (default to false). @@ -6858,8 +6901,9 @@ namespace BreCalClient.misc.Model [DataMember(Name = "callsign", EmitDefaultValue = true)] public string Callsign { get; set; } /// - /// Gets or Sets ParticipantId + /// Optional reference to participant (tug role) /// + /// Optional reference to participant (tug role) [DataMember(Name = "participant_id", EmitDefaultValue = true)] public int? ParticipantId { get; set; } /// @@ -6883,8 +6927,9 @@ namespace BreCalClient.misc.Model [DataMember(Name = "bollard_pull", EmitDefaultValue = true)] public int? BollardPull { get; set; } /// - /// Gets or Sets Eni + /// BSMD internal use /// + /// BSMD internal use [DataMember(Name = "eni", EmitDefaultValue = true)] public int? Eni { get; set; } /// @@ -7118,6 +7163,11 @@ namespace BreCalClient.misc.Model [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public ShipcallType Type { get; set; } /// + /// Gets or Sets Evaluation + /// + [DataMember(Name = "evaluation", EmitDefaultValue = true)] + public EvaluationType? Evaluation { get; set; } + /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] @@ -7153,7 +7203,7 @@ namespace BreCalClient.misc.Model /// 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?), float? draft = default(float?), 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?), int? evaluation = default(int?), string evaluationMessage = default(string), 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?), float? draft = default(float?), 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), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.ShipId = shipId; @@ -7296,11 +7346,6 @@ namespace BreCalClient.misc.Model [DataMember(Name = "canceled", EmitDefaultValue = true)] public bool? Canceled { get; set; } /// - /// Gets or Sets Evaluation - /// - [DataMember(Name = "evaluation", EmitDefaultValue = true)] - public int? Evaluation { get; set; } - /// /// Gets or Sets EvaluationMessage /// [DataMember(Name = "evaluation_message", EmitDefaultValue = true)] @@ -7504,8 +7549,7 @@ namespace BreCalClient.misc.Model ) && ( this.Evaluation == input.Evaluation || - (this.Evaluation != null && - this.Evaluation.Equals(input.Evaluation)) + this.Evaluation.Equals(input.Evaluation) ) && ( this.EvaluationMessage == input.EvaluationMessage || @@ -7621,10 +7665,7 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Canceled.GetHashCode(); } - if (this.Evaluation != null) - { - hashCode = (hashCode * 59) + this.Evaluation.GetHashCode(); - } + hashCode = (hashCode * 59) + this.Evaluation.GetHashCode(); if (this.EvaluationMessage != null) { hashCode = (hashCode * 59) + this.EvaluationMessage.GetHashCode(); @@ -7656,6 +7697,11 @@ namespace BreCalClient.misc.Model { yield return new System.ComponentModel.DataAnnotations.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 break; } } @@ -7727,13 +7773,13 @@ namespace BreCalClient.misc.Model /// Initializes a new instance of the class. /// /// id. - /// etaBerth. + /// Arrival time at berth. /// currently unused. - /// etdBerth. + /// departure time from berth. /// currently unused. - /// lockTime. + /// arrival time at lock. /// currently unused. - /// zoneEntry. + /// currently unused. /// currently unused. /// Start time for terminal operations. /// End time for terminal operations. @@ -7741,8 +7787,8 @@ namespace BreCalClient.misc.Model /// Reference to a shipcall id (required). /// Reference to a participant id (required). /// Reference to a berth id. - /// berthInfo. - /// pierSide. + /// Additional info text for berth. + /// true if ship is rotated, false otherwise. /// participantType. /// Readonly field set by the database. /// Readonly field set by the database. @@ -7775,8 +7821,9 @@ namespace BreCalClient.misc.Model [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// - /// Gets or Sets EtaBerth + /// Arrival time at berth /// + /// Arrival time at berth [DataMember(Name = "eta_berth", EmitDefaultValue = true)] public DateTime? EtaBerth { get; set; } /// @@ -7786,8 +7833,9 @@ namespace BreCalClient.misc.Model [DataMember(Name = "eta_berth_fixed", EmitDefaultValue = true)] public bool? EtaBerthFixed { get; set; } /// - /// Gets or Sets EtdBerth + /// departure time from berth /// + /// departure time from berth [DataMember(Name = "etd_berth", EmitDefaultValue = true)] public DateTime? EtdBerth { get; set; } /// @@ -7797,8 +7845,9 @@ namespace BreCalClient.misc.Model [DataMember(Name = "etd_berth_fixed", EmitDefaultValue = true)] public bool? EtdBerthFixed { get; set; } /// - /// Gets or Sets LockTime + /// arrival time at lock /// + /// arrival time at lock [DataMember(Name = "lock_time", EmitDefaultValue = true)] public DateTime? LockTime { get; set; } /// @@ -7808,8 +7857,9 @@ namespace BreCalClient.misc.Model [DataMember(Name = "lock_time_fixed", EmitDefaultValue = true)] public bool? LockTimeFixed { get; set; } /// - /// Gets or Sets ZoneEntry + /// currently unused /// + /// currently unused [DataMember(Name = "zone_entry", EmitDefaultValue = true)] public DateTime? ZoneEntry { get; set; } /// @@ -7854,13 +7904,15 @@ namespace BreCalClient.misc.Model [DataMember(Name = "berth_id", EmitDefaultValue = true)] public int? BerthId { get; set; } /// - /// Gets or Sets BerthInfo + /// Additional info text for berth /// + /// Additional info text for berth [DataMember(Name = "berth_info", EmitDefaultValue = true)] public string BerthInfo { get; set; } /// - /// Gets or Sets PierSide + /// true if ship is rotated, false otherwise /// + /// true if ship is rotated, false otherwise [DataMember(Name = "pier_side", EmitDefaultValue = true)] public bool? PierSide { get; set; } /// @@ -8129,6 +8181,11 @@ namespace BreCalClient.misc.Model { yield return new System.ComponentModel.DataAnnotations.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 break; } } @@ -8332,6 +8389,36 @@ namespace BreCalClient.misc.Model /// Validation Result 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" }); + } + // 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" }); + } + // 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" }); + } + // 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" }); + } + // 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" }); + } + // 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 break; } } diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 980963a..7111d62 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -468,9 +468,10 @@ components: type: boolean nullable: true evaluation: - type: integer + $ref: '#/components/schemas/EvaluationType' nullable: true evaluation_message: + maxLength: 512 type: string nullable: true participants: @@ -504,6 +505,7 @@ components: type: string format: date-time nullable: true + description: Arrival time at berth eta_berth_fixed: type: boolean nullable: true @@ -512,6 +514,7 @@ components: type: string format: date-time nullable: true + description: departure time from berth etd_berth_fixed: type: boolean nullable: true @@ -520,6 +523,7 @@ components: type: string format: date-time nullable: true + description: arrival time at lock lock_time_fixed: type: boolean nullable: true @@ -528,6 +532,7 @@ components: type: string format: date-time nullable: true + description: currently unused zone_entry_fixed: type: boolean nullable: true @@ -559,7 +564,10 @@ components: berth_info: type: string nullable: true + maxLength: 512 + description: Additional info text for berth pier_side: + description: true if ship is rotated, false otherwise type: boolean nullable: true participant_type: @@ -592,12 +600,15 @@ components: owner_id: type: integer nullable: true + description: Optional reference to a participant (terminal) authority_id: type: integer nullable: true + description: Optional reference to a participant (port authority) lock: type: boolean nullable: true + description: If true lock must be passed created: type: string format: date-time @@ -631,6 +642,7 @@ components: participant_id: type: integer nullable: true + description: Optional reference to participant (tug role) length: type: number format: float @@ -648,6 +660,7 @@ components: eni: type: integer nullable: true + description: BSMD internal use created: type: string format: date-time @@ -760,19 +773,25 @@ components: old_password: type: string nullable: true + maxLength: 128 new_password: type: string nullable: true + maxLength: 128 first_name: type: string nullable: true + maxLength: 45 last_name: type: string nullable: true + maxLength: 45 user_phone: + maxLength: 128 type: string nullable: true user_email: + maxLength: 128 type: string nullable: true Id: @@ -804,6 +823,13 @@ components: - undefined - email - push + EvaluationType: + type: string + enum: + - undefined + - green + - yellow + - red securitySchemes: ApiKey: type: apiKey diff --git a/src/BreCalClient/EditShipcallControl.xaml.cs b/src/BreCalClient/EditShipcallControl.xaml.cs index 5c1043e..8d578e6 100644 --- a/src/BreCalClient/EditShipcallControl.xaml.cs +++ b/src/BreCalClient/EditShipcallControl.xaml.cs @@ -254,7 +254,7 @@ namespace BreCalClient if (this.ShipcallModel == null) return; if (this.ShipcallModel.Shipcall != null) { - this.comboBoxCategories.SelectedItem = (TypeEnum)this.ShipcallModel.Shipcall.Type; + this.comboBoxCategories.SelectedItem = this.ShipcallModel.Shipcall.Type; if (this.ShipcallModel.Shipcall.Eta != DateTime.MinValue) this.datePickerETA.Value = this.ShipcallModel.Shipcall.Eta; // this.textBoxVoyage.Text = this.ShipcallModel.Shipcall.Voyage; @@ -262,7 +262,7 @@ namespace BreCalClient this.comboBoxShip.SelectedValue = this.ShipcallModel.Shipcall.ShipId; this.checkBoxCancelled.IsChecked = this.ShipcallModel.Shipcall.Canceled ?? false; - if (this.ShipcallModel.Shipcall.Type != 3) // incoming, outgoing + if (this.ShipcallModel.Shipcall.Type != ShipcallType.Shifting) // incoming, outgoing { this.comboBoxArrivalBerth.SelectedValue = this.ShipcallModel.Shipcall.ArrivalBerthId; this.comboBoxDepartureBerth.SelectedValue = this.ShipcallModel.Shipcall.DepartureBerthId; diff --git a/src/BreCalClient/EditTimesControl.xaml.cs b/src/BreCalClient/EditTimesControl.xaml.cs index 3a8163c..4beaade 100644 --- a/src/BreCalClient/EditTimesControl.xaml.cs +++ b/src/BreCalClient/EditTimesControl.xaml.cs @@ -89,7 +89,7 @@ namespace BreCalClient private void EnableControls() { - Extensions.ParticipantType pType = (Extensions.ParticipantType) (this.Times.ParticipantType ?? 0); + Extensions.ParticipantType pType = (Extensions.ParticipantType) this.Times.ParticipantType; if (this.Times.ParticipantId != App.Participant.Id) return; // if this is not "my" entry, there is no editing! switch (pType) @@ -97,24 +97,24 @@ namespace BreCalClient case Extensions.ParticipantType.MOORING: case Extensions.ParticipantType.PORT_ADMINISTRATION: case Extensions.ParticipantType.TUG: - this.datePickerETABerth.IsEnabled = (CallType == Extensions.TypeEnum.Incoming); + this.datePickerETABerth.IsEnabled = (CallType == ShipcallType.Arrival); //this.checkBoxEtaBerthFixed.IsEnabled = (CallType == Extensions.TypeEnum.Incoming || CallType == Extensions.TypeEnum.Shifting); - this.datePickerETDBerth.IsEnabled = (CallType == Extensions.TypeEnum.Outgoing || CallType == Extensions.TypeEnum.Shifting); + this.datePickerETDBerth.IsEnabled = (CallType == ShipcallType.Departure || CallType == ShipcallType.Shifting); //this.checkBoxEtDBerthFixed.IsEnabled = (CallType == Extensions.TypeEnum.Outgoing || CallType == Extensions.TypeEnum.Shifting); - this.datePickerLockTime.IsEnabled = (CallType == Extensions.TypeEnum.Incoming || CallType == Extensions.TypeEnum.Shifting); + this.datePickerLockTime.IsEnabled = (CallType == ShipcallType.Arrival || CallType == ShipcallType.Shifting); //this.checkBoxLockTimeFixed.IsEnabled = (CallType == Extensions.TypeEnum.Incoming || CallType == Extensions.TypeEnum.Shifting); this.datePickerZoneEntry.IsEnabled = false; //this.checkBoxZoneEntryFixed.IsEnabled = false; this.textBoxRemarks.IsEnabled = true; break; case Extensions.ParticipantType.PILOT: - this.datePickerETABerth.IsEnabled = (CallType == Extensions.TypeEnum.Incoming); + this.datePickerETABerth.IsEnabled = (CallType == ShipcallType.Arrival); //this.checkBoxEtaBerthFixed.IsEnabled = (CallType == Extensions.TypeEnum.Incoming || CallType == Extensions.TypeEnum.Shifting); - this.datePickerETDBerth.IsEnabled = (CallType == Extensions.TypeEnum.Outgoing || CallType == Extensions.TypeEnum.Shifting); + this.datePickerETDBerth.IsEnabled = (CallType == ShipcallType.Departure || CallType == ShipcallType.Shifting); //this.checkBoxEtDBerthFixed.IsEnabled = (CallType == Extensions.TypeEnum.Outgoing || CallType == Extensions.TypeEnum.Shifting); - this.datePickerLockTime.IsEnabled = (CallType == Extensions.TypeEnum.Incoming || CallType == Extensions.TypeEnum.Shifting); + this.datePickerLockTime.IsEnabled = (CallType == ShipcallType.Arrival || CallType == ShipcallType.Shifting); //this.checkBoxLockTimeFixed.IsEnabled = (CallType == Extensions.TypeEnum.Incoming || CallType == Extensions.TypeEnum.Shifting); - this.datePickerZoneEntry.IsEnabled = (CallType == Extensions.TypeEnum.Incoming); + this.datePickerZoneEntry.IsEnabled = (CallType == ShipcallType.Arrival); //this.checkBoxZoneEntryFixed.IsEnabled = (CallType == Extensions.TypeEnum.Incoming); this.textBoxRemarks.IsEnabled = true; break; diff --git a/src/BreCalClient/EditTimesTerminalControl.xaml.cs b/src/BreCalClient/EditTimesTerminalControl.xaml.cs index 5092a39..0bd6598 100644 --- a/src/BreCalClient/EditTimesTerminalControl.xaml.cs +++ b/src/BreCalClient/EditTimesTerminalControl.xaml.cs @@ -72,12 +72,12 @@ namespace BreCalClient private void CopyToModel() { - switch(this.comboBoxPierside.SelectedIndex) + this.Times.PierSide = this.comboBoxPierside.SelectedIndex switch { - case 0: this.Times.PierSide = true; break; - case 1: this.Times.PierSide= false; break; - default: this.Times.PierSide = null; break; - } + 0 => true, + 1 => false, + _ => null, + }; this.Times.OperationsStart = this.datePickerOperationStart.Value; this.Times.OperationsEnd = this.datePickerOperationEnd.Value; this.Times.BerthId = (this.comboBoxBerth.SelectedItem != null) ? ((Berth)this.comboBoxBerth.SelectedItem).Id : null; @@ -114,11 +114,11 @@ namespace BreCalClient { if (this.Times.ParticipantId != App.Participant.Id) return; - this.datePickerOperationStart.IsEnabled = (CallType == Extensions.TypeEnum.Incoming); - this.datePickerOperationEnd.IsEnabled = (CallType == Extensions.TypeEnum.Outgoing) || (CallType == Extensions.TypeEnum.Shifting); - this.comboBoxBerth.IsEnabled = (CallType == Extensions.TypeEnum.Incoming); - this.comboBoxPierside.IsEnabled = (CallType == Extensions.TypeEnum.Incoming); - this.textBoxBerthRemarks.IsEnabled = (CallType == Extensions.TypeEnum.Incoming); + this.datePickerOperationStart.IsEnabled = CallType == ShipcallType.Arrival; + this.datePickerOperationEnd.IsEnabled = (CallType == ShipcallType.Departure) || (CallType == ShipcallType.Shifting); + this.comboBoxBerth.IsEnabled = CallType == ShipcallType.Arrival; + this.comboBoxPierside.IsEnabled = CallType == ShipcallType.Arrival; + this.textBoxBerthRemarks.IsEnabled = CallType == ShipcallType.Arrival; this.textBoxRemarks.IsEnabled = true; this.buttonOK.IsEnabled = true; } diff --git a/src/BreCalClient/Extensions.cs b/src/BreCalClient/Extensions.cs index e92bd4b..1030478 100644 --- a/src/BreCalClient/Extensions.cs +++ b/src/BreCalClient/Extensions.cs @@ -71,15 +71,15 @@ namespace BreCalClient public static string Truncate(this string value, int maxLength) { if (string.IsNullOrEmpty(value)) return value; - return value.Length <= maxLength ? value : value.Substring(0, maxLength); + return value.Length <= maxLength ? value : value[..maxLength]; } public static string TruncateDots(this string value, int maxLength) { if(string.IsNullOrEmpty(value)) return value; if (value.Length <= maxLength) return value; - if (value.Length > (maxLength + 1)) return $"{value.Substring(0, maxLength)}.."; - return value.Substring(0, maxLength); + if (value.Length > (maxLength + 1)) return $"{value[..maxLength]}.."; + return value[..maxLength]; } #endregion diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index 8776e46..7bbb0a0 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -1,6 +1,6 @@ // Copyright (c) 2023 schick Informatik // Description: Bremen calling main window -// +// using System; using System.Collections.Generic; @@ -19,6 +19,7 @@ using static BreCalClient.Extensions; using System.Collections.Concurrent; using Newtonsoft.Json; using System.Security.Principal; +using System.Net; namespace BreCalClient { @@ -40,9 +41,13 @@ namespace BreCalClient private readonly ConcurrentDictionary _allShipcallsDict = new(); private readonly ConcurrentDictionary _allShipCallsControlDict = new(); - private readonly List _visibleControlModels = new(); + private readonly List _visibleControlModels = new(); + + private readonly ShipcallApi _shipcallApi; + private readonly UserApi _userApi; + private readonly TimesApi _timesApi; + private readonly StaticApi _staticApi; - private readonly DefaultApi _api; private CancellationTokenSource _tokenSource = new(); private LoginResult? _loginResult; private bool _refreshImmediately = false; @@ -72,8 +77,14 @@ namespace BreCalClient public MainWindow() { InitializeComponent(); - _api = new DefaultApi(Properties.Settings.Default.API_URL); - _api.Configuration.ApiKeyPrefix["Authorization"] = "Bearer"; + _userApi = new UserApi(Properties.Settings.Default.API_URL); + _userApi.Configuration.ApiKeyPrefix["Authorization"] = "Bearer"; + _shipcallApi = new ShipcallApi(Properties.Settings.Default.API_URL); + _shipcallApi.Configuration.ApiKeyPrefix["Authorization"] = "Bearer"; + _timesApi = new TimesApi(Properties.Settings.Default.API_URL); + _timesApi.Configuration.ApiKeyPrefix["Authorization"] = "Bearer"; + _staticApi = new StaticApi(Properties.Settings.Default.API_URL); + _staticApi.Configuration.ApiKeyPrefix["Authorization"] = "Bearer"; } #endregion @@ -86,14 +97,14 @@ namespace BreCalClient labelVersion.Text = "V. " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; if (!string.IsNullOrEmpty(Properties.Settings.Default.APP_TITLE)) this.Title = Properties.Settings.Default.APP_TITLE; - searchFilterControl.SearchFilterChanged += SearchFilterControl_SearchFilterChanged; + searchFilterControl.SearchFilterChanged += SearchFilterControl_SearchFilterChanged; searchFilterControl.LogoImageClicked += () => { - Process.Start("explorer", Properties.Settings.Default.LOGO_IMAGE_URL); + Process.Start("explorer", Properties.Settings.Default.LOGO_IMAGE_URL); }; this.comboBoxSortOrder.ItemsSource = Enum.GetValues(typeof(Extensions.SortOrder)); this.comboBoxSortOrder.SelectedIndex = (int)_sortOrder; - } + } private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { @@ -115,13 +126,16 @@ namespace BreCalClient try { - _loginResult = await _api.LoginPostAsync(_credentials); + _loginResult = await _userApi.LoginAsync(_credentials); if (_loginResult != null) { if (_loginResult.Id > 0) { this.busyIndicator.IsBusy = false; - this._api.Configuration.ApiKey["Authorization"] = _loginResult.Token; + this._userApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; + this._shipcallApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; + this._timesApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; + this._staticApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; this.LoadStaticLists(); this.labelUsername.Text = $"{_loginResult.FirstName} {_loginResult.LastName}"; _timer = new Timer(RefreshToken, null, 4000000, Timeout.Infinite); @@ -154,13 +168,16 @@ namespace BreCalClient { try { - _loginResult = _api.LoginPost(_credentials); + _loginResult = _userApi.Login(_credentials); if (_loginResult != null) { if (_loginResult.Id > 0) - { - this._api.Configuration.ApiKey["Authorization"] = _loginResult.Token; - } + { + this._userApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; + this._timesApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; + this._shipcallApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; + this._staticApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; + } } else { @@ -180,7 +197,7 @@ namespace BreCalClient private void buttonNew_Click(object sender, RoutedEventArgs e) { - NewWithModel(null); + NewWithModel(null); } private void NewWithModel(ShipcallControlModel? model) @@ -201,7 +218,7 @@ namespace BreCalClient esc.ShipcallModel.Shipcall?.Participants.Add(pa); try { - this._api.ShipcallsPost(esc.ShipcallModel.Shipcall); // save new ship call + this._shipcallApi.ShipcallCreate(esc.ShipcallModel.Shipcall); // save new ship call this.AddShipcall(esc.ShipcallModel); } catch (Exception ex) @@ -256,7 +273,7 @@ namespace BreCalClient }; try { - await _api.UserPutAsync(ud); + await _userApi.UserUpdateAsync(ud); MessageBox.Show(BreCalClient.Resources.Resources.textPasswordChanged, BreCalClient.Resources.Resources.textConfirmation, MessageBoxButton.OK, MessageBoxImage.Information); } catch (Exception ex) @@ -297,25 +314,25 @@ namespace BreCalClient this.UpdateUI(); } - #endregion + #endregion #region network operations private async void LoadStaticLists() { - BreCalLists.InitializeBerths(await _api.BerthsGetAsync()); - BreCalLists.InitializeShips(await _api.ShipsGetAsync()); - BreCalLists.InitializeParticipants(await _api.ParticipantsGetAsync()); + BreCalLists.InitializeBerths(await _staticApi.BerthsGetAsync()); + BreCalLists.InitializeShips(await _staticApi.ShipsGetAsync()); + BreCalLists.InitializeParticipants(await _staticApi.ParticipantsGetAsync()); this.searchFilterControl.SetBerths(BreCalLists.Berths); - + foreach (Participant participant in BreCalLists.Participants) - { + { if (_loginResult?.ParticipantId == participant.Id) { App.Participant = participant; EnableControlsForParticipant(); - } + } } this.searchFilterControl.SetAgencies(BreCalLists.Participants_Agent); @@ -328,7 +345,7 @@ namespace BreCalClient } _ = Task.Run(() => RefreshShipcalls()); - } + } public async Task RefreshShipcalls() { @@ -345,9 +362,9 @@ namespace BreCalClient try { if(this.searchPastDays != 0) - shipcalls = await _api.ShipcallsGetAsync(this.searchPastDays); + shipcalls = await _shipcallApi.ShipcallsGetAsync(this.searchPastDays); else - shipcalls = await _api.ShipcallsGetAsync(); + shipcalls = await _shipcallApi.ShipcallsGetAsync(); this.Dispatcher.Invoke(new Action(() => { @@ -356,7 +373,7 @@ namespace BreCalClient })); } catch (Exception ex) - { + { this.Dispatcher.Invoke(new Action(() => { labelGeneralStatus.Text = $"Connection {ConnectionStatus.FAILED}"; @@ -374,7 +391,7 @@ namespace BreCalClient foreach (Shipcall shipcall in shipcalls) { // load times for each shipcall - List currentTimes = await _api.TimesGetAsync(shipcall.Id); + List currentTimes = await _timesApi.TimesGetAsync(shipcall.Id); if(!_allShipcallsDict.ContainsKey(shipcall.Id)) { @@ -383,7 +400,7 @@ namespace BreCalClient { Shipcall = shipcall, Times = currentTimes - }; + }; this.AddShipcall(scm); } else @@ -392,8 +409,8 @@ namespace BreCalClient _allShipcallsDict[shipcall.Id].Shipcall = shipcall; _allShipcallsDict[shipcall.Id].Times = currentTimes; UpdateShipcall(_allShipcallsDict[shipcall.Id]); - } - } + } + } List existingIds = new(this._allShipcallsDict.Keys); @@ -429,7 +446,8 @@ namespace BreCalClient Shipcall shipcall = scm.Shipcall; if (BreCalLists.ShipLookupDict.ContainsKey(shipcall.ShipId)) scm.Ship = BreCalLists.ShipLookupDict[shipcall.ShipId].Ship; - if (shipcall.Type == 1) + + if (shipcall.Type == ShipcallType.Arrival) { if (BreCalLists.BerthLookupDict.ContainsKey(shipcall.ArrivalBerthId ?? 0)) scm.Berth = BreCalLists.BerthLookupDict[shipcall.ArrivalBerthId ?? 0].Name; @@ -446,7 +464,7 @@ namespace BreCalClient ShipcallControl sc = new() { Height = 120, - ShipcallControlModel = scm + ShipcallControlModel = scm }; sc.EditTimesRequested += Sc_EditTimesRequested; sc.EditRequested += Sc_EditRequested; @@ -454,7 +472,7 @@ namespace BreCalClient sc.RefreshData(); this._allShipCallsControlDict[scm.Shipcall.Id] = sc; }); - } + } private static void UpdateShipcall(ShipcallControlModel scm) { @@ -462,7 +480,8 @@ namespace BreCalClient Shipcall shipcall = scm.Shipcall; if (BreCalLists.ShipLookupDict.ContainsKey(shipcall.ShipId)) scm.Ship = BreCalLists.ShipLookupDict[shipcall.ShipId].Ship; - if (shipcall.Type == 1) + + if (shipcall.Type == ShipcallType.Arrival) { if (BreCalLists.BerthLookupDict.ContainsKey(shipcall.ArrivalBerthId ?? 0)) scm.Berth = BreCalLists.BerthLookupDict[shipcall.ArrivalBerthId ?? 0].Name; @@ -486,7 +505,7 @@ namespace BreCalClient _visibleControlModels.Remove(removeModel); this._allShipCallsControlDict.Remove(shipcallId, out _); - this._allShipcallsDict.Remove(shipcallId, out _); + this._allShipcallsDict.Remove(shipcallId, out _); } private void FilterShipcalls() @@ -530,12 +549,12 @@ namespace BreCalClient return !sfm.Agencies.Contains(agency.Id); } return true; - }); + }); } if(sfm.Categories.Count > 0 ) { - _ = this._visibleControlModels.RemoveAll(x => !sfm.Categories.Contains((x.Shipcall?.Type) ?? -1)); + _ = this._visibleControlModels.RemoveAll(x => { if (x.Shipcall == null) return false; else return !sfm.Categories.Contains(x.Shipcall.Type); }); } if(!string.IsNullOrEmpty(sfm.SearchString)) @@ -567,28 +586,28 @@ namespace BreCalClient { _ = this._visibleControlModels.RemoveAll(x => x.Shipcall?.Canceled ?? false); } - + switch(this._sortOrder) { case Extensions.SortOrder.SHIP_NAME: - this._visibleControlModels.Sort((x, y) => { if (x.Ship == null) return 0; if (y.Ship == null) return 0; return x.Ship.Name.CompareTo(y.Ship.Name); }); + this._visibleControlModels.Sort((x, y) => { if (x.Ship == null) return 0; if (y.Ship == null) return 0; return x.Ship.Name.CompareTo(y.Ship.Name); }); break; case Extensions.SortOrder.MODIFIED: this._visibleControlModels.Sort((x, y) => { if (x.Shipcall == null) return 0; if (y.Shipcall == null) return 0; return DateTime.Compare(x.Shipcall.Modified ?? x.Shipcall.Created, y.Shipcall.Modified ?? x.Shipcall.Created); }); break; case Extensions.SortOrder.ETA_ETD: this._visibleControlModels.Sort((x, y) => - { + { if (x.Shipcall == null) return 0; if (y.Shipcall == null) return 0; - DateTime xDate = (x.Shipcall.Type == (int) Extensions.TypeEnum.Incoming) ? x.Eta ?? DateTime.Now : x.Etd ?? DateTime.Now; - DateTime yDate = (y.Shipcall.Type == (int) Extensions.TypeEnum.Incoming) ? y.Eta ?? DateTime.Now : y.Etd ?? DateTime.Now; + DateTime xDate = (x.Shipcall.Type == ShipcallType.Arrival) ? x.Eta ?? DateTime.Now : x.Etd ?? DateTime.Now; + DateTime yDate = (y.Shipcall.Type == ShipcallType.Arrival) ? y.Eta ?? DateTime.Now : y.Etd ?? DateTime.Now; return DateTime.Compare(xDate, yDate); }); break; default: break; - } + } } @@ -633,7 +652,7 @@ namespace BreCalClient #region control event handler private async void Sc_EditRequested(ShipcallControl obj) - { + { if (obj.ShipcallControlModel != null) { EditShipcallControl esc = new() @@ -646,10 +665,10 @@ namespace BreCalClient try { obj.ShipcallControlModel.Shipcall?.Participants.Clear(); - obj.ShipcallControlModel.UpdateTimesAssignments(this._api); + obj.ShipcallControlModel.UpdateTimesAssignments(this._timesApi); foreach(ParticipantAssignment pa in obj.ShipcallControlModel.AssignedParticipants.Values) obj.ShipcallControlModel.Shipcall?.Participants.Add(pa); - await _api.ShipcallsPutAsync(obj.ShipcallControlModel.Shipcall); + await _shipcallApi.ShipcallUpdateAsync(obj.ShipcallControlModel.Shipcall); obj.RefreshData(); _refreshImmediately = true; _tokenSource.Cancel(); @@ -679,7 +698,7 @@ namespace BreCalClient if (times != null) { etc.Times = times; - wasEdit = true; + wasEdit = true; } else { @@ -698,7 +717,7 @@ namespace BreCalClient { if (wasEdit) { - await _api.TimesPutAsync(etc.Times); + await _timesApi.TimesUpdateAsync(etc.Times); } else { @@ -707,7 +726,7 @@ namespace BreCalClient { etc.Times.ShipcallId = obj.ShipcallControlModel.Shipcall.Id; } - Id apiResultId = await _api.TimesPostAsync(etc.Times); + Id apiResultId = await _timesApi.TimesCreateAsync(etc.Times); etc.Times.Id = apiResultId.VarId; obj.ShipcallControlModel?.Times.Add(etc.Times); } @@ -726,13 +745,13 @@ namespace BreCalClient IEditShipcallTimesControl? editControl = null; switch(sc.ShipcallControlModel?.Shipcall?.Type) { - case (int)TypeEnum.Incoming: + case ShipcallType.Arrival: editControl = new EditTimesAgencyIncomingControl(); break; - case (int)TypeEnum.Outgoing: + case ShipcallType.Departure: editControl = new EditTimesAgencyOutgoingControl(); break; - case (int)TypeEnum.Shifting: + case ShipcallType.Shifting: editControl = new EditTimesAgencyShiftingControl(); break; } @@ -745,7 +764,7 @@ namespace BreCalClient { editControl.Times = times; wasEdit = true; - } + } else { if(editControl.ShipcallModel.AssignedParticipants.ContainsKey(ParticipantType.AGENCY)) @@ -756,7 +775,7 @@ namespace BreCalClient { try { - sc.ShipcallControlModel?.UpdateTimesAssignments(_api); // if the agent changed the assignment of the participant to another + sc.ShipcallControlModel?.UpdateTimesAssignments(_timesApi); // if the agent changed the assignment of the participant to another // always try to be the agent, even if we are BSMD if (editControl.ShipcallModel.AssignedParticipants.ContainsKey(ParticipantType.AGENCY)) @@ -770,15 +789,15 @@ namespace BreCalClient if (wasEdit) { - await _api.TimesPutAsync(editControl.Times); + await _timesApi.TimesUpdateAsync(editControl.Times); } else - { + { if ((sc.ShipcallControlModel != null) && (sc.ShipcallControlModel.Shipcall != null)) { editControl.Times.ShipcallId = sc.ShipcallControlModel.Shipcall.Id; } - Id resultAPI_Id = await _api.TimesPostAsync(editControl.Times); + Id resultAPI_Id = await _timesApi.TimesCreateAsync(editControl.Times); editControl.Times.Id = resultAPI_Id.VarId; sc.ShipcallControlModel?.Times.Add(editControl.Times); @@ -786,7 +805,7 @@ namespace BreCalClient editControl.ShipcallModel.Shipcall?.Participants.Clear(); foreach (ParticipantAssignment pa in editControl.ShipcallModel.AssignedParticipants.Values) editControl.ShipcallModel.Shipcall?.Participants.Add(pa); - await _api.ShipcallsPutAsync(editControl.ShipcallModel.Shipcall); + await _shipcallApi.ShipcallUpdateAsync(editControl.ShipcallModel.Shipcall); _refreshImmediately = true; _tokenSource.Cancel(); } @@ -808,7 +827,7 @@ namespace BreCalClient Dispatcher.Invoke(new Action(() => { MessageBox.Show(message, caption, MessageBoxButton.OK, MessageBoxImage.Error); - })); + })); } private void EnableControlsForParticipant() @@ -816,7 +835,7 @@ namespace BreCalClient if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.BSMD)) this.buttonNew.Visibility = Visibility.Visible; } - + private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) { Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true }); diff --git a/src/BreCalClient/SearchFilterControl.xaml.cs b/src/BreCalClient/SearchFilterControl.xaml.cs index 11c6d65..44d4c7c 100644 --- a/src/BreCalClient/SearchFilterControl.xaml.cs +++ b/src/BreCalClient/SearchFilterControl.xaml.cs @@ -100,8 +100,8 @@ namespace BreCalClient } if(sfm.Categories != null) { - foreach(int category in sfm.Categories) - this.comboBoxCategories.SelectedItems.Add((Extensions.TypeEnum)category); + foreach(ShipcallType category in sfm.Categories) + this.comboBoxCategories.SelectedItems.Add(category); } if (sfm.SearchString != null) this.textBoxSearch.Text = sfm.SearchString; this.upDownShiplengthFrom.Value = sfm.ShipLengthFrom; @@ -124,7 +124,7 @@ namespace BreCalClient private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) { - this.comboBoxCategories.ItemsSource = Enum.GetValues(typeof(Extensions.TypeEnum)); + this.comboBoxCategories.ItemsSource = Enum.GetValues(typeof(ShipcallType)); } private void datePickerETAFrom_SelectedDateChanged(object sender, SelectionChangedEventArgs e) @@ -142,7 +142,7 @@ namespace BreCalClient private void comboBoxCategories_ItemSelectionChanged(object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e) { _model.Categories.Clear(); - foreach(int category in comboBoxCategories.SelectedItems) + foreach(ShipcallType category in comboBoxCategories.SelectedItems) _model.Categories.Add(category); SearchFilterChanged?.Invoke(); diff --git a/src/BreCalClient/SearchFilterModel.cs b/src/BreCalClient/SearchFilterModel.cs index af5e7d5..f642e84 100644 --- a/src/BreCalClient/SearchFilterModel.cs +++ b/src/BreCalClient/SearchFilterModel.cs @@ -19,7 +19,7 @@ namespace BreCalClient public DateTime? EtaTo { get; set; } - public List Categories { get; set; } = new(); + public List Categories { get; set; } = new(); public List Agencies { get; set; } = new(); diff --git a/src/BreCalClient/ShipcallControl.xaml.cs b/src/BreCalClient/ShipcallControl.xaml.cs index c897c5d..879232d 100644 --- a/src/BreCalClient/ShipcallControl.xaml.cs +++ b/src/BreCalClient/ShipcallControl.xaml.cs @@ -1,6 +1,6 @@ // Copyright (c) 2023 schick Informatik // Description: Show general shipcall info -// +// using BreCalClient.misc.Model; using log4net; @@ -44,7 +44,7 @@ namespace BreCalClient public event Action? EditAgencyRequested; - internal event Action? EditTimesRequested; + internal event Action? EditTimesRequested; #endregion @@ -53,7 +53,7 @@ namespace BreCalClient /// /// this is our datasource /// - public ShipcallControlModel? ShipcallControlModel { get; set; } + public ShipcallControlModel? ShipcallControlModel { get; set; } #endregion @@ -131,7 +131,7 @@ namespace BreCalClient { this.labelTerminal.FontWeight = FontWeights.Bold; this.labelTerminal.Foreground = Brushes.LightYellow; - } + } else { this.labelTerminal.FontWeight = FontWeights.Normal; @@ -274,7 +274,7 @@ namespace BreCalClient this.textBlockBerth.Text = this.ShipcallControlModel?.Berth; this.textBlockCallsign.Text = this.ShipcallControlModel?.Ship?.Callsign; - if (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival) + if (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival) { this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta?.ToString("dd.MM. HH:mm"); } @@ -287,7 +287,7 @@ namespace BreCalClient this.textBlockIMO.Text = this.ShipcallControlModel?.Ship?.Imo.ToString(); this.textBlockLengthWidth.Text = $"{this.ShipcallControlModel?.Ship?.Length} / {this.ShipcallControlModel?.Ship?.Width}"; - // rename labels if this is not an incoming + // rename labels if this is not an incoming // must be here because there may not be a times record for each participant (yet) if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival) @@ -301,7 +301,7 @@ namespace BreCalClient } if (this.ShipcallControlModel != null) - { + { Times? agencyTimes = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.AGENCY); if (agencyTimes != null) @@ -314,7 +314,7 @@ namespace BreCalClient { this.labelAgencyETAETDValue.Content = agencyTimes.EtdBerth.HasValue ? agencyTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -"; } - } + } else { // no agency times set (yet) @@ -408,7 +408,7 @@ namespace BreCalClient this.textBlockTerminalRemarks.Text = ""; this.textBlockTerminalBerthRemarks.Text = ""; } - + } this.DataContext = this.ShipcallControlModel; } @@ -432,7 +432,7 @@ namespace BreCalClient { if(App.Participant.IsTypeFlagSet(Extensions.ParticipantType.BSMD)) this.EditRequested?.Invoke(this); - } + } private void Image_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { @@ -440,10 +440,10 @@ namespace BreCalClient } private void labelAgent_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) - { + { Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.AGENCY); - this.EditAgencyRequested?.Invoke(this, times); - } + this.EditAgencyRequested?.Invoke(this, times); + } private void labelMooring_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { @@ -453,7 +453,7 @@ namespace BreCalClient private void labelPortAuthority_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { - Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PORT_ADMINISTRATION); + Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PORT_ADMINISTRATION); this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.PORT_ADMINISTRATION); } diff --git a/src/BreCalClient/ShipcallControlModel.cs b/src/BreCalClient/ShipcallControlModel.cs index 52f056c..4210c3d 100644 --- a/src/BreCalClient/ShipcallControlModel.cs +++ b/src/BreCalClient/ShipcallControlModel.cs @@ -188,7 +188,7 @@ namespace BreCalClient /// This function updates the assignments for existing times records accordingly and saves them. /// /// API reference to PUT eidted times - internal async void UpdateTimesAssignments(DefaultApi _api) + internal async void UpdateTimesAssignments(TimesApi api) { foreach (Extensions.ParticipantType participantType in this.AssignedParticipants.Keys) { @@ -197,7 +197,7 @@ namespace BreCalClient if(times.ParticipantId != this.AssignedParticipants[participantType].ParticipantId) { times.ParticipantId = this.AssignedParticipants[participantType].ParticipantId; - await _api.TimesPutAsync(times); + await api.TimesUpdateAsync(times); } } @@ -224,7 +224,7 @@ namespace BreCalClient foreach(Times times in deleteTimes) { - _api.TimesDelete(times.Id); + api.TimesDelete(times.Id); this.Times.Remove(times); } } From 3ae282102c4bde1b3f0631b471cb3512d429eee8 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Wed, 20 Dec 2023 10:45:43 +0100 Subject: [PATCH 05/34] All database changes in an update script. Devel database is already updated. --- misc/update_1.1_to_1.2.sql | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 misc/update_1.1_to_1.2.sql diff --git a/misc/update_1.1_to_1.2.sql b/misc/update_1.1_to_1.2.sql new file mode 100644 index 0000000..84d6516 --- /dev/null +++ b/misc/update_1.1_to_1.2.sql @@ -0,0 +1,51 @@ +-- add notification handling columns to shipcall +-- evaluation_time: Time when the "traffic light" was last changed +-- evaluation_notifications_sent: Flag to indicate if notifications were sent for the current evaluation + +ALTER TABLE `bremen_calling_devel`.`shipcall` +ADD COLUMN `evaluation_time` DATETIME NULL DEFAULT NULL AFTER `evaluation_message`, +ADD COLUMN `evaluation_notifications_sent` BIT NULL AFTER `evaluation_time`; + + + +-- prepare notification table for historic notification data +-- removed reference to participant and times and dropped unnecessary columns +-- added reference to shipcall + +ALTER TABLE `bremen_calling_devel`.`notification` +DROP FOREIGN KEY `FK_NOT_TIMES`, +DROP FOREIGN KEY `FK_NOT_PART`; +ALTER TABLE `bremen_calling_devel`.`notification` +DROP COLUMN `deleted`, +DROP COLUMN `acknowledged`, +DROP COLUMN `participant_id`, +DROP COLUMN `times_id`, +ADD COLUMN `shipcall_id` INT UNSIGNED NULL AFTER `id`, +ADD INDEX `FK_NOTIFICATION_SHIPCALL_idx` (`shipcall_id` ASC) VISIBLE, +DROP INDEX `FK_NOT_PART` , +DROP INDEX `FK_NOT_TIMES` ; +; +ALTER TABLE `bremen_calling_devel`.`notification` +ADD CONSTRAINT `FK_NOTIFICATION_SHIPCALL` + FOREIGN KEY (`shipcall_id`) + REFERENCES `bremen_calling_devel`.`shipcall` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION; + + +-- added notification flags +-- participant reference is now mandatory + +ALTER TABLE `bremen_calling_devel`.`user` +DROP FOREIGN KEY `FK_USER_PART`; +ALTER TABLE `bremen_calling_devel`.`user` +ADD COLUMN `notify_email` BIT NULL DEFAULT NULL AFTER `api_key`, +ADD COLUMN `notify_whatsapp` BIT NULL DEFAULT NULL AFTER `notify_email`, +ADD COLUMN `notify_signal` BIT NULL DEFAULT NULL AFTER `notify_whatsapp`, +ADD COLUMN `notifiy_popup` BIT NULL DEFAULT NULL AFTER `notify_signal`, +CHANGE COLUMN `participant_id` `participant_id` INT UNSIGNED NOT NULL ; +ALTER TABLE `bremen_calling_devel`.`user` +ADD CONSTRAINT `FK_USER_PART` + FOREIGN KEY (`participant_id`) + REFERENCES `bremen_calling_devel`.`participant` (`id`); + From ae9053bcaf7bf147c7d78c41f401bc76fb9df050 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Wed, 20 Dec 2023 18:06:41 +0100 Subject: [PATCH 06/34] Added POST and PUT endpoint for /ship --- src/server/BreCal/api/ships.py | 33 +++++++++++ src/server/BreCal/impl/ships.py | 95 ++++++++++++++++++++++++++++++ src/server/BreCal/local_db.py | 2 +- src/server/BreCal/schemas/model.py | 25 +++++++- 4 files changed, 151 insertions(+), 4 deletions(-) diff --git a/src/server/BreCal/api/ships.py b/src/server/BreCal/api/ships.py index f4cdfa8..284387d 100644 --- a/src/server/BreCal/api/ships.py +++ b/src/server/BreCal/api/ships.py @@ -1,7 +1,10 @@ from flask import Blueprint, request from .. import impl from ..services.auth_guard import auth_guard +from marshmallow import EXCLUDE +from ..schemas import model import json +import logging bp = Blueprint('ships', __name__) @@ -14,3 +17,33 @@ def GetShips(): return impl.ships.GetShips(token) else: return json.dumps("not authenticated"), 403 + + +@bp.route('/ships', methods=['post']) +@auth_guard() # no restriction by role +def PostShip(): + + try: + content = request.get_json(force=True) + loadedModel = model.ShipSchema().load(data=content, many=False, partial=True) + except Exception as ex: + logging.error(ex) + print(ex) + return json.dumps("bad format"), 400 + + return impl.ships.PostShip(loadedModel) + + +@bp.route('/ships', methods=['put']) +@auth_guard() # no restriction by role +def PutShip(): + + try: + content = request.get_json(force=True) + loadedModel = model.ShipSchema().load(data=content, many=False, partial=True, unknown=EXCLUDE) + except Exception as ex: + logging.error(ex) + print(ex) + return json.dumps("bad format"), 400 + + return impl.ships.PutShip(loadedModel) diff --git a/src/server/BreCal/impl/ships.py b/src/server/BreCal/impl/ships.py index 4288d7b..71858e5 100644 --- a/src/server/BreCal/impl/ships.py +++ b/src/server/BreCal/impl/ships.py @@ -31,3 +31,98 @@ def GetShips(token): +def PostShip(schemaModel): + """ + :param schemaModel: The deserialized model of the record to be inserted + """ + + # TODO: Validate the incoming data + + # This creates a *new* entry + try: + + pooledConnection = local_db.getPoolConnection() + commands = pydapper.using(pooledConnection) + + query = "INSERT INTO ship (" + isNotFirst = False + for key in schemaModel.keys(): + if key == "id": + continue + if key == "created": + continue + if key == "modified": + continue + if isNotFirst: + query += "," + isNotFirst = True + query += key + query += ") VALUES (" + isNotFirst = False + for key in schemaModel.keys(): + if key == "id": + continue + if key == "created": + continue + if key == "modified": + continue + if isNotFirst: + query += "," + isNotFirst = True + query += "?" + key + "?" + query += ")" + + commands.execute(query, schemaModel) + new_id = commands.execute_scalar("select last_insert_id()") + + pooledConnection.close() + + return json.dumps({"id" : new_id}), 201, {'Content-Type': 'application/json; charset=utf-8'} + + except Exception as ex: + logging.error(ex) + print(ex) + result = {} + result["message"] = "call failed" + return json.dumps(result), 500, {'Content-Type': 'application/json; charset=utf-8'} + + +def PutShip(schemaModel): + """ + :param schemaModel: The deserialized model of the record to be inserted + """ + + # This updates an *existing* entry + try: + + pooledConnection = local_db.getPoolConnection() + commands = pydapper.using(pooledConnection) + + query = "UPDATE ship SET " + isNotFirst = False + for key in schemaModel.keys(): + if key == "id": + continue + if key == "created": + continue + if key == "modified": + continue + if isNotFirst: + query += ", " + isNotFirst = True + query += key + " = ?" + key + "? " + + query += "WHERE id = ?id?" + + affected_rows = commands.execute(query, param=schemaModel) + + pooledConnection.close() + + return json.dumps({"id" : schemaModel["id"]}), 200, {'Content-Type': 'application/json; charset=utf-8'} + + except Exception as ex: + logging.error(ex) + print(ex) + result = {} + result["message"] = "call failed" + return json.dumps(result), 500, {'Content-Type': 'application/json; charset=utf-8'} diff --git a/src/server/BreCal/local_db.py b/src/server/BreCal/local_db.py index 85dff68..389b3be 100644 --- a/src/server/BreCal/local_db.py +++ b/src/server/BreCal/local_db.py @@ -11,7 +11,7 @@ def initPool(instancePath): try: global config_path if(config_path == None): - config_path = os.path.join(instancePath,'../../../secure/connection_data_devel.json'); + config_path = os.path.join(instancePath,'E:/temp/connection_data.json'); print (config_path) diff --git a/src/server/BreCal/schemas/model.py b/src/server/BreCal/schemas/model.py index 1cbdf21..20033f6 100644 --- a/src/server/BreCal/schemas/model.py +++ b/src/server/BreCal/schemas/model.py @@ -185,7 +185,6 @@ class UserSchema(Schema): @dataclass class Times: - id: int eta_berth: datetime eta_berth_fixed: bool @@ -223,7 +222,7 @@ class User: modified: datetime @dataclass -class Ship(Schema): +class Ship: id: int name: str imo: int @@ -233,11 +232,31 @@ class Ship(Schema): width: float is_tug: bool bollard_pull: int - eni: str + eni: int created: datetime modified: datetime deleted: bool + +class ShipSchema(Schema): + def __init__(self): + super().__init__(unknown=None) + pass + + id = fields.Int(Required=False) + name = fields.String(allow_none=False, metadata={'Required':True}) + imo = fields.Int(allow_none=False, metadata={'Required':True}) + callsign = fields.String(allow_none=True, metadata={'Required':False}) + participant_id = fields.Int(allow_none=True, metadata={'Required':False}) + length = fields.Float(allow_none=True, metadata={'Required':False}) + width = fields.Float(allow_none=True, metadata={'Required':False}) + is_tug = fields.Bool(allow_none=True, metadata={'Required':False}, default=False) + bollard_pull = fields.Int(allow_none=True, metadata={'Required':False}) + eni = fields.Int(allow_none=True, metadata={'Required':False}) + created = fields.DateTime(allow_none=True, metadata={'Required':False}) + modified = fields.DateTime(allow_none=True, metadata={'Required':False}) + deleted = fields.Int(allow_none=True, metadata={'Required':False}) + class TimesId(Schema): pass From 783f9f5089a01506f7680c9265dd2b05039b3e6f Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Wed, 20 Dec 2023 18:53:14 +0100 Subject: [PATCH 07/34] Added history table --- misc/update_1.1_to_1.2.sql | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/misc/update_1.1_to_1.2.sql b/misc/update_1.1_to_1.2.sql index 84d6516..198b144 100644 --- a/misc/update_1.1_to_1.2.sql +++ b/misc/update_1.1_to_1.2.sql @@ -49,3 +49,33 @@ ADD CONSTRAINT `FK_USER_PART` FOREIGN KEY (`participant_id`) REFERENCES `bremen_calling_devel`.`participant` (`id`); +-- History table for change tracking + +CREATE TABLE `bremen_calling_devel`.`history` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `participant_id` INT UNSIGNED NOT NULL, + `ship_id` INT UNSIGNED NOT NULL, + `timestamp` DATETIME NOT NULL COMMENT 'Time of saving', + `eta` DATETIME NOT NULL COMMENT 'Current ETA / ETD value (depends if shipcall or times were saved)', + `type` INT NOT NULL COMMENT 'shipcall or times', + `operation` INT NOT NULL COMMENT 'insert, update or delete', + PRIMARY KEY (`id`)) +COMMENT = 'This table stores a history of changes made to shipcalls so that everyone can see who changed what and when'; + +-- and foreign keys + +ALTER TABLE `bremen_calling_devel`.`history` +ADD INDEX `FK_HISTORY_PARTICIPANT_idx` (`participant_id` ASC) VISIBLE, +ADD INDEX `FK_HISTORY_SHIP_idx` (`ship_id` ASC) VISIBLE; +; +ALTER TABLE `bremen_calling_devel`.`history` +ADD CONSTRAINT `FK_HISTORY_PARTICIPANT` + FOREIGN KEY (`participant_id`) + REFERENCES `bremen_calling_devel`.`participant` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, +ADD CONSTRAINT `FK_HISTORY_SHIP` + FOREIGN KEY (`ship_id`) + REFERENCES `bremen_calling_devel`.`ship` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION; From a52cc27d69d00b4f20d36d9ed5880ba86347481f Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Thu, 21 Dec 2023 07:25:08 +0100 Subject: [PATCH 08/34] Fixed SQL and added endpoint for history data --- misc/update_1.1_to_1.2.sql | 10 ++++----- src/server/BreCal/__init__.py | 7 +++--- src/server/BreCal/api/history.py | 21 ++++++++++++++++++ src/server/BreCal/impl/__init__.py | 3 ++- src/server/BreCal/impl/berths.py | 2 -- src/server/BreCal/impl/history.py | 31 +++++++++++++++++++++++++++ src/server/BreCal/impl/participant.py | 1 - src/server/BreCal/impl/shipcalls.py | 2 -- src/server/BreCal/impl/ships.py | 2 -- src/server/BreCal/impl/times.py | 2 -- src/server/BreCal/schemas/model.py | 12 +++++++++++ 11 files changed, 75 insertions(+), 18 deletions(-) create mode 100644 src/server/BreCal/api/history.py create mode 100644 src/server/BreCal/impl/history.py diff --git a/misc/update_1.1_to_1.2.sql b/misc/update_1.1_to_1.2.sql index 198b144..75179b6 100644 --- a/misc/update_1.1_to_1.2.sql +++ b/misc/update_1.1_to_1.2.sql @@ -54,7 +54,7 @@ ADD CONSTRAINT `FK_USER_PART` CREATE TABLE `bremen_calling_devel`.`history` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `participant_id` INT UNSIGNED NOT NULL, - `ship_id` INT UNSIGNED NOT NULL, + `shipcall_id` INT UNSIGNED NOT NULL, `timestamp` DATETIME NOT NULL COMMENT 'Time of saving', `eta` DATETIME NOT NULL COMMENT 'Current ETA / ETD value (depends if shipcall or times were saved)', `type` INT NOT NULL COMMENT 'shipcall or times', @@ -66,7 +66,7 @@ COMMENT = 'This table stores a history of changes made to shipcalls so that ever ALTER TABLE `bremen_calling_devel`.`history` ADD INDEX `FK_HISTORY_PARTICIPANT_idx` (`participant_id` ASC) VISIBLE, -ADD INDEX `FK_HISTORY_SHIP_idx` (`ship_id` ASC) VISIBLE; +ADD INDEX `FK_HISTORY_SHIPCALL_idx` (`shipcall_id` ASC) VISIBLE; ; ALTER TABLE `bremen_calling_devel`.`history` ADD CONSTRAINT `FK_HISTORY_PARTICIPANT` @@ -74,8 +74,8 @@ ADD CONSTRAINT `FK_HISTORY_PARTICIPANT` REFERENCES `bremen_calling_devel`.`participant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, -ADD CONSTRAINT `FK_HISTORY_SHIP` - FOREIGN KEY (`ship_id`) - REFERENCES `bremen_calling_devel`.`ship` (`id`) +ADD CONSTRAINT `FK_HISTORY_SHIPCALL` + FOREIGN KEY (`shipcall_id`) + REFERENCES `bremen_calling_devel`.`shipcall` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; diff --git a/src/server/BreCal/__init__.py b/src/server/BreCal/__init__.py index 4ee4bbf..eb832f5 100644 --- a/src/server/BreCal/__init__.py +++ b/src/server/BreCal/__init__.py @@ -12,6 +12,7 @@ from .api import berths from .api import ships from .api import login from .api import user +from .api import history from BreCal.brecal_utils.file_handling import get_project_root, ensure_path from BreCal.brecal_utils.test_handling import execute_test_with_pytest, execute_coverage_test @@ -59,7 +60,7 @@ def create_app(test_config=None): app.register_blueprint(ships.bp) app.register_blueprint(login.bp) app.register_blueprint(user.bp) - + app.register_blueprint(history.bp) logging.basicConfig(filename='brecaldevel.log', level=logging.DEBUG, format='%(asctime)s | %(name)s | %(levelname)s | %(message)s') local_db.initPool(os.path.dirname(app.instance_path)) @@ -73,8 +74,8 @@ def create_app(test_config=None): return app __all__ = [ - "get_project_root", - "ensure_path", + "get_project_root", + "ensure_path", "execute_test_with_pytest", "execute_coverage_test", "difference_to_then", diff --git a/src/server/BreCal/api/history.py b/src/server/BreCal/api/history.py new file mode 100644 index 0000000..c1fe5ad --- /dev/null +++ b/src/server/BreCal/api/history.py @@ -0,0 +1,21 @@ +from flask import Blueprint, request +from .. import impl +from ..services.auth_guard import auth_guard +import json + +bp = Blueprint('history', __name__) + +@bp.route('/history', methods=['get']) +@auth_guard() # no restriction by role +def GetParticipant(): + + if 'Authorization' in request.headers: + token = request.headers.get('Authorization') + options = {} + if not 'shipcall_id' in request.args: + return json.dumps("missing parameter"), 400 + options["shipcall_id"] = request.args.get("shipcall_id") + return impl.history.GetHistory(options) + else: + return json.dumps("not authenticated"), 403 + diff --git a/src/server/BreCal/impl/__init__.py b/src/server/BreCal/impl/__init__.py index 4e1e218..93ec9fc 100644 --- a/src/server/BreCal/impl/__init__.py +++ b/src/server/BreCal/impl/__init__.py @@ -5,4 +5,5 @@ from . import shipcalls from . import times from . import ships from . import login -from . import user \ No newline at end of file +from . import user +from . import history \ No newline at end of file diff --git a/src/server/BreCal/impl/berths.py b/src/server/BreCal/impl/berths.py index d41025c..e6b8d32 100644 --- a/src/server/BreCal/impl/berths.py +++ b/src/server/BreCal/impl/berths.py @@ -10,8 +10,6 @@ def GetBerths(token): No parameters, gets all entries """ - # TODO: validate token - try: pooledConnection = local_db.getPoolConnection() commands = pydapper.using(pooledConnection) diff --git a/src/server/BreCal/impl/history.py b/src/server/BreCal/impl/history.py new file mode 100644 index 0000000..f3a10ff --- /dev/null +++ b/src/server/BreCal/impl/history.py @@ -0,0 +1,31 @@ +import json +import logging +import pydapper + +from ..schemas import model +from .. import local_db + +def GetHistory(options): + + """ + :param options: A dictionary containing all the paramters for the Operations + options["shipcall_id"]: **Id of shipcall**. + """ + + try: + pooledConnection = local_db.getPoolConnection() + commands = pydapper.using(pooledConnection) + if "shipcall_id" in options and options["shipcall_id"]: + data = commands.query("SELECT id, participant_id, shipcall_id, timestamp, eta, type, operation FROM history WHERE shipcall_id = ?shipcallid?", model=model.History, param={"shipcallid" : options["shipcall_id"]}) + + pooledConnection.close() + + except Exception as ex: + logging.error(ex) + print(ex) + result = {} + result["message"] = "call failed" + return json.dumps("call failed"), 500 + + return json.dumps(data, default=model.obj_dict), 200, {'Content-Type': 'application/json; charset=utf-8'} + diff --git a/src/server/BreCal/impl/participant.py b/src/server/BreCal/impl/participant.py index be1d7ec..05937d4 100644 --- a/src/server/BreCal/impl/participant.py +++ b/src/server/BreCal/impl/participant.py @@ -11,7 +11,6 @@ def GetParticipant(options): options["user_id"]: **Id of user**. *Example: 2*. User id returned by login call. """ - # TODO: validate token try: pooledConnection = local_db.getPoolConnection() diff --git a/src/server/BreCal/impl/shipcalls.py b/src/server/BreCal/impl/shipcalls.py index 452a8be..30f1c39 100644 --- a/src/server/BreCal/impl/shipcalls.py +++ b/src/server/BreCal/impl/shipcalls.py @@ -13,8 +13,6 @@ def GetShipcalls(options): No parameters, gets all entries """ - # TODO: validate token - try: pooledConnection = local_db.getPoolConnection() diff --git a/src/server/BreCal/impl/ships.py b/src/server/BreCal/impl/ships.py index 71858e5..66c46ec 100644 --- a/src/server/BreCal/impl/ships.py +++ b/src/server/BreCal/impl/ships.py @@ -10,8 +10,6 @@ def GetShips(token): No parameters, gets all entries """ - # TODO: validate token - try: pooledConnection = local_db.getPoolConnection() diff --git a/src/server/BreCal/impl/times.py b/src/server/BreCal/impl/times.py index 56e4c3f..718a522 100644 --- a/src/server/BreCal/impl/times.py +++ b/src/server/BreCal/impl/times.py @@ -14,8 +14,6 @@ def GetTimes(options): """ - # TODO: validate token - try: pooledConnection = local_db.getPoolConnection() diff --git a/src/server/BreCal/schemas/model.py b/src/server/BreCal/schemas/model.py index 20033f6..faaaac7 100644 --- a/src/server/BreCal/schemas/model.py +++ b/src/server/BreCal/schemas/model.py @@ -257,6 +257,18 @@ class ShipSchema(Schema): modified = fields.DateTime(allow_none=True, metadata={'Required':False}) deleted = fields.Int(allow_none=True, metadata={'Required':False}) + +@dataclass +class History(Schema): + id: int + participant_id: int + ship_id: int + timestamp: datetime + eta: datetime + type: int + operation: int + + class TimesId(Schema): pass From 01dda53425848817594a5c366ddd4c8bcfdf06c9 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Fri, 22 Dec 2023 09:39:21 +0100 Subject: [PATCH 09/34] Tried to create history endpoint but failed. Not working. --- misc/BreCalApi.yaml | 63 ++++++++++++++++++++++++++++- misc/update_1.1_to_1.2.sql | 8 +++- src/server/BreCal/impl/history.py | 10 ++++- src/server/BreCal/impl/shipcalls.py | 17 +++++++- src/server/BreCal/impl/times.py | 22 ++++++++++ src/server/BreCal/schemas/model.py | 47 +++++++++++++++------ 6 files changed, 149 insertions(+), 18 deletions(-) diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 7111d62..f1ac93f 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -362,6 +362,28 @@ paths: $ref: '#/components/responses/500' '503': $ref: '#/components/responses/503' + /history: + get: + description: This endpoint returns a list of changes made to the specific shipcall + summary: History data + tags: + - static + operationId: historyGet + responses: + '200': + description: list of history entries + content: + application/json: + schema: + $ref: '#/components/schemas/history_list' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' components: schemas: credentials: @@ -469,7 +491,6 @@ components: nullable: true evaluation: $ref: '#/components/schemas/EvaluationType' - nullable: true evaluation_message: maxLength: 512 type: string @@ -567,7 +588,7 @@ components: maxLength: 512 description: Additional info text for berth pier_side: - description: true if ship is rotated, false otherwise + description: 'true if ship is rotated, false otherwise' type: boolean nullable: true participant_type: @@ -675,6 +696,32 @@ components: type: array items: $ref: '#/components/schemas/ship' + history: + type: object + description: Single history entry with references + properties: + id: + type: integer + participant_id: + type: integer + shipcall_id: + type: integer + timestamp: + type: string + format: date-time + eta: + type: string + format: date-time + operation: + $ref: '#/components/schemas/OperationType' + type: + $ref: '#/components/schemas/ObjectType' + history_list: + type: array + items: + $ref: '#/components/schemas/history' + x-stoplight: + id: 93b5ff080c12a notification: type: object description: a notification created by the engine if a times entry violates a rule @@ -825,11 +872,23 @@ components: - push EvaluationType: type: string + nullable: true enum: - undefined - green - yellow - red + OperationType: + type: string + enum: + - insert + - update + - delete + ObjectType: + type: string + enum: + - times + - shipcall securitySchemes: ApiKey: type: apiKey diff --git a/misc/update_1.1_to_1.2.sql b/misc/update_1.1_to_1.2.sql index 75179b6..421281e 100644 --- a/misc/update_1.1_to_1.2.sql +++ b/misc/update_1.1_to_1.2.sql @@ -54,9 +54,10 @@ ADD CONSTRAINT `FK_USER_PART` CREATE TABLE `bremen_calling_devel`.`history` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `participant_id` INT UNSIGNED NOT NULL, + `user_id` INT UNSIGNED NOT NULL, `shipcall_id` INT UNSIGNED NOT NULL, `timestamp` DATETIME NOT NULL COMMENT 'Time of saving', - `eta` DATETIME NOT NULL COMMENT 'Current ETA / ETD value (depends if shipcall or times were saved)', + `eta` DATETIME NULL COMMENT 'Current ETA / ETD value (depends if shipcall or times were saved)', `type` INT NOT NULL COMMENT 'shipcall or times', `operation` INT NOT NULL COMMENT 'insert, update or delete', PRIMARY KEY (`id`)) @@ -78,4 +79,9 @@ ADD CONSTRAINT `FK_HISTORY_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `bremen_calling_devel`.`shipcall` (`id`) ON DELETE NO ACTION + ON UPDATE NO ACTION, +ADD CONSTRAINT `FK_HISTORY_USER` + FOREIGN KEY (`user_id`) + REFERENCES `bremen_calling_devel`.`user` (`id`) + ON DELETE NO ACTION ON UPDATE NO ACTION; diff --git a/src/server/BreCal/impl/history.py b/src/server/BreCal/impl/history.py index f3a10ff..522071e 100644 --- a/src/server/BreCal/impl/history.py +++ b/src/server/BreCal/impl/history.py @@ -3,6 +3,8 @@ import logging import pydapper from ..schemas import model +from ..schemas.model import History + from .. import local_db def GetHistory(options): @@ -15,8 +17,14 @@ def GetHistory(options): try: pooledConnection = local_db.getPoolConnection() commands = pydapper.using(pooledConnection) + h = History(1, 1, 1, "2020-01-01", "2020-01-01", model.ObjectType.shipcall, model.Operation.insert) + + if "shipcall_id" in options and options["shipcall_id"]: - data = commands.query("SELECT id, participant_id, shipcall_id, timestamp, eta, type, operation FROM history WHERE shipcall_id = ?shipcallid?", model=model.History, param={"shipcallid" : options["shipcall_id"]}) + data = commands.query("SELECT id, participant_id, shipcall_id, timestamp, eta, type, operation FROM history WHERE shipcall_id = ?shipcallid?", + model=History.from_query_row, + param={"shipcallid" : options["shipcall_id"]}) + pooledConnection.close() diff --git a/src/server/BreCal/impl/shipcalls.py b/src/server/BreCal/impl/shipcalls.py index 30f1c39..84cee79 100644 --- a/src/server/BreCal/impl/shipcalls.py +++ b/src/server/BreCal/impl/shipcalls.py @@ -5,6 +5,7 @@ import pydapper from ..schemas import model from .. import local_db +from ..services.auth_guard import check_jwt from BreCal.database.update_database import evaluate_shipcall_state @@ -107,7 +108,13 @@ def PostShipcalls(schemaModel): commands.execute(pquery, param={"shipcall_id" : new_id, "participant_id" : participant_assignment["participant_id"], "type" : participant_assignment["type"]}) # apply 'Traffic Light' evaluation to obtain 'GREEN', 'YELLOW' or 'RED' evaluation state. The function internally updates the mysql database - evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=new_id) # new_id (last insert id) refers to the shipcall id + # evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=new_id) # new_id (last insert id) refers to the shipcall id + + # save history data + # TODO: set ETA properly + user_data = check_jwt() + query = "INSERT INTO history (participant_id, shipcall_id, user_id, timestamp, eta, type, operation) VALUES (?pid?, ?scid?, ?uid?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1, 1)" + commands.execute_scalar(query, {"scid" : new_id, "pid" : user_data["participant_id"], "uid" : user_data["id"]}) pooledConnection.close() @@ -192,7 +199,13 @@ def PutShipcalls(schemaModel): commands.execute(dquery, param={"existing_id" : elem["id"]}) # apply 'Traffic Light' evaluation to obtain 'GREEN', 'YELLOW' or 'RED' evaluation state. The function internally updates the mysql database - evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=schemaModel["id"]) # schemaModel["id"] refers to the shipcall id + # evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=schemaModel["id"]) # schemaModel["id"] refers to the shipcall id + + # save history data + # TODO: set ETA properly + user_data = check_jwt() + query = "INSERT INTO history (participant_id, shipcall_id, user_id, timestamp, eta, type, operation) VALUES (?pid?, ?scid?, ?uid?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1, 2)" + commands.execute(query, {"scid" : schemaModel["id"], "pid" : user_data["participant_id"], "uid" : user_data["id"]}) pooledConnection.close() diff --git a/src/server/BreCal/impl/times.py b/src/server/BreCal/impl/times.py index 718a522..f7a3253 100644 --- a/src/server/BreCal/impl/times.py +++ b/src/server/BreCal/impl/times.py @@ -4,6 +4,7 @@ import pydapper from ..schemas import model from .. import local_db +from ..services.auth_guard import check_jwt from BreCal.database.update_database import evaluate_shipcall_state @@ -83,6 +84,12 @@ def PostTimes(schemaModel): # apply 'Traffic Light' evaluation to obtain 'GREEN', 'YELLOW' or 'RED' evaluation state. The function internally updates the mysql database 'shipcall' evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=schemaModel["shipcall_id"]) # every times data object refers to the 'shipcall_id' + # save history data + # TODO: set ETA properly + user_data = check_jwt() + query = "INSERT INTO history (participant_id, shipcall_id, user_id, timestamp, eta, type, operation) VALUES (?pid?, ?scid?, ?uid?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 2, 1)" + commands.execute_scalar(query, {"scid" : schemaModel["shipcall_id"], "pid" : user_data["participant_id"], "uid" : user_data["id"]}) + pooledConnection.close() return json.dumps({"id" : new_id}), 201, {'Content-Type': 'application/json; charset=utf-8'} @@ -128,6 +135,12 @@ def PutTimes(schemaModel): # apply 'Traffic Light' evaluation to obtain 'GREEN', 'YELLOW' or 'RED' evaluation state. The function internally updates the mysql database 'shipcall' evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=schemaModel["shipcall_id"]) # every times data object refers to the 'shipcall_id' + # save history data + # TODO: set ETA properly + user_data = check_jwt() + query = "INSERT INTO history (participant_id, shipcall_id, user_id, timestamp, eta, type, operation) VALUES (?pid?, ?scid?, ?uid?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 2, 2)" + commands.execute_scalar(query, {"scid" : schemaModel["shipcall_id"], "pid" : user_data["participant_id"], "uid" : user_data["id"]}) + pooledConnection.close() # if affected_rows == 1: # this doesn't work as expected @@ -154,6 +167,15 @@ def DeleteTimes(options): pooledConnection = local_db.getPoolConnection() commands = pydapper.using(pooledConnection) affected_rows = commands.execute("DELETE FROM times WHERE id = ?id?", param={"id" : options["id"]}) + + # TODO: howto get the shipcall id here? we will need to load the object first + # TODO: set ETA properly + + # save history data + user_data = check_jwt() + query = "INSERT INTO history (participant_id, shipcall_id, user_id, timestamp, eta, type, operation) VALUES (?pid?, 0, ?uid?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 2, 3)" + commands.execute_scalar(query, {"pid" : user_data["participant_id"], "uid" : user_data["id"]}) + pooledConnection.close() if affected_rows == 1: diff --git a/src/server/BreCal/schemas/model.py b/src/server/BreCal/schemas/model.py index faaaac7..e37b3f2 100644 --- a/src/server/BreCal/schemas/model.py +++ b/src/server/BreCal/schemas/model.py @@ -1,5 +1,7 @@ -from dataclasses import field +from dataclasses import field, dataclass from marshmallow import Schema, fields, INCLUDE, ValidationError +from marshmallow_enum import EnumField +from enum import Enum from marshmallow_dataclass import dataclass from typing import List @@ -23,6 +25,38 @@ class Berth(Schema): modified: datetime deleted: bool +class Operation(Enum): + insert = 1, + update = 2, + delete = 3 + +class ObjectType(Enum): + shipcall = 1, + times = 2 + +@dataclass +class History: + def __init__(self, id, participant_id, shipcall_id, timestamp, eta, type, operation): + self.id = id + self.participant_id = participant_id + self.shipcall_id = shipcall_id + self.timestamp = timestamp + self.eta = eta + self.type = type + self.operation = operation + pass + + id: int + participant_id: int + shipcall_id: int + timestamp: datetime + eta: datetime + type: EnumField(ObjectType) + operation: EnumField(Operation) + @classmethod + def from_query_row(self, id, participant_id, ship_id, timestamp, eta, type, operation): + return self(id, participant_id, ship_id, timestamp, eta, ObjectType(type), Operation(operation)) + class Error(Schema): message = fields.String(required=True) @@ -258,17 +292,6 @@ class ShipSchema(Schema): deleted = fields.Int(allow_none=True, metadata={'Required':False}) -@dataclass -class History(Schema): - id: int - participant_id: int - ship_id: int - timestamp: datetime - eta: datetime - type: int - operation: int - - class TimesId(Schema): pass From dd4ae7def8a8c29c2084658805e2b0f2effb8eb0 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Fri, 22 Dec 2023 12:43:16 +0100 Subject: [PATCH 10/34] fixed error, but enum values are still serialized as int --- .vscode/launch.json | 6 +++--- src/server/BreCal/impl/history.py | 4 ++-- src/server/BreCal/schemas/model.py | 24 +++++++++++++----------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index d7bcf51..4004ca9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,9 +15,9 @@ "SECRET_KEY" : "zdiTz8P3jXOc7jztIQAoelK4zztyuCpJ" // https://randomkeygen.com/ }, "args": [ - "run" //, -// "--no-debugger", - //"--no-reload" + "run", + // "--no-debugger", + "--no-reload" ], "jinja": true, "justMyCode": true diff --git a/src/server/BreCal/impl/history.py b/src/server/BreCal/impl/history.py index 522071e..f408001 100644 --- a/src/server/BreCal/impl/history.py +++ b/src/server/BreCal/impl/history.py @@ -1,6 +1,7 @@ import json import logging import pydapper +import pdb from ..schemas import model from ..schemas.model import History @@ -17,8 +18,6 @@ def GetHistory(options): try: pooledConnection = local_db.getPoolConnection() commands = pydapper.using(pooledConnection) - h = History(1, 1, 1, "2020-01-01", "2020-01-01", model.ObjectType.shipcall, model.Operation.insert) - if "shipcall_id" in options and options["shipcall_id"]: data = commands.query("SELECT id, participant_id, shipcall_id, timestamp, eta, type, operation FROM history WHERE shipcall_id = ?shipcallid?", @@ -29,6 +28,7 @@ def GetHistory(options): pooledConnection.close() except Exception as ex: + pdb.pm() logging.error(ex) print(ex) result = {} diff --git a/src/server/BreCal/schemas/model.py b/src/server/BreCal/schemas/model.py index e37b3f2..786b00f 100644 --- a/src/server/BreCal/schemas/model.py +++ b/src/server/BreCal/schemas/model.py @@ -1,7 +1,7 @@ from dataclasses import field, dataclass from marshmallow import Schema, fields, INCLUDE, ValidationError from marshmallow_enum import EnumField -from enum import Enum +from enum import IntEnum from marshmallow_dataclass import dataclass from typing import List @@ -25,14 +25,16 @@ class Berth(Schema): modified: datetime deleted: bool -class Operation(Enum): - insert = 1, - update = 2, - delete = 3 +class Operation(IntEnum): + UNDEFINED = 0 + INSERT = 1 + UPDATE = 2 + DELETE = 3 -class ObjectType(Enum): - shipcall = 1, - times = 2 +class ObjectType(IntEnum): + UNDEFINED = 0 + SHIPCALL = 1 + TIMES = 2 @dataclass class History: @@ -45,7 +47,7 @@ class History: self.type = type self.operation = operation pass - + id: int participant_id: int shipcall_id: int @@ -54,8 +56,8 @@ class History: type: EnumField(ObjectType) operation: EnumField(Operation) @classmethod - def from_query_row(self, id, participant_id, ship_id, timestamp, eta, type, operation): - return self(id, participant_id, ship_id, timestamp, eta, ObjectType(type), Operation(operation)) + def from_query_row(self, id, participant_id, shipcall_id, timestamp, eta, type, operation): + return self(id, participant_id, shipcall_id, timestamp, eta, ObjectType(type), Operation(operation)) class Error(Schema): message = fields.String(required=True) From 1ef74b51ba271bb18a0cc5adfc7ffeca4dc15435 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Wed, 27 Dec 2023 08:10:26 +0100 Subject: [PATCH 11/34] added ship delete and fixed schema loading error for shipclass --- src/server/BreCal/api/ships.py | 15 +++++++++++++++ src/server/BreCal/impl/ships.py | 29 +++++++++++++++++++++++++++++ src/server/BreCal/schemas/model.py | 6 +++++- 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/server/BreCal/api/ships.py b/src/server/BreCal/api/ships.py index 284387d..fcbbc7b 100644 --- a/src/server/BreCal/api/ships.py +++ b/src/server/BreCal/api/ships.py @@ -47,3 +47,18 @@ def PutShip(): return json.dumps("bad format"), 400 return impl.ships.PutShip(loadedModel) + + +@bp.route('/ships', methods=['delete']) +@auth_guard() # no restriction by role +def DeleteShip(): + + try: + content = request.get_json(force=True) + loadedModel = model.ShipSchema().load(data=content, many=False, partial=True, unknown=EXCLUDE) + except Exception as ex: + logging.error(ex) + print(ex) + return json.dumps("bad format"), 400 + + return impl.ships.DeleteShip(loadedModel) diff --git a/src/server/BreCal/impl/ships.py b/src/server/BreCal/impl/ships.py index 66c46ec..485a8e1 100644 --- a/src/server/BreCal/impl/ships.py +++ b/src/server/BreCal/impl/ships.py @@ -124,3 +124,32 @@ def PutShip(schemaModel): result = {} result["message"] = "call failed" return json.dumps(result), 500, {'Content-Type': 'application/json; charset=utf-8'} + + +def DeleteShip(options): + """ + :param options: A dictionary containing all the paramters for the Operations + options["id"] + + """ + try: + + pooledConnection = local_db.getPoolConnection() + commands = pydapper.using(pooledConnection) + affected_rows = commands.execute("UPDATE ship SET deleted = 1 WHERE id = ?id?", param={"id" : options["id"]}) + + pooledConnection.close() + + if affected_rows == 1: + return json.dumps({"id" : options["id"]}), 200, {'Content-Type': 'application/json; charset=utf-8'} + + result = {} + result["message"] = "no such record" + return json.dumps(result), 404, {'Content-Type': 'application/json; charset=utf-8'} + + except Exception as ex: + logging.error(ex) + print(ex) + result = {} + result["message"] = "call failed" + return json.dumps(result), 500, {'Content-Type': 'application/json; charset=utf-8'} \ No newline at end of file diff --git a/src/server/BreCal/schemas/model.py b/src/server/BreCal/schemas/model.py index 786b00f..beaca79 100644 --- a/src/server/BreCal/schemas/model.py +++ b/src/server/BreCal/schemas/model.py @@ -128,6 +128,8 @@ class ShipcallSchema(Schema): canceled = fields.Bool(Required = False, allow_none=True) evaluation = fields.Int(Required = False, allow_none=True) evaluation_message = fields.Str(allow_none=True, metadata={'Required':False}) # Solving: RemovedInMarshmallow4Warning: Passing field metadata as keyword arguments is deprecated. Use the explicit `metadata=...` argument instead. Additional metadata: {'Required': False} + evaluation_time = fields.DateTime(Required = False, allow_none=True) + evaluation_message_sent = fields.Bool(Required = False, allow_none=True) participants = fields.List(fields.Nested(ParticipantAssignmentSchema)) created = fields.DateTime(Required = False, allow_none=True) modified = fields.DateTime(Required = False, allow_none=True) @@ -140,7 +142,7 @@ class Participant_Assignment: pass participant_id: int - type: int + type: int # a variant would be to use the IntFlag type (with appropriate serialization) @dataclass class Shipcall: @@ -170,6 +172,8 @@ class Shipcall: canceled: bool evaluation: int evaluation_message: str + evaluation_time: datetime + evaluation_message_sent: bool created: datetime modified: datetime participants: List[Participant_Assignment] = field(default_factory=list) From c1d8b2e855c5eed1dfed0a525d84e44077a62dc9 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Wed, 27 Dec 2023 08:33:49 +0100 Subject: [PATCH 12/34] fixed notification endpoint to return real data for a shipcall --- misc/BreCalApi.cs | 534 ++++++++++++++++++++---- misc/BreCalApi.yaml | 17 +- src/server/BreCal/api/notifications.py | 6 +- src/server/BreCal/impl/notifications.py | 29 +- src/server/BreCal/schemas/model.py | 6 +- 5 files changed, 475 insertions(+), 117 deletions(-) diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 7d96edc..6fdeb2e 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// Generated REST API Client Code Generator v1.9.1.0 on 19.12.2023 07:58:27 +// Generated REST API Client Code Generator v1.9.1.0 on 27.12.2023 08:25:38 // Using the tool OpenAPI Generator v7.1.0 // //---------------------- @@ -736,17 +736,36 @@ namespace BreCalClient.misc.Api /// ApiResponse of List<Berth> ApiResponse> BerthsGetWithHttpInfo(int operationIndex = 0); /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// History data /// /// - /// List of notifications (tbd) + /// This endpoint returns a list of changes made to the specific shipcall /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. - /// Notification - Notification NotificationsGet(int participantId, int shipcallId, int operationIndex = 0); + /// List<History> + List HistoryGet(int operationIndex = 0); + /// + /// History data + /// + /// + /// This endpoint returns a list of changes made to the specific shipcall + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<History> + ApiResponse> HistoryGetWithHttpInfo(int operationIndex = 0); + /// + /// Gets a list of notifications pursuant to a specified participant and ship call + /// + /// + /// List of notifications (tbd) + /// + /// Thrown when fails to make API call + /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Index associated with the operation. + /// Notification + Notification NotificationsGet(int shipcallId, int operationIndex = 0); /// /// Gets a list of notifications pursuant to a specified participant and ship call /// @@ -754,11 +773,10 @@ namespace BreCalClient.misc.Api /// List of notifications (tbd) /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// ApiResponse of Notification - ApiResponse NotificationsGetWithHttpInfo(int participantId, int shipcallId, int operationIndex = 0); + ApiResponse NotificationsGetWithHttpInfo(int shipcallId, int operationIndex = 0); /// /// gets one or all participants /// @@ -832,18 +850,39 @@ namespace BreCalClient.misc.Api /// Task of ApiResponse (List<Berth>) System.Threading.Tasks.Task>> BerthsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// History data /// /// - /// List of notifications (tbd) + /// This endpoint returns a list of changes made to the specific shipcall /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of Notification - System.Threading.Tasks.Task NotificationsGetAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// Task of List<History> + System.Threading.Tasks.Task> HistoryGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// History data + /// + /// + /// This endpoint returns a list of changes made to the specific shipcall + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<History>) + System.Threading.Tasks.Task>> HistoryGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Gets a list of notifications pursuant to a specified participant and ship call + /// + /// + /// List of notifications (tbd) + /// + /// Thrown when fails to make API call + /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// 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)); /// /// Gets a list of notifications pursuant to a specified participant and ship call /// @@ -851,12 +890,11 @@ namespace BreCalClient.misc.Api /// List of notifications (tbd) /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Notification) - System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int participantId, 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(System.Threading.CancellationToken)); /// /// gets one or all participants /// @@ -1121,27 +1159,137 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call List of notifications (tbd) + /// History data This endpoint returns a list of changes made to the specific shipcall /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. - /// Notification - public Notification NotificationsGet(int participantId, int shipcallId, int operationIndex = 0) + /// List<History> + public List HistoryGet(int operationIndex = 0) { - BreCalClient.misc.Client.ApiResponse localVarResponse = NotificationsGetWithHttpInfo(participantId, shipcallId); + BreCalClient.misc.Client.ApiResponse> localVarResponse = HistoryGetWithHttpInfo(); return localVarResponse.Data; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call List of notifications (tbd) + /// History data This endpoint returns a list of changes made to the specific shipcall /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant - /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. - /// ApiResponse of Notification - public BreCalClient.misc.Client.ApiResponse NotificationsGetWithHttpInfo(int participantId, int shipcallId, int operationIndex = 0) + /// ApiResponse of List<History> + public BreCalClient.misc.Client.ApiResponse> HistoryGetWithHttpInfo(int operationIndex = 0) + { + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Operation = "StaticApi.HistoryGet"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = this.Client.Get>("/history", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("HistoryGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// History data This endpoint returns a list of changes made to the specific shipcall + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<History> + public async System.Threading.Tasks.Task> HistoryGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + BreCalClient.misc.Client.ApiResponse> localVarResponse = await HistoryGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + /// + /// History data This endpoint returns a list of changes made to the specific shipcall + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<History>) + public async System.Threading.Tasks.Task>> HistoryGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Operation = "StaticApi.HistoryGet"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/history", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("HistoryGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// Gets a list of notifications pursuant to a specified participant and ship call List of notifications (tbd) + /// + /// Thrown when fails to make API call + /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Index associated with the operation. + /// Notification + public Notification NotificationsGet(int shipcallId, int operationIndex = 0) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = NotificationsGetWithHttpInfo(shipcallId); + return localVarResponse.Data; + } + /// + /// Gets a list of notifications pursuant to a specified participant and ship call List of notifications (tbd) + /// + /// Thrown when fails to make API call + /// **Id of ship call**. *Example: 52*. Id given in ship call list + /// Index associated with the operation. + /// ApiResponse of Notification + public BreCalClient.misc.Client.ApiResponse NotificationsGetWithHttpInfo(int shipcallId, int operationIndex = 0) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -1160,7 +1308,6 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "participant_id", participantId)); localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); localVarRequestOptions.Operation = "StaticApi.NotificationsGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1185,26 +1332,24 @@ namespace BreCalClient.misc.Api /// Gets a list of notifications pursuant to a specified participant and ship call List of notifications (tbd) /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Notification - public async System.Threading.Tasks.Task NotificationsGetAsync(int participantId, 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(System.Threading.CancellationToken)) { - BreCalClient.misc.Client.ApiResponse localVarResponse = await NotificationsGetWithHttpInfoAsync(participantId, shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); + BreCalClient.misc.Client.ApiResponse localVarResponse = await NotificationsGetWithHttpInfoAsync(shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Gets a list of notifications pursuant to a specified participant and ship call List of notifications (tbd) /// /// Thrown when fails to make API call - /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Notification) - public async System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int participantId, 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(System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -1223,7 +1368,6 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "participant_id", participantId)); localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); localVarRequestOptions.Operation = "StaticApi.NotificationsGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -5872,6 +6016,193 @@ namespace BreCalClient.misc.Model } } +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Model +{ + /// + /// Single history entry with references + /// + [DataContract(Name = "history")] + public partial class History : IEquatable, IValidatableObject + { + /// + /// Gets or Sets Operation + /// + [DataMember(Name = "operation", EmitDefaultValue = true)] + public OperationType? Operation { get; set; } + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = true)] + public ObjectType? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// participantId. + /// shipcallId. + /// timestamp. + /// eta. + /// operation. + /// type. + public History(int id = default(int), int participantId = default(int), int shipcallId = default(int), DateTime timestamp = default(DateTime), DateTime eta = default(DateTime), OperationType? operation = default(OperationType?), ObjectType? type = default(ObjectType?)) + { + this.Id = id; + this.ParticipantId = participantId; + this.ShipcallId = shipcallId; + this.Timestamp = timestamp; + this.Eta = eta; + this.Operation = operation; + this.Type = type; + } + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = true)] + public int Id { get; set; } + /// + /// Gets or Sets ParticipantId + /// + [DataMember(Name = "participant_id", EmitDefaultValue = true)] + public int ParticipantId { get; set; } + /// + /// Gets or Sets ShipcallId + /// + [DataMember(Name = "shipcall_id", EmitDefaultValue = true)] + public int ShipcallId { get; set; } + /// + /// Gets or Sets Timestamp + /// + [DataMember(Name = "timestamp", EmitDefaultValue = true)] + public DateTime Timestamp { get; set; } + /// + /// Gets or Sets Eta + /// + [DataMember(Name = "eta", EmitDefaultValue = true)] + public DateTime Eta { get; set; } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class History {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" ParticipantId: ").Append(ParticipantId).Append("\n"); + sb.Append(" ShipcallId: ").Append(ShipcallId).Append("\n"); + sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); + sb.Append(" Eta: ").Append(Eta).Append("\n"); + sb.Append(" Operation: ").Append(Operation).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as History); + } + /// + /// Returns true if History instances are equal + /// + /// Instance of History to be compared + /// Boolean + public bool Equals(History input) + { + if (input == null) + { + return false; + } + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.ParticipantId == input.ParticipantId || + this.ParticipantId.Equals(input.ParticipantId) + ) && + ( + this.ShipcallId == input.ShipcallId || + this.ShipcallId.Equals(input.ShipcallId) + ) && + ( + this.Timestamp == input.Timestamp || + (this.Timestamp != null && + this.Timestamp.Equals(input.Timestamp)) + ) && + ( + this.Eta == input.Eta || + (this.Eta != null && + this.Eta.Equals(input.Eta)) + ) && + ( + this.Operation == input.Operation || + this.Operation.Equals(input.Operation) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); + } + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); + hashCode = (hashCode * 59) + this.ShipcallId.GetHashCode(); + if (this.Timestamp != null) + { + hashCode = (hashCode * 59) + this.Timestamp.GetHashCode(); + } + if (this.Eta != null) + { + hashCode = (hashCode * 59) + this.Eta.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Operation.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } +} + /* * Bremen calling API * @@ -6228,21 +6559,17 @@ namespace BreCalClient.misc.Model /// Initializes a new instance of the class. /// /// id. - /// timesId. - /// participantId. + /// shipcallId. /// notificationType. - /// timestamp. - /// acknowledged. + /// message. /// Readonly field set by the database. /// Readonly field set by the database. - public Notification(int id = default(int), int timesId = default(int), int participantId = default(int), NotificationType? notificationType = default(NotificationType?), DateTime timestamp = default(DateTime), bool acknowledged = default(bool), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) + public Notification(int id = default(int), int shipcallId = default(int), NotificationType? notificationType = default(NotificationType?), string message = default(string), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; - this.TimesId = timesId; - this.ParticipantId = participantId; + this.ShipcallId = shipcallId; this.NotificationType = notificationType; - this.Timestamp = timestamp; - this.Acknowledged = acknowledged; + this.Message = message; this.Created = created; this.Modified = modified; } @@ -6252,25 +6579,15 @@ namespace BreCalClient.misc.Model [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// - /// Gets or Sets TimesId + /// Gets or Sets ShipcallId /// - [DataMember(Name = "times_id", EmitDefaultValue = true)] - public int TimesId { get; set; } + [DataMember(Name = "shipcall_id", EmitDefaultValue = true)] + public int ShipcallId { get; set; } /// - /// Gets or Sets ParticipantId + /// Gets or Sets Message /// - [DataMember(Name = "participant_id", EmitDefaultValue = true)] - public int ParticipantId { get; set; } - /// - /// Gets or Sets Timestamp - /// - [DataMember(Name = "timestamp", EmitDefaultValue = true)] - public DateTime Timestamp { get; set; } - /// - /// Gets or Sets Acknowledged - /// - [DataMember(Name = "acknowledged", EmitDefaultValue = true)] - public bool Acknowledged { get; set; } + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } /// /// Readonly field set by the database /// @@ -6292,11 +6609,9 @@ namespace BreCalClient.misc.Model StringBuilder sb = new StringBuilder(); sb.Append("class Notification {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" TimesId: ").Append(TimesId).Append("\n"); - sb.Append(" ParticipantId: ").Append(ParticipantId).Append("\n"); + sb.Append(" ShipcallId: ").Append(ShipcallId).Append("\n"); sb.Append(" NotificationType: ").Append(NotificationType).Append("\n"); - sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); - sb.Append(" Acknowledged: ").Append(Acknowledged).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n"); sb.Append("}\n"); @@ -6336,25 +6651,17 @@ namespace BreCalClient.misc.Model this.Id.Equals(input.Id) ) && ( - this.TimesId == input.TimesId || - this.TimesId.Equals(input.TimesId) - ) && - ( - this.ParticipantId == input.ParticipantId || - this.ParticipantId.Equals(input.ParticipantId) + this.ShipcallId == input.ShipcallId || + this.ShipcallId.Equals(input.ShipcallId) ) && ( this.NotificationType == input.NotificationType || this.NotificationType.Equals(input.NotificationType) ) && ( - this.Timestamp == input.Timestamp || - (this.Timestamp != null && - this.Timestamp.Equals(input.Timestamp)) - ) && - ( - this.Acknowledged == input.Acknowledged || - this.Acknowledged.Equals(input.Acknowledged) + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) ) && ( this.Created == input.Created || @@ -6377,14 +6684,12 @@ namespace BreCalClient.misc.Model { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); - hashCode = (hashCode * 59) + this.TimesId.GetHashCode(); - hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); + hashCode = (hashCode * 59) + this.ShipcallId.GetHashCode(); hashCode = (hashCode * 59) + this.NotificationType.GetHashCode(); - if (this.Timestamp != null) + if (this.Message != null) { - hashCode = (hashCode * 59) + this.Timestamp.GetHashCode(); + hashCode = (hashCode * 59) + this.Message.GetHashCode(); } - hashCode = (hashCode * 59) + this.Acknowledged.GetHashCode(); if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -6443,6 +6748,71 @@ namespace BreCalClient.misc.Model } } +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Model +{ + /// + /// Defines ObjectType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ObjectType + { + /// + /// Enum Times for value: times + /// + [EnumMember(Value = "times")] + Times = 1, + /// + /// Enum Shipcall for value: shipcall + /// + [EnumMember(Value = "shipcall")] + Shipcall = 2 + } +} + +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.1.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Model +{ + /// + /// Defines OperationType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OperationType + { + /// + /// Enum Insert for value: insert + /// + [EnumMember(Value = "insert")] + Insert = 1, + /// + /// Enum Update for value: update + /// + [EnumMember(Value = "update")] + Update = 2, + /// + /// Enum Delete for value: delete + /// + [EnumMember(Value = "delete")] + Delete = 3 + } +} + /* * Bremen calling API * diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index f1ac93f..4f730c5 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -313,12 +313,6 @@ paths: - static operationId: notificationsGet parameters: - - name: participant_id - in: query - required: true - description: '**Id of participant**. *Example: 2*. Id returned through loading of participant' - schema: - type: integer - name: shipcall_id in: query required: true @@ -374,7 +368,7 @@ paths: description: list of history entries content: application/json: - schema: + schema: $ref: '#/components/schemas/history_list' '400': $ref: '#/components/responses/400' @@ -728,17 +722,12 @@ components: properties: id: type: integer - times_id: - type: integer - participant_id: + shipcall_id: type: integer notification_type: $ref: '#/components/schemas/NotificationType' - timestamp: + message: type: string - format: date-time - acknowledged: - type: boolean created: type: string format: date-time diff --git a/src/server/BreCal/api/notifications.py b/src/server/BreCal/api/notifications.py index 00dcf8d..48a2a44 100644 --- a/src/server/BreCal/api/notifications.py +++ b/src/server/BreCal/api/notifications.py @@ -10,12 +10,10 @@ bp = Blueprint('notifications', __name__) @bp.route('/notifications', methods=['get']) @auth_guard() # no restriction by role def GetNotifications(): - - if 'participant_id' in request.args: + if 'shipcall_id' in request.args: options = {} - options["participant_id"] = request.args.get("participant_id") options["shipcall_id"] = request.args.get("shipcall_id") return impl.notifications.GetNotifications(options) else: - logging.warning("attempt to load notifications without participant id") + logging.warning("attempt to load notifications without shipcall id") return json.dumps("missing argument"), 400 \ No newline at end of file diff --git a/src/server/BreCal/impl/notifications.py b/src/server/BreCal/impl/notifications.py index 1100230..9697b21 100644 --- a/src/server/BreCal/impl/notifications.py +++ b/src/server/BreCal/impl/notifications.py @@ -8,22 +8,25 @@ from .. import local_db def GetNotifications(options): """ :param options: A dictionary containing all the paramters for the Operations - options["participant_id"]: **Id of participant**. *Example: 2*. Id returned through loading of participant - options["shipcall_id"]: **Id of ship call**. *Example: 52*. Id given in ship call list + options["shipcall_id"]: **Id**. *Example: 42*. Id of referenced ship call. """ - # Implement your business logic here - # All the parameters are present in the options argument - - return json.dumps({ - "acknowledged": "", - "id": "", - "notification_type": "", - "participant_id": "", - "times_id": "", - "timestamp": "", - }), 200, {'Content-Type': 'application/json; charset=utf-8'} + try: + pooledConnection = local_db.getPoolConnection() + commands = pydapper.using(pooledConnection) + data = commands.query("SELECT id, shipcall_id, level, type, message, created, modified FROM notification " + + "WHERE shipcall_id = ?scid?", model=model.Notification, param={"scid" : options["shipcall_id"]}) + pooledConnection.close() + + except Exception as ex: + logging.error(ex) + print(ex) + result = {} + result["message"] = "call failed" + return json.dumps(result), 500, {'Content-Type': 'application/json; charset=utf-8'} + + return json.dumps(data, default=model.obj_dict), 200, {'Content-Type': 'application/json; charset=utf-8'} diff --git a/src/server/BreCal/schemas/model.py b/src/server/BreCal/schemas/model.py index beaca79..aec8866 100644 --- a/src/server/BreCal/schemas/model.py +++ b/src/server/BreCal/schemas/model.py @@ -67,11 +67,9 @@ class GetVerifyInlineResp(Schema): pass @dataclass -class Notification(Schema): - +class Notification: id: int - times_id: int - acknowledged: bool + shipcall_id: int level: int type: int message: str From 88d6a6a99499b2206d62a6e2343bde3c0b2ed6f2 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Fri, 12 Jan 2024 07:46:19 +0100 Subject: [PATCH 13/34] added simple comment --- misc/BreCalApi.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 4f730c5..c9d9da0 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.0 x-stoplight: - id: iucm9tq7jgu7j + id: mwv4y8vcnopwr info: - version: 1.1.0 + version: 1.2.0 title: Bremen calling API description: 'Administer DEBRE ship calls, times and notifications' termsOfService: 'https://www.bsmd.de/' @@ -407,6 +407,7 @@ components: participant_id: type: integer type: + description: 'Currently this is encoded as an integer, since in OpenAPI 3.0 there are no enumerations supported with discrete integer values like a bitwise flag array used here. Each bit corresponds to a role. Since a participant can have multiple roles, these bits are combined by OR. Individual values: 1: BSMD 2: TERMINAL, 4: PILOT, 8: AGENCY, 16: MOORING, 32: PORT_ADMINISTRATION, 64: TUG' type: integer shipcall: type: object From 106247527e67502cb4bc4b42f0e40a638faa984d Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sun, 14 Jan 2024 13:35:35 +0100 Subject: [PATCH 14/34] Added ship post/put/delete to API --- misc/BreCalApi.cs | 1277 +++++++++++++---- misc/BreCalApi.yaml | 74 +- src/BreCalClient/EditTimesControl.xaml.cs | 6 +- .../EditTimesTerminalControl.xaml.cs | 6 +- src/BreCalClient/MainWindow.xaml.cs | 15 +- 5 files changed, 1052 insertions(+), 326 deletions(-) diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 6fdeb2e..49e523b 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,8 +1,8 @@ //---------------------- // -// Generated REST API Client Code Generator v1.9.1.0 on 27.12.2023 08:25:38 -// Using the tool OpenAPI Generator v7.1.0 +// Generated REST API Client Code Generator v1.9.3.0 on 14.01.2024 13:10:51 +// Using the tool OpenAPI Generator v7.2.0 // //---------------------- @@ -46,14 +46,816 @@ using System.Web; * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Api { -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + #pragma warning disable CS8073 + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IShipApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete a ship (logically). + /// + /// + /// A ship can only be logically deleted, since it is possible to have been used in previous shipcalls. On logical delete, the ship can no longer be selected in a new ship call. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Id + Id ShipDelete(int id, int operationIndex = 0); + /// + /// Delete a ship (logically). + /// + /// + /// A ship can only be logically deleted, since it is possible to have been used in previous shipcalls. On logical delete, the ship can no longer be selected in a new ship call. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Id + ApiResponse ShipDeleteWithHttpInfo(int id, int operationIndex = 0); + /// + /// Update a ship entry + /// + /// + /// Updating a ship entry. Please do not modify the IMO number. In that case please add a new entry. + /// + /// Thrown when fails to make API call + /// Updated ship entry. The id parameter is **required**. + /// Index associated with the operation. + /// Id + Id ShipUpdate(Ship ship, int operationIndex = 0); + /// + /// Update a ship entry + /// + /// + /// Updating a ship entry. Please do not modify the IMO number. In that case please add a new entry. + /// + /// Thrown when fails to make API call + /// Updated ship entry. The id parameter is **required**. + /// Index associated with the operation. + /// ApiResponse of Id + ApiResponse ShipUpdateWithHttpInfo(Ship ship, int operationIndex = 0); + /// + /// create a new ship entry + /// + /// + /// adds a new non-existing ship to the database. The ships IMO number is the unique identifier. + /// + /// Thrown when fails to make API call + /// Ship details. **Do not** provide id parameter. + /// Index associated with the operation. + /// Id + Id ShipsCreate(Ship ship, int operationIndex = 0); + /// + /// create a new ship entry + /// + /// + /// adds a new non-existing ship to the database. The ships IMO number is the unique identifier. + /// + /// Thrown when fails to make API call + /// Ship details. **Do not** provide id parameter. + /// Index associated with the operation. + /// ApiResponse of Id + ApiResponse ShipsCreateWithHttpInfo(Ship ship, int operationIndex = 0); + /// + /// gets a list of ships + /// + /// + /// Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Ship> + List ShipsGet(int operationIndex = 0); + /// + /// gets a list of ships + /// + /// + /// Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Ship> + ApiResponse> ShipsGetWithHttpInfo(int operationIndex = 0); + #endregion Synchronous Operations + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IShipApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Delete a ship (logically). + /// + /// + /// A ship can only be logically deleted, since it is possible to have been used in previous shipcalls. On logical delete, the ship can no longer be selected in a new ship call. + /// + /// Thrown when fails to make API call + /// + /// 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)); + /// + /// Delete a ship (logically). + /// + /// + /// A ship can only be logically deleted, since it is possible to have been used in previous shipcalls. On logical delete, the ship can no longer be selected in a new ship call. + /// + /// Thrown when fails to make API call + /// + /// 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)); + /// + /// Update a ship entry + /// + /// + /// Updating a ship entry. Please do not modify the IMO number. In that case please add a new entry. + /// + /// Thrown when fails to make API call + /// Updated ship entry. The id parameter is **required**. + /// 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)); + /// + /// Update a ship entry + /// + /// + /// Updating a ship entry. Please do not modify the IMO number. In that case please add a new entry. + /// + /// Thrown when fails to make API call + /// Updated ship entry. The id parameter is **required**. + /// 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)); + /// + /// create a new ship entry + /// + /// + /// adds a new non-existing ship to the database. The ships IMO number is the unique identifier. + /// + /// Thrown when fails to make API call + /// Ship details. **Do not** provide id parameter. + /// 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)); + /// + /// create a new ship entry + /// + /// + /// adds a new non-existing ship to the database. The ships IMO number is the unique identifier. + /// + /// Thrown when fails to make API call + /// Ship details. **Do not** provide id parameter. + /// 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)); + /// + /// gets a list of ships + /// + /// + /// Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// 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)); + /// + /// gets a list of ships + /// + /// + /// Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// 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)); + #endregion Asynchronous Operations + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IShipApi : IShipApiSync, IShipApiAsync + { + } + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class ShipApi : IShipApi + { + private BreCalClient.misc.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + /// + /// Initializes a new instance of the class. + /// + /// + public ShipApi() : this((string)null) + { + } + /// + /// Initializes a new instance of the class. + /// + /// + public ShipApi(string basePath) + { + this.Configuration = BreCalClient.misc.Client.Configuration.MergeConfigurations( + BreCalClient.misc.Client.GlobalConfiguration.Instance, + new BreCalClient.misc.Client.Configuration { BasePath = basePath } + ); + this.Client = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public ShipApi(BreCalClient.misc.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + this.Configuration = BreCalClient.misc.Client.Configuration.MergeConfigurations( + BreCalClient.misc.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new BreCalClient.misc.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public ShipApi(BreCalClient.misc.Client.ISynchronousClient client, BreCalClient.misc.Client.IAsynchronousClient asyncClient, BreCalClient.misc.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = BreCalClient.misc.Client.Configuration.DefaultExceptionFactory; + } + /// + /// The client for accessing this underlying API asynchronously. + /// + public BreCalClient.misc.Client.IAsynchronousClient AsynchronousClient { get; set; } + /// + /// The client for accessing this underlying API synchronously. + /// + public BreCalClient.misc.Client.ISynchronousClient Client { get; set; } + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public BreCalClient.misc.Client.IReadableConfiguration Configuration { get; set; } + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public BreCalClient.misc.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + /// + /// Delete a ship (logically). A ship can only be logically deleted, since it is possible to have been used in previous shipcalls. On logical delete, the ship can no longer be selected in a new ship call. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Id + public Id ShipDelete(int id, int operationIndex = 0) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = ShipDeleteWithHttpInfo(id); + return localVarResponse.Data; + } + /// + /// Delete a ship (logically). A ship can only be logically deleted, since it is possible to have been used in previous shipcalls. On logical delete, the ship can no longer be selected in a new ship call. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Id + public BreCalClient.misc.Client.ApiResponse ShipDeleteWithHttpInfo(int id, int operationIndex = 0) + { + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "id", id)); + localVarRequestOptions.Operation = "ShipApi.ShipDelete"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = this.Client.Delete("/ships", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ShipDelete", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// Delete a ship (logically). A ship can only be logically deleted, since it is possible to have been used in previous shipcalls. On logical delete, the ship can no longer be selected in a new ship call. + /// + /// Thrown when fails to make API call + /// + /// 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)) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipDeleteWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + /// + /// Delete a ship (logically). A ship can only be logically deleted, since it is possible to have been used in previous shipcalls. On logical delete, the ship can no longer be selected in a new ship call. + /// + /// Thrown when fails to make API call + /// + /// 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)) + { + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "id", id)); + localVarRequestOptions.Operation = "ShipApi.ShipDelete"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/ships", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ShipDelete", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// Update a ship entry Updating a ship entry. Please do not modify the IMO number. In that case please add a new entry. + /// + /// Thrown when fails to make API call + /// Updated ship entry. The id parameter is **required**. + /// Index associated with the operation. + /// Id + public Id ShipUpdate(Ship ship, int operationIndex = 0) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = ShipUpdateWithHttpInfo(ship); + return localVarResponse.Data; + } + /// + /// Update a ship entry Updating a ship entry. Please do not modify the IMO number. In that case please add a new entry. + /// + /// Thrown when fails to make API call + /// Updated ship entry. The id parameter is **required**. + /// Index associated with the operation. + /// ApiResponse of Id + public BreCalClient.misc.Client.ApiResponse ShipUpdateWithHttpInfo(Ship ship, int operationIndex = 0) + { + // verify the required parameter 'ship' is set + if (ship == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'ship' when calling ShipApi->ShipUpdate"); + } + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + "application/json" + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Data = ship; + localVarRequestOptions.Operation = "ShipApi.ShipUpdate"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = this.Client.Put("/ships", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ShipUpdate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// Update a ship entry Updating a ship entry. Please do not modify the IMO number. In that case please add a new entry. + /// + /// Thrown when fails to make API call + /// Updated ship entry. The id parameter is **required**. + /// 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)) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipUpdateWithHttpInfoAsync(ship, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + /// + /// Update a ship entry Updating a ship entry. Please do not modify the IMO number. In that case please add a new entry. + /// + /// Thrown when fails to make API call + /// Updated ship entry. The id parameter is **required**. + /// 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)) + { + // verify the required parameter 'ship' is set + if (ship == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'ship' when calling ShipApi->ShipUpdate"); + } + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + "application/json" + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Data = ship; + localVarRequestOptions.Operation = "ShipApi.ShipUpdate"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/ships", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ShipUpdate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// create a new ship entry adds a new non-existing ship to the database. The ships IMO number is the unique identifier. + /// + /// Thrown when fails to make API call + /// Ship details. **Do not** provide id parameter. + /// Index associated with the operation. + /// Id + public Id ShipsCreate(Ship ship, int operationIndex = 0) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = ShipsCreateWithHttpInfo(ship); + return localVarResponse.Data; + } + /// + /// create a new ship entry adds a new non-existing ship to the database. The ships IMO number is the unique identifier. + /// + /// Thrown when fails to make API call + /// Ship details. **Do not** provide id parameter. + /// Index associated with the operation. + /// ApiResponse of Id + public BreCalClient.misc.Client.ApiResponse ShipsCreateWithHttpInfo(Ship ship, int operationIndex = 0) + { + // verify the required parameter 'ship' is set + if (ship == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'ship' when calling ShipApi->ShipsCreate"); + } + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + "application/json" + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Data = ship; + localVarRequestOptions.Operation = "ShipApi.ShipsCreate"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = this.Client.Post("/ships", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ShipsCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// create a new ship entry adds a new non-existing ship to the database. The ships IMO number is the unique identifier. + /// + /// Thrown when fails to make API call + /// Ship details. **Do not** provide id parameter. + /// 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)) + { + BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipsCreateWithHttpInfoAsync(ship, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + /// + /// create a new ship entry adds a new non-existing ship to the database. The ships IMO number is the unique identifier. + /// + /// Thrown when fails to make API call + /// Ship details. **Do not** provide id parameter. + /// 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)) + { + // verify the required parameter 'ship' is set + if (ship == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'ship' when calling ShipApi->ShipsCreate"); + } + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + "application/json" + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Data = ship; + localVarRequestOptions.Operation = "ShipApi.ShipsCreate"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/ships", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ShipsCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Ship> + public List ShipsGet(int operationIndex = 0) + { + BreCalClient.misc.Client.ApiResponse> localVarResponse = ShipsGetWithHttpInfo(); + return localVarResponse.Data; + } + /// + /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Ship> + public BreCalClient.misc.Client.ApiResponse> ShipsGetWithHttpInfo(int operationIndex = 0) + { + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Operation = "ShipApi.ShipsGet"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = this.Client.Get>("/ships", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ShipsGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// 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)) + { + BreCalClient.misc.Client.ApiResponse> localVarResponse = await ShipsGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + /// + /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls + /// + /// Thrown when fails to make API call + /// 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)) + { + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Operation = "ShipApi.ShipsGet"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/ships", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ShipsGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + } +} +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 1.2.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Api +{ /// /// Represents a collection of functions to interact with the API endpoints /// @@ -703,7 +1505,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -799,26 +1601,6 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// ApiResponse of List<Participant> ApiResponse> ParticipantsGetWithHttpInfo(int? userId = default(int?), int operationIndex = 0); - /// - /// gets a list of ships - /// - /// - /// Gets a list of ships including logically deleted ships to be used with shipcalls - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// List<Ship> - List ShipsGet(int operationIndex = 0); - /// - /// gets a list of ships - /// - /// - /// Gets a list of ships including logically deleted ships to be used with shipcalls - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// ApiResponse of List<Ship> - ApiResponse> ShipsGetWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } /// @@ -919,28 +1701,6 @@ namespace BreCalClient.misc.Api /// 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)); - /// - /// gets a list of ships - /// - /// - /// Gets a list of ships including logically deleted ships to be used with shipcalls - /// - /// Thrown when fails to make API call - /// 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)); - /// - /// gets a list of ships - /// - /// - /// Gets a list of ships including logically deleted ships to be used with shipcalls - /// - /// Thrown when fails to make API call - /// 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)); #endregion Asynchronous Operations } /// @@ -1512,118 +2272,6 @@ namespace BreCalClient.misc.Api } return localVarResponse; } - /// - /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// List<Ship> - public List ShipsGet(int operationIndex = 0) - { - BreCalClient.misc.Client.ApiResponse> localVarResponse = ShipsGetWithHttpInfo(); - return localVarResponse.Data; - } - /// - /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls - /// - /// Thrown when fails to make API call - /// Index associated with the operation. - /// ApiResponse of List<Ship> - public BreCalClient.misc.Client.ApiResponse> ShipsGetWithHttpInfo(int operationIndex = 0) - { - BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); - string[] _contentTypes = new string[] { - }; - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - localVarRequestOptions.Operation = "StaticApi.ShipsGet"; - localVarRequestOptions.OperationIndex = operationIndex; - // authentication (ApiKey) required - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); - } - // make the HTTP request - var localVarResponse = this.Client.Get>("/ships", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("ShipsGet", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - return localVarResponse; - } - /// - /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls - /// - /// Thrown when fails to make API call - /// 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)) - { - BreCalClient.misc.Client.ApiResponse> localVarResponse = await ShipsGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - /// - /// gets a list of ships Gets a list of ships including logically deleted ships to be used with shipcalls - /// - /// Thrown when fails to make API call - /// 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)) - { - BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); - string[] _contentTypes = new string[] { - }; - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - localVarRequestOptions.Operation = "StaticApi.ShipsGet"; - localVarRequestOptions.OperationIndex = operationIndex; - // authentication (ApiKey) required - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); - } - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/ships", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("ShipsGet", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - return localVarResponse; - } } } @@ -1632,7 +2280,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -2451,7 +3099,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -2936,7 +3584,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3672,7 +4320,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3732,7 +4380,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3872,7 +4520,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4090,7 +4738,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4231,7 +4879,7 @@ namespace BreCalClient.misc.Client /// /// Gets or sets the base path for API access. /// - public virtual string BasePath + public virtual string BasePath { get { return _basePath; } set { _basePath = value; } @@ -4549,7 +5197,7 @@ namespace BreCalClient.misc.Client string report = "C# SDK (BreCalClient.misc) Debug Report:\n"; report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 1.1.0\n"; + report += " Version of the API: 1.2.0\n"; report += " SDK Package Version: 1.0.0\n"; return report; } @@ -4618,7 +5266,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4638,7 +5286,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4695,7 +5343,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4728,7 +5376,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4761,7 +5409,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4852,7 +5500,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4969,7 +5617,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5053,7 +5701,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5312,7 +5960,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5340,7 +5988,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5410,7 +6058,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5437,7 +6085,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5504,7 +6152,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5628,41 +6276,41 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.OwnerId == input.OwnerId || (this.OwnerId != null && this.OwnerId.Equals(input.OwnerId)) - ) && + ) && ( this.AuthorityId == input.AuthorityId || (this.AuthorityId != null && this.AuthorityId.Equals(input.AuthorityId)) - ) && + ) && ( this.VarLock == input.VarLock || (this.VarLock != null && this.VarLock.Equals(input.VarLock)) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -5728,7 +6376,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5816,12 +6464,12 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Username == input.Username || (this.Username != null && this.Username.Equals(input.Username)) - ) && + ) && ( this.Password == input.Password || (this.Password != null && @@ -5865,7 +6513,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5941,7 +6589,7 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Message == input.Message || (this.Message != null && @@ -5981,7 +6629,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6021,7 +6669,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6134,33 +6782,33 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.ShipcallId == input.ShipcallId || this.ShipcallId.Equals(input.ShipcallId) - ) && + ) && ( this.Timestamp == input.Timestamp || (this.Timestamp != null && this.Timestamp.Equals(input.Timestamp)) - ) && + ) && ( this.Eta == input.Eta || (this.Eta != null && this.Eta.Equals(input.Eta)) - ) && + ) && ( this.Operation == input.Operation || this.Operation.Equals(input.Operation) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) @@ -6208,7 +6856,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6273,7 +6921,7 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.VarId == input.VarId || this.VarId.Equals(input.VarId) @@ -6309,7 +6957,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6438,44 +7086,44 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) - ) && + ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) - ) && + ) && ( this.UserName == input.UserName || (this.UserName != null && this.UserName.Equals(input.UserName)) - ) && + ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) - ) && + ) && ( this.UserEmail == input.UserEmail || (this.UserEmail != null && this.UserEmail.Equals(input.UserEmail)) - ) && + ) && ( this.Exp == input.Exp || this.Exp.Equals(input.Exp) - ) && + ) && ( this.Token == input.Token || (this.Token != null && @@ -6538,7 +7186,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6645,29 +7293,29 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ShipcallId == input.ShipcallId || this.ShipcallId.Equals(input.ShipcallId) - ) && + ) && ( this.NotificationType == input.NotificationType || this.NotificationType.Equals(input.NotificationType) - ) && + ) && ( this.Message == input.Message || (this.Message != null && this.Message.Equals(input.Message)) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -6718,7 +7366,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6753,7 +7401,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6783,7 +7431,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6818,7 +7466,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6958,50 +7606,50 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.Street == input.Street || (this.Street != null && this.Street.Equals(input.Street)) - ) && + ) && ( this.PostalCode == input.PostalCode || (this.PostalCode != null && this.PostalCode.Equals(input.PostalCode)) - ) && + ) && ( this.City == input.City || (this.City != null && this.City.Equals(input.City)) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) - ) && + ) && ( this.Flags == input.Flags || (this.Flags != null && this.Flags.Equals(input.Flags)) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -7087,7 +7735,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7108,7 +7756,7 @@ namespace BreCalClient.misc.Model /// Initializes a new instance of the class. /// /// participantId (required). - /// type (required). + /// Currently this is encoded as an integer, since in OpenAPI 3.0 there are no enumerations supported with discrete integer values like a bitwise flag array used here. Each bit corresponds to a role. Since a participant can have multiple roles, these bits are combined by OR. Individual values: 1: BSMD 2: TERMINAL, 4: PILOT, 8: AGENCY, 16: MOORING, 32: PORT_ADMINISTRATION, 64: TUG (required). public ParticipantAssignment(int participantId = default(int), int type = default(int)) { this.ParticipantId = participantId; @@ -7120,8 +7768,9 @@ namespace BreCalClient.misc.Model [DataMember(Name = "participant_id", IsRequired = true, EmitDefaultValue = true)] public int ParticipantId { get; set; } /// - /// Gets or Sets Type + /// Currently this is encoded as an integer, since in OpenAPI 3.0 there are no enumerations supported with discrete integer values like a bitwise flag array used here. Each bit corresponds to a role. Since a participant can have multiple roles, these bits are combined by OR. Individual values: 1: BSMD 2: TERMINAL, 4: PILOT, 8: AGENCY, 16: MOORING, 32: PORT_ADMINISTRATION, 64: TUG /// + /// Currently this is encoded as an integer, since in OpenAPI 3.0 there are no enumerations supported with discrete integer values like a bitwise flag array used here. Each bit corresponds to a role. Since a participant can have multiple roles, these bits are combined by OR. Individual values: 1: BSMD 2: TERMINAL, 4: PILOT, 8: AGENCY, 16: MOORING, 32: PORT_ADMINISTRATION, 64: TUG [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public int Type { get; set; } /// @@ -7165,11 +7814,11 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) @@ -7206,7 +7855,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7369,65 +8018,65 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.Imo == input.Imo || (this.Imo != null && this.Imo.Equals(input.Imo)) - ) && + ) && ( this.Callsign == input.Callsign || (this.Callsign != null && this.Callsign.Equals(input.Callsign)) - ) && + ) && ( this.ParticipantId == input.ParticipantId || (this.ParticipantId != null && this.ParticipantId.Equals(input.ParticipantId)) - ) && + ) && ( this.Length == input.Length || (this.Length != null && this.Length.Equals(input.Length)) - ) && + ) && ( this.Width == input.Width || (this.Width != null && this.Width.Equals(input.Width)) - ) && + ) && ( this.IsTug == input.IsTug || this.IsTug.Equals(input.IsTug) - ) && + ) && ( this.BollardPull == input.BollardPull || (this.BollardPull != null && this.BollardPull.Equals(input.BollardPull)) - ) && + ) && ( this.Eni == input.Eni || (this.Eni != null && this.Eni.Equals(input.Eni)) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -7515,7 +8164,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7804,139 +8453,139 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ShipId == input.ShipId || this.ShipId.Equals(input.ShipId) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) - ) && + ) && ( this.Eta == input.Eta || (this.Eta != null && this.Eta.Equals(input.Eta)) - ) && + ) && ( this.Voyage == input.Voyage || (this.Voyage != null && this.Voyage.Equals(input.Voyage)) - ) && + ) && ( this.Etd == input.Etd || (this.Etd != null && this.Etd.Equals(input.Etd)) - ) && + ) && ( this.ArrivalBerthId == input.ArrivalBerthId || (this.ArrivalBerthId != null && this.ArrivalBerthId.Equals(input.ArrivalBerthId)) - ) && + ) && ( this.DepartureBerthId == input.DepartureBerthId || (this.DepartureBerthId != null && this.DepartureBerthId.Equals(input.DepartureBerthId)) - ) && + ) && ( this.TugRequired == input.TugRequired || (this.TugRequired != null && this.TugRequired.Equals(input.TugRequired)) - ) && + ) && ( this.PilotRequired == input.PilotRequired || (this.PilotRequired != null && this.PilotRequired.Equals(input.PilotRequired)) - ) && + ) && ( this.Flags == input.Flags || (this.Flags != null && this.Flags.Equals(input.Flags)) - ) && + ) && ( this.PierSide == input.PierSide || (this.PierSide != null && this.PierSide.Equals(input.PierSide)) - ) && + ) && ( this.Bunkering == input.Bunkering || (this.Bunkering != null && this.Bunkering.Equals(input.Bunkering)) - ) && + ) && ( this.ReplenishingTerminal == input.ReplenishingTerminal || (this.ReplenishingTerminal != null && this.ReplenishingTerminal.Equals(input.ReplenishingTerminal)) - ) && + ) && ( this.ReplenishingLock == input.ReplenishingLock || (this.ReplenishingLock != null && this.ReplenishingLock.Equals(input.ReplenishingLock)) - ) && + ) && ( this.Draft == input.Draft || (this.Draft != null && this.Draft.Equals(input.Draft)) - ) && + ) && ( this.TidalWindowFrom == input.TidalWindowFrom || (this.TidalWindowFrom != null && this.TidalWindowFrom.Equals(input.TidalWindowFrom)) - ) && + ) && ( this.TidalWindowTo == input.TidalWindowTo || (this.TidalWindowTo != null && this.TidalWindowTo.Equals(input.TidalWindowTo)) - ) && + ) && ( this.RainSensitiveCargo == input.RainSensitiveCargo || (this.RainSensitiveCargo != null && this.RainSensitiveCargo.Equals(input.RainSensitiveCargo)) - ) && + ) && ( this.RecommendedTugs == input.RecommendedTugs || (this.RecommendedTugs != null && this.RecommendedTugs.Equals(input.RecommendedTugs)) - ) && + ) && ( this.Anchored == input.Anchored || (this.Anchored != null && this.Anchored.Equals(input.Anchored)) - ) && + ) && ( this.MooredLock == input.MooredLock || (this.MooredLock != null && this.MooredLock.Equals(input.MooredLock)) - ) && + ) && ( this.Canceled == input.Canceled || (this.Canceled != null && this.Canceled.Equals(input.Canceled)) - ) && + ) && ( this.Evaluation == input.Evaluation || this.Evaluation.Equals(input.Evaluation) - ) && + ) && ( this.EvaluationMessage == input.EvaluationMessage || (this.EvaluationMessage != null && this.EvaluationMessage.Equals(input.EvaluationMessage)) - ) && + ) && ( this.Participants == input.Participants || this.Participants != null && input.Participants != null && this.Participants.SequenceEqual(input.Participants) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -8082,7 +8731,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -8122,7 +8771,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -8361,98 +9010,98 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.EtaBerth == input.EtaBerth || (this.EtaBerth != null && this.EtaBerth.Equals(input.EtaBerth)) - ) && + ) && ( this.EtaBerthFixed == input.EtaBerthFixed || (this.EtaBerthFixed != null && this.EtaBerthFixed.Equals(input.EtaBerthFixed)) - ) && + ) && ( this.EtdBerth == input.EtdBerth || (this.EtdBerth != null && this.EtdBerth.Equals(input.EtdBerth)) - ) && + ) && ( this.EtdBerthFixed == input.EtdBerthFixed || (this.EtdBerthFixed != null && this.EtdBerthFixed.Equals(input.EtdBerthFixed)) - ) && + ) && ( this.LockTime == input.LockTime || (this.LockTime != null && this.LockTime.Equals(input.LockTime)) - ) && + ) && ( this.LockTimeFixed == input.LockTimeFixed || (this.LockTimeFixed != null && this.LockTimeFixed.Equals(input.LockTimeFixed)) - ) && + ) && ( this.ZoneEntry == input.ZoneEntry || (this.ZoneEntry != null && this.ZoneEntry.Equals(input.ZoneEntry)) - ) && + ) && ( this.ZoneEntryFixed == input.ZoneEntryFixed || (this.ZoneEntryFixed != null && this.ZoneEntryFixed.Equals(input.ZoneEntryFixed)) - ) && + ) && ( this.OperationsStart == input.OperationsStart || (this.OperationsStart != null && this.OperationsStart.Equals(input.OperationsStart)) - ) && + ) && ( this.OperationsEnd == input.OperationsEnd || (this.OperationsEnd != null && this.OperationsEnd.Equals(input.OperationsEnd)) - ) && + ) && ( this.Remarks == input.Remarks || (this.Remarks != null && this.Remarks.Equals(input.Remarks)) - ) && + ) && ( this.ShipcallId == input.ShipcallId || this.ShipcallId.Equals(input.ShipcallId) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.BerthId == input.BerthId || (this.BerthId != null && this.BerthId.Equals(input.BerthId)) - ) && + ) && ( this.BerthInfo == input.BerthInfo || (this.BerthInfo != null && this.BerthInfo.Equals(input.BerthInfo)) - ) && + ) && ( this.PierSide == input.PierSide || (this.PierSide != null && this.PierSide.Equals(input.PierSide)) - ) && + ) && ( this.ParticipantType == input.ParticipantType || this.ParticipantType.Equals(input.ParticipantType) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -8566,7 +9215,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.2.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -8679,36 +9328,36 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.OldPassword == input.OldPassword || (this.OldPassword != null && this.OldPassword.Equals(input.OldPassword)) - ) && + ) && ( this.NewPassword == input.NewPassword || (this.NewPassword != null && this.NewPassword.Equals(input.NewPassword)) - ) && + ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) - ) && + ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) - ) && + ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) - ) && + ) && ( this.UserEmail == input.UserEmail || (this.UserEmail != null && diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index c9d9da0..91c27db 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -21,6 +21,7 @@ tags: - name: shipcall - name: times - name: static + - name: ship paths: /login: post: @@ -158,7 +159,7 @@ paths: summary: gets a list of ships description: Gets a list of ships including logically deleted ships to be used with shipcalls tags: - - static + - ship operationId: shipsGet responses: '200': @@ -175,6 +176,77 @@ paths: $ref: '#/components/responses/500' '503': $ref: '#/components/responses/503' + post: + summary: create a new ship entry + description: adds a new non-existing ship to the database. The ships IMO number is the unique identifier. + tags: + - ship + operationId: shipsCreate + requestBody: + description: Ship details. **Do not** provide id parameter. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ship' + responses: + '201': + $ref: '#/components/responses/201' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + put: + summary: Update a ship entry + description: Updating a ship entry. Please do not modify the IMO number. In that case please add a new entry. + tags: + - ship + operationId: shipUpdate + requestBody: + description: Updated ship entry. The id parameter is **required**. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ship' + responses: + '200': + $ref: '#/components/responses/200' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + delete: + summary: Delete a ship (logically). + description: 'A ship can only be logically deleted, since it is possible to have been used in previous shipcalls. On logical delete, the ship can no longer be selected in a new ship call.' + tags: + - ship + operationId: shipDelete + parameters: + - name: id + in: query + required: true + schema: + type: integer + responses: + '200': + $ref: '#/components/responses/200' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' /participants: get: summary: gets one or all participants diff --git a/src/BreCalClient/EditTimesControl.xaml.cs b/src/BreCalClient/EditTimesControl.xaml.cs index 4beaade..34c9556 100644 --- a/src/BreCalClient/EditTimesControl.xaml.cs +++ b/src/BreCalClient/EditTimesControl.xaml.cs @@ -75,12 +75,12 @@ namespace BreCalClient switch (CallType) { - case Extensions.TypeEnum.Incoming: + case ShipcallType.Arrival: this.labelETA.FontWeight = FontWeights.Bold; this.datePickerETABerth.ContextMenu.IsEnabled = false; break; - case Extensions.TypeEnum.Outgoing: - case Extensions.TypeEnum.Shifting: + case ShipcallType.Departure: + case ShipcallType.Shifting: this.labelETD.FontWeight = FontWeights.Bold; this.datePickerETDBerth.ContextMenu.IsEnabled = false; break; diff --git a/src/BreCalClient/EditTimesTerminalControl.xaml.cs b/src/BreCalClient/EditTimesTerminalControl.xaml.cs index 0bd6598..888506e 100644 --- a/src/BreCalClient/EditTimesTerminalControl.xaml.cs +++ b/src/BreCalClient/EditTimesTerminalControl.xaml.cs @@ -97,12 +97,12 @@ namespace BreCalClient switch (CallType) { - case Extensions.TypeEnum.Incoming: + case ShipcallType.Arrival: this.labelStart.FontWeight = FontWeights.Bold; this.datePickerOperationStart.ContextMenu.IsEnabled = false; break; - case Extensions.TypeEnum.Outgoing: - case Extensions.TypeEnum.Shifting: + case ShipcallType.Departure: + case ShipcallType.Shifting: this.labelEnd.FontWeight = FontWeights.Bold; this.datePickerOperationEnd.ContextMenu.IsEnabled = false; break; diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index 7bbb0a0..c0a681e 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -47,6 +47,7 @@ namespace BreCalClient private readonly UserApi _userApi; private readonly TimesApi _timesApi; private readonly StaticApi _staticApi; + private readonly ShipApi _shipApi; private CancellationTokenSource _tokenSource = new(); private LoginResult? _loginResult; @@ -85,6 +86,8 @@ namespace BreCalClient _timesApi.Configuration.ApiKeyPrefix["Authorization"] = "Bearer"; _staticApi = new StaticApi(Properties.Settings.Default.API_URL); _staticApi.Configuration.ApiKeyPrefix["Authorization"] = "Bearer"; + _shipApi = new ShipApi(Properties.Settings.Default.API_URL); + _shipApi.Configuration.ApiKeyPrefix["Authorization"] = "Bearer"; } #endregion @@ -136,6 +139,7 @@ namespace BreCalClient this._shipcallApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; this._timesApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; this._staticApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; + this._shipApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; this.LoadStaticLists(); this.labelUsername.Text = $"{_loginResult.FirstName} {_loginResult.LastName}"; _timer = new Timer(RefreshToken, null, 4000000, Timeout.Infinite); @@ -177,6 +181,7 @@ namespace BreCalClient this._timesApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; this._shipcallApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; this._staticApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; + this._shipApi.Configuration.ApiKey["Authorization"] = _loginResult.Token; } } else @@ -230,11 +235,11 @@ namespace BreCalClient _tokenSource.Cancel(); // force timer loop end // if this was an arrival, create the matching departure call and open it - if (esc.ShipcallModel.Shipcall?.Type == (int)Extensions.TypeEnum.Incoming) + if (esc.ShipcallModel.Shipcall?.Type == ShipcallType.Arrival) { ShipcallControlModel scmOut = new(); scmOut.Shipcall = new(); - scmOut.Shipcall.Type = (int)Extensions.TypeEnum.Outgoing; + scmOut.Shipcall.Type = ShipcallType.Departure; scmOut.Shipcall.ShipId = esc.ShipcallModel.Shipcall.ShipId; scmOut.Ship = esc.ShipcallModel.Ship; DateTime eta = esc.ShipcallModel.Shipcall?.Eta ?? DateTime.Now; @@ -321,7 +326,7 @@ namespace BreCalClient private async void LoadStaticLists() { BreCalLists.InitializeBerths(await _staticApi.BerthsGetAsync()); - BreCalLists.InitializeShips(await _staticApi.ShipsGetAsync()); + BreCalLists.InitializeShips(await _shipApi.ShipsGetAsync()); BreCalLists.InitializeParticipants(await _staticApi.ParticipantsGetAsync()); this.searchFilterControl.SetBerths(BreCalLists.Berths); @@ -535,8 +540,8 @@ namespace BreCalClient if(sfm.Berths.Count > 0 ) { - this._visibleControlModels.RemoveAll(x => (!sfm.Berths.Contains((x.Shipcall?.ArrivalBerthId) ?? -1) && (x.Shipcall?.Type == (int) Extensions.TypeEnum.Incoming)) || - (!sfm.Berths.Contains((x.Shipcall?.DepartureBerthId) ?? -1) && (x.Shipcall?.Type != (int) Extensions.TypeEnum.Incoming))); + this._visibleControlModels.RemoveAll(x => (!sfm.Berths.Contains((x.Shipcall?.ArrivalBerthId) ?? -1) && (x.Shipcall?.Type == ShipcallType.Arrival)) || + (!sfm.Berths.Contains((x.Shipcall?.DepartureBerthId) ?? -1) && (x.Shipcall?.Type != ShipcallType.Arrival))); } if(sfm.Agencies.Count > 0 ) From f50497b7db152124671762ef15187e53b727b3f6 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sun, 14 Jan 2024 13:57:44 +0100 Subject: [PATCH 15/34] added edit button for ships in EditShipcallControl --- src/BreCalClient/EditShipcallControl.xaml | 9 +++++---- src/BreCalClient/EditShipcallControl.xaml.cs | 11 +++++++++++ src/BreCalClient/MainWindow.xaml.cs | 8 ++++++-- src/BreCalClient/Resources/Resources.Designer.cs | 9 +++++++++ src/BreCalClient/Resources/Resources.de.resx | 3 +++ src/BreCalClient/Resources/Resources.resx | 3 +++ 6 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/BreCalClient/EditShipcallControl.xaml b/src/BreCalClient/EditShipcallControl.xaml index c3d7b79..fb25afc 100644 --- a/src/BreCalClient/EditShipcallControl.xaml +++ b/src/BreCalClient/EditShipcallControl.xaml @@ -32,15 +32,16 @@