//---------------------- // // Generated REST API Client Code Generator v1.11.0.0 on 15.09.2024 15:38:00 // Using the tool OpenAPI Generator v7.8.0 // //---------------------- using BreCalClient.misc.Client; using BreCalClient.misc.Model; using FileIO = System.IO.File; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; using OpenAPIDateConverter = BreCalClient.misc.Client.OpenAPIDateConverter; using Polly; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Net.Security; using System.Reflection; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters; using System.Security.Cryptography.X509Certificates; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Api { #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 /// **Id of ship**. *Example: 42*. Id of ship to be deleted. /// 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 /// **Id of ship**. *Example: 42*. Id of ship to be deleted. /// 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 /// **Id of ship**. *Example: 42*. Id of ship to be deleted. /// 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(global::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 /// **Id of ship**. *Example: 42*. Id of ship to be deleted. /// 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(global::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(global::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(global::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(global::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(global::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(global::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(global::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 /// **Id of ship**. *Example: 42*. Id of ship to be deleted. /// 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 /// **Id of ship**. *Example: 42*. Id of ship to be deleted. /// 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 /// **Id of ship**. *Example: 42*. Id of ship to be deleted. /// 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(global::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 /// **Id of ship**. *Example: 42*. Id of ship to be deleted. /// 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(global::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(global::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(global::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(global::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(global::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(global::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(global::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.6.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 IShipcallApiSync : IApiAccessor { #region Synchronous Operations /// /// 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. /// Id Id ShipcallCreate(Shipcall shipcall, int operationIndex = 0); /// /// 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 Id ApiResponse ShipcallCreateWithHttpInfo(Shipcall shipcall, int operationIndex = 0); /// /// Updates a ship call /// /// /// Updates a shipcall. Usually done if the participant assignments change. /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Id Id ShipcallUpdate(Shipcall shipcall, int operationIndex = 0); /// /// Updates a ship call /// /// /// Updates a shipcall. Usually done if the participant assignments change. /// /// 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 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. /// List<Shipcall> List ShipcallsGet(int? pastDays = default(int?), 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. /// ApiResponse of List<Shipcall> ApiResponse> ShipcallsGetWithHttpInfo(int? pastDays = default(int?), int operationIndex = 0); #endregion Synchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public interface IShipcallApiAsync : IApiAccessor { #region Asynchronous Operations /// /// 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 Id System.Threading.Tasks.Task ShipcallCreateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// 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 (Id) System.Threading.Tasks.Task> ShipcallCreateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Updates a ship call /// /// /// Updates a shipcall. Usually done if the participant assignments change. /// /// 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 ShipcallUpdateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Updates a ship call /// /// /// Updates a shipcall. Usually done if the participant assignments change. /// /// 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> ShipcallUpdateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::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) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Shipcall> System.Threading.Tasks.Task> ShipcallsGetAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::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) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Shipcall>) System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public interface IShipcallApi : IShipcallApiSync, IShipcallApiAsync { } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class ShipcallApi : IShipcallApi { private BreCalClient.misc.Client.ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public ShipcallApi() : this((string)null) { } /// /// Initializes a new instance of the class. /// /// public ShipcallApi(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 ShipcallApi(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 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"); 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 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. /// Id public Id ShipcallCreate(Shipcall shipcall, int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse localVarResponse = ShipcallCreateWithHttpInfo(shipcall); return localVarResponse.Data; } /// /// 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 Id public BreCalClient.misc.Client.ApiResponse ShipcallCreateWithHttpInfo(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->ShipcallCreate"); } 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 = shipcall; localVarRequestOptions.Operation = "ShipcallApi.ShipcallCreate"; 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("/shipcalls", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ShipcallCreate", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// 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 Id public async System.Threading.Tasks.Task ShipcallCreateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipcallCreateWithHttpInfoAsync(shipcall, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// 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 (Id) public async System.Threading.Tasks.Task> ShipcallCreateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'shipcall' is set if (shipcall == null) { 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[] { "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 = shipcall; localVarRequestOptions.Operation = "ShipcallApi.ShipcallCreate"; 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("/shipcalls", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ShipcallCreate", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Updates a ship call Updates a shipcall. Usually done if the participant assignments change. /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Id public Id ShipcallUpdate(Shipcall shipcall, int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse localVarResponse = ShipcallUpdateWithHttpInfo(shipcall); return localVarResponse.Data; } /// /// Updates a ship call Updates a shipcall. Usually done if the participant assignments change. /// /// 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 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[] { "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 = shipcall; localVarRequestOptions.Operation = "ShipcallApi.ShipcallUpdate"; 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("/shipcalls", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ShipcallUpdate", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Updates a ship call Updates a shipcall. Usually done if the participant assignments change. /// /// 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 public async System.Threading.Tasks.Task ShipcallUpdateAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipcallUpdateWithHttpInfoAsync(shipcall, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Updates a ship call Updates a shipcall. Usually done if the participant assignments change. /// /// 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) public async System.Threading.Tasks.Task> ShipcallUpdateWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'shipcall' is set if (shipcall == null) { 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[] { "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 = shipcall; localVarRequestOptions.Operation = "ShipcallApi.ShipcallUpdate"; 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("/shipcalls", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ShipcallUpdate", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// 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. /// List<Shipcall> public List ShipcallsGet(int? pastDays = default(int?), int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse> localVarResponse = ShipcallsGetWithHttpInfo(pastDays); return localVarResponse.Data; } /// /// 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> public BreCalClient.misc.Client.ApiResponse> ShipcallsGetWithHttpInfo(int? pastDays = 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 (pastDays != null) { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "past_days", pastDays)); } localVarRequestOptions.Operation = "ShipcallApi.ShipcallsGet"; 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>("/shipcalls", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ShipcallsGet", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// 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. /// Cancellation Token to cancel the request. /// Task of List<Shipcall> public async System.Threading.Tasks.Task> ShipcallsGetAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await ShipcallsGetWithHttpInfoAsync(pastDays, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// 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. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Shipcall>) public async System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::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 (pastDays != null) { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "past_days", pastDays)); } localVarRequestOptions.Operation = "ShipcallApi.ShipcallsGet"; 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>("/shipcalls", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ShipcallsGet", 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.6.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 /// /// 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); /// /// Your GET endpoint /// /// /// Returns a list of ports /// /// Thrown when fails to make API call /// Index associated with the operation. /// List<Port> List GetPorts(int operationIndex = 0); /// /// Your GET endpoint /// /// /// Returns a list of ports /// /// Thrown when fails to make API call /// Index associated with the operation. /// ApiResponse of List<Port> ApiResponse> GetPortsWithHttpInfo(int operationIndex = 0); /// /// History data /// /// /// This endpoint returns a list of changes made to the specific shipcall /// /// Thrown when fails to make API call /// **Id of ship call**. *Example: 3*. Id given in ship call list /// Index associated with the operation. /// List<History> List HistoryGet(int shipcallId, int operationIndex = 0); /// /// History data /// /// /// This endpoint returns a list of changes made to the specific shipcall /// /// Thrown when fails to make API call /// **Id of ship call**. *Example: 3*. Id given in ship call list /// Index associated with the operation. /// ApiResponse of List<History> ApiResponse> HistoryGetWithHttpInfo(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 ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// List<Notification> List NotificationsGet(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 ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// ApiResponse of List<Notification> ApiResponse> NotificationsGetWithHttpInfo(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); #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(global::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(global::System.Threading.CancellationToken)); /// /// Your GET endpoint /// /// /// Returns a list of ports /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Port> System.Threading.Tasks.Task> GetPortsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Your GET endpoint /// /// /// Returns a list of ports /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Port>) System.Threading.Tasks.Task>> GetPortsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// History data /// /// /// This endpoint returns a list of changes made to the specific shipcall /// /// Thrown when fails to make API call /// **Id of ship call**. *Example: 3*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<History> System.Threading.Tasks.Task> HistoryGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// History data /// /// /// This endpoint returns a list of changes made to the specific shipcall /// /// Thrown when fails to make API call /// **Id of ship call**. *Example: 3*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<History>) System.Threading.Tasks.Task>> HistoryGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::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 List<Notification> System.Threading.Tasks.Task> NotificationsGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Gets a list of notifications pursuant to a specified participant and ship call /// /// /// 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 ApiResponse (List<Notification>) System.Threading.Tasks.Task>> NotificationsGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::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(global::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(global::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 /// Index associated with the operation. /// List<Berth> public List BerthsGet(int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse> localVarResponse = BerthsGetWithHttpInfo(); return localVarResponse.Data; } /// /// 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> public BreCalClient.misc.Client.ApiResponse> BerthsGetWithHttpInfo(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.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 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> public async System.Threading.Tasks.Task> BerthsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await BerthsGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// 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>) public async System.Threading.Tasks.Task>> BerthsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // 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.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; } /// /// Your GET endpoint Returns a list of ports /// /// Thrown when fails to make API call /// Index associated with the operation. /// List<Port> public List GetPorts(int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse> localVarResponse = GetPortsWithHttpInfo(); return localVarResponse.Data; } /// /// Your GET endpoint Returns a list of ports /// /// Thrown when fails to make API call /// Index associated with the operation. /// ApiResponse of List<Port> public BreCalClient.misc.Client.ApiResponse> GetPortsWithHttpInfo(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.GetPorts"; 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>("/ports", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPorts", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Your GET endpoint Returns a list of ports /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Port> public async System.Threading.Tasks.Task> GetPortsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await GetPortsWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Your GET endpoint Returns a list of ports /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Port>) public async System.Threading.Tasks.Task>> GetPortsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // 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.GetPorts"; 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>("/ports", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPorts", 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 /// **Id of ship call**. *Example: 3*. Id given in ship call list /// Index associated with the operation. /// List<History> public List HistoryGet(int shipcallId, int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse> localVarResponse = HistoryGetWithHttpInfo(shipcallId); return localVarResponse.Data; } /// /// History data This endpoint returns a list of changes made to the specific shipcall /// /// Thrown when fails to make API call /// **Id of ship call**. *Example: 3*. Id given in ship call list /// Index associated with the operation. /// ApiResponse of List<History> public BreCalClient.misc.Client.ApiResponse> HistoryGetWithHttpInfo(int shipcallId, 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("", "shipcall_id", shipcallId)); 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 /// **Id of ship call**. *Example: 3*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<History> public async System.Threading.Tasks.Task> HistoryGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await HistoryGetWithHttpInfoAsync(shipcallId, 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 /// **Id of ship call**. *Example: 3*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<History>) public async System.Threading.Tasks.Task>> HistoryGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::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("", "shipcall_id", shipcallId)); 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. /// List<Notification> public List 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 List<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[] { }; // 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("", "shipcall_id", shipcallId)); localVarRequestOptions.Operation = "StaticApi.NotificationsGet"; 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>("/notifications", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("NotificationsGet", 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. /// Cancellation Token to cancel the request. /// Task of List<Notification> public async System.Threading.Tasks.Task> NotificationsGetAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await NotificationsGetWithHttpInfoAsync(shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// 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 ApiResponse (List<Notification>) public async System.Threading.Tasks.Task>> NotificationsGetWithHttpInfoAsync(int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // 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("", "shipcall_id", shipcallId)); localVarRequestOptions.Operation = "StaticApi.NotificationsGet"; 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>("/notifications", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("NotificationsGet", 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. /// 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(global::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(global::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; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.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 /// /// 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 /// **Id of times**. *Example: 42*. Id of times entry to be deleted. /// 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 /// **Id of times**. *Example: 42*. Id of times entry to be deleted. /// 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(global::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(global::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 /// **Id of times**. *Example: 42*. Id of times entry to be deleted. /// 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(global::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 /// **Id of times**. *Example: 42*. Id of times entry to be deleted. /// 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(global::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(global::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(global::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(global::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(global::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 TimesApi() : this((string)null) { } /// /// 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(global::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(global::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 /// **Id of times**. *Example: 42*. Id of times entry to be deleted. /// Index associated with the operation. /// 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 /// **Id of times**. *Example: 42*. Id of times entry to be deleted. /// 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[] { }; // 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 = "TimesApi.TimesDelete"; 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("/times", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TimesDelete", 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 /// **Id of times**. *Example: 42*. Id of times entry to be deleted. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id public async System.Threading.Tasks.Task TimesDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesDeleteWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); 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 /// **Id of times**. *Example: 42*. Id of times entry to be deleted. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) public async System.Threading.Tasks.Task> TimesDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::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 = "TimesApi.TimesDelete"; 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("/times", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TimesDelete", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// 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> public List TimesGet(int? shipcallId = default(int?), int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse> localVarResponse = TimesGetWithHttpInfo(shipcallId); return localVarResponse.Data; } /// /// 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> public BreCalClient.misc.Client.ApiResponse> TimesGetWithHttpInfo(int? shipcallId = 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 (shipcallId != null) { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); } localVarRequestOptions.Operation = "TimesApi.TimesGet"; 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>("/times", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TimesGet", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// 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> public async System.Threading.Tasks.Task> TimesGetAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await TimesGetWithHttpInfoAsync(shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// 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>) public async System.Threading.Tasks.Task>> TimesGetWithHttpInfoAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // 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 (shipcallId != null) { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); } localVarRequestOptions.Operation = "TimesApi.TimesGet"; 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>("/times", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TimesGet", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// 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 TimesUpdate(Times times, int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse localVarResponse = TimesUpdateWithHttpInfo(times); return localVarResponse.Data; } /// /// 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 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 TimesApi->TimesUpdate"); } 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.TimesUpdate"; 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("/times", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TimesUpdate", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// 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 TimesUpdateAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesUpdateWithHttpInfoAsync(times, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// 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> TimesUpdateWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'times' is set if (times == null) { 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[] { "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.TimesUpdate"; 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("/times", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TimesUpdate", 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.6.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 /// /// 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(global::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(global::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(global::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(global::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 UserApi() : this((string)null) { } /// /// 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 /// Login credentials /// Index associated with the operation. /// LoginResult public LoginResult Login(Credentials credentials, int operationIndex = 0) { 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 '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 = this.Client.Post("/login", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Login", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// 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 public async System.Threading.Tasks.Task LoginAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await LoginWithHttpInfoAsync(credentials, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// 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(global::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. /// 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 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 = this.Client.Put("/user", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { 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(global::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(global::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; } } return localVarResponse; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. /// internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer { private readonly IReadableConfiguration _configuration; private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, ContractResolver = new DefaultContractResolver { NamingStrategy = new CamelCaseNamingStrategy { OverrideSpecifiedNames = false } } }; public CustomJsonCodec(IReadableConfiguration configuration) { _configuration = configuration; } public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) { _serializerSettings = serializerSettings; _configuration = configuration; } /// /// Serialize the object into a JSON string. /// /// Object to be serialized. /// A JSON string. public string Serialize(object obj) { if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema return ((AbstractOpenAPISchema)obj).ToJson(); } else { return JsonConvert.SerializeObject(obj, _serializerSettings); } } public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); public T Deserialize(RestResponse response) { var result = (T)Deserialize(response, typeof(T)); return result; } /// /// Deserialize the JSON string into a proper object. /// /// The HTTP response. /// Object type. /// Object representation of the JSON string. internal object Deserialize(RestResponse response, Type type) { if (type == typeof(byte[])) // return byte array { return response.RawBytes; } // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) if (type == typeof(Stream)) { var bytes = response.RawBytes; if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) ? Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) { var match = regex.Match(header.ToString()); if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } } var stream = new MemoryStream(bytes); return stream; } if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type { return Convert.ChangeType(response.Content, type); } // at this point, it must be a model (json) try { return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); } catch (Exception e) { throw new ApiException(500, e.Message); } } public ISerializer Serializer => this; public IDeserializer Deserializer => this; public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } /// /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), /// encapsulating general REST accessor use cases. /// public partial class ApiClient : ISynchronousClient, IAsynchronousClient { private readonly string _baseUrl; /// /// Specifies the settings on a object. /// These settings can be adjusted to accommodate custom serialization rules. /// public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, ContractResolver = new DefaultContractResolver { NamingStrategy = new CamelCaseNamingStrategy { OverrideSpecifiedNames = false } } }; /// /// Allows for extending request processing for generated code. /// /// The RestSharp request object partial void InterceptRequest(RestRequest request); /// /// Allows for extending response processing for generated code. /// /// The RestSharp request object /// The RestSharp response object partial void InterceptResponse(RestRequest request, RestResponse response); /// /// Initializes a new instance of the , defaulting to the global configurations' base url. /// public ApiClient() { _baseUrl = GlobalConfiguration.Instance.BasePath; } /// /// Initializes a new instance of the /// /// The target service's base path in URL format. /// public ApiClient(string basePath) { if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); _baseUrl = basePath; } /// /// Constructs the RestSharp version of an http method /// /// Swagger Client Custom HttpMethod /// RestSharp's HttpMethod instance. /// private RestSharpMethod Method(HttpMethod method) { RestSharpMethod other; switch (method) { case HttpMethod.Get: other = RestSharpMethod.Get; break; case HttpMethod.Post: other = RestSharpMethod.Post; break; case HttpMethod.Put: other = RestSharpMethod.Put; break; case HttpMethod.Delete: other = RestSharpMethod.Delete; break; case HttpMethod.Head: other = RestSharpMethod.Head; break; case HttpMethod.Options: other = RestSharpMethod.Options; break; case HttpMethod.Patch: other = RestSharpMethod.Patch; break; default: throw new ArgumentOutOfRangeException("method", method, null); } return other; } /// /// Provides all logic for constructing a new RestSharp . /// At this point, all information for querying the service is known. /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. /// A per-request configuration object. /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( HttpMethod method, string path, RequestOptions options, IReadableConfiguration configuration) { if (path == null) throw new ArgumentNullException("path"); if (options == null) throw new ArgumentNullException("options"); if (configuration == null) throw new ArgumentNullException("configuration"); RestRequest request = new RestRequest(path, Method(method)); if (options.PathParameters != null) { foreach (var pathParam in options.PathParameters) { request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); } } if (options.QueryParameters != null) { foreach (var queryParam in options.QueryParameters) { foreach (var value in queryParam.Value) { request.AddQueryParameter(queryParam.Key, value); } } } if (configuration.DefaultHeaders != null) { foreach (var headerParam in configuration.DefaultHeaders) { request.AddHeader(headerParam.Key, headerParam.Value); } } if (options.HeaderParameters != null) { foreach (var headerParam in options.HeaderParameters) { foreach (var value in headerParam.Value) { request.AddHeader(headerParam.Key, value); } } } if (options.FormParameters != null) { foreach (var formParam in options.FormParameters) { request.AddParameter(formParam.Key, formParam.Value); } } if (options.Data != null) { if (options.Data is Stream stream) { var contentType = "application/octet-stream"; if (options.HeaderParameters != null) { var contentTypes = options.HeaderParameters["Content-Type"]; contentType = contentTypes[0]; } var bytes = ClientUtils.ReadAsBytes(stream); request.AddParameter(contentType, bytes, ParameterType.RequestBody); } else { if (options.HeaderParameters != null) { var contentTypes = options.HeaderParameters["Content-Type"]; if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) { request.RequestFormat = DataFormat.Json; } else { // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. } } else { // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. request.RequestFormat = DataFormat.Json; } request.AddJsonBody(options.Data); } } if (options.FileParameters != null) { foreach (var fileParam in options.FileParameters) { foreach (var file in fileParam.Value) { var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } } } return request; } /// /// Transforms a RestResponse instance into a new ApiResponse instance. /// At this point, we have a concrete http response from the service. /// Here, it is simply mapped into the [public] ApiResponse object. /// /// The RestSharp response object /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; string rawContent = response.Content; var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) { ErrorText = response.ErrorMessage, Cookies = new List() }; if (response.Headers != null) { foreach (var responseHeader in response.Headers) { transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); } } if (response.ContentHeaders != null) { foreach (var responseHeader in response.ContentHeaders) { transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); } } if (response.Cookies != null) { foreach (var responseCookies in response.Cookies.Cast()) { transformed.Cookies.Add( new Cookie( responseCookies.Name, responseCookies.Value, responseCookies.Path, responseCookies.Domain) ); } } return transformed; } /// /// Executes the HTTP request for the current service. /// Based on functions received it can be async or sync. /// /// Local function that executes http request and returns http response. /// Local function to specify options for the service. /// The RestSharp request object /// The RestSharp options object /// A per-request configuration object. /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// A new ApiResponse instance. private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; setOptions(clientOptions); using (RestClient client = new RestClient(clientOptions, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) { InterceptRequest(request); RestResponse response = await getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { throw ex.InnerException != null ? ex.InnerException : ex; } } else if (typeof(T).Name == "Stream") // for binary response { response.Data = (T)(object)new MemoryStream(response.RawBytes); } else if (typeof(T).Name == "Byte[]") // for byte response { response.Data = (T)(object)response.RawBytes; } else if (typeof(T).Name == "String") // for string response { response.Data = (T)(object)response.Content; } InterceptResponse(request, response); var result = ToApiResponse(response); if (response.ErrorMessage != null) { result.ErrorText = response.ErrorMessage; } if (response.Cookies != null && response.Cookies.Count > 0) { if (result.Cookies == null) result.Cookies = new List(); foreach (var restResponseCookie in response.Cookies.Cast()) { var cookie = new Cookie( restResponseCookie.Name, restResponseCookie.Value, restResponseCookie.Path, restResponseCookie.Domain ) { Comment = restResponseCookie.Comment, CommentUri = restResponseCookie.CommentUri, Discard = restResponseCookie.Discard, Expired = restResponseCookie.Expired, Expires = restResponseCookie.Expires, HttpOnly = restResponseCookie.HttpOnly, Port = restResponseCookie.Port, Secure = restResponseCookie.Secure, Version = restResponseCookie.Version }; result.Cookies.Add(cookie); } } return result; } } private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { if (policyResult.Outcome == OutcomeType.Successful) { return client.Deserialize(policyResult.Result); } else { return new RestResponse(request) { ErrorException = policyResult.FinalException }; } } private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) { Action setOptions = (clientOptions) => { var cookies = new CookieContainer(); if (options.Cookies != null && options.Cookies.Count > 0) { foreach (var cookie in options.Cookies) { cookies.Add(new Cookie(cookie.Name, cookie.Value)); } } clientOptions.CookieContainer = cookies; }; Func>> getResponse = (client) => { if (RetryConfiguration.RetryPolicy != null) { var policy = RetryConfiguration.RetryPolicy; var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); return Task.FromResult(DeserializeRestResponseFromPolicy(client, request, policyResult)); } else { return Task.FromResult(client.Execute(request)); } }; return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); } private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) { Action setOptions = (clientOptions) => { //no extra options }; Func>> getResponse = async (client) => { if (RetryConfiguration.AsyncRetryPolicy != null) { var policy = RetryConfiguration.AsyncRetryPolicy; var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); } }; return ExecClientAsync(getResponse, setOptions, request, options, configuration); } #region IAsynchronousClient /// /// Make a HTTP GET request (async). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); } /// /// Make a HTTP POST request (async). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); } /// /// Make a HTTP PUT request (async). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); } /// /// Make a HTTP DELETE request (async). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); } /// /// Make a HTTP HEAD request (async). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); } /// /// Make a HTTP OPTION request (async). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); } /// /// Make a HTTP PATCH request (async). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); } #endregion IAsynchronousClient #region ISynchronousClient /// /// Make a HTTP GET request (synchronous). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); } /// /// Make a HTTP POST request (synchronous). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); } /// /// Make a HTTP PUT request (synchronous). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); } /// /// Make a HTTP DELETE request (synchronous). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); } /// /// Make a HTTP HEAD request (synchronous). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); } /// /// Make a HTTP OPTION request (synchronous). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); } /// /// Make a HTTP PATCH request (synchronous). /// /// The target path (or resource). /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); } #endregion ISynchronousClient } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// API Exception /// public class ApiException : Exception { /// /// Gets or sets the error code (HTTP status code) /// /// The error code (HTTP status code). public int ErrorCode { get; set; } /// /// Gets or sets the error content (body json object) /// /// The error content (Http response body). public object ErrorContent { get; private set; } /// /// Gets or sets the HTTP headers /// /// HTTP headers public Multimap Headers { get; private set; } /// /// Initializes a new instance of the class. /// public ApiException() { } /// /// Initializes a new instance of the class. /// /// HTTP status code. /// Error message. public ApiException(int errorCode, string message) : base(message) { this.ErrorCode = errorCode; } /// /// Initializes a new instance of the class. /// /// HTTP status code. /// Error message. /// Error content. /// HTTP Headers. public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) { this.ErrorCode = errorCode; this.ErrorContent = errorContent; this.Headers = headers; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Provides a non-generic contract for the ApiResponse wrapper. /// public interface IApiResponse { /// /// The data type of /// Type ResponseType { get; } /// /// The content of this response /// Object Content { get; } /// /// Gets or sets the status code (HTTP status code) /// /// The status code. HttpStatusCode StatusCode { get; } /// /// Gets or sets the HTTP headers /// /// HTTP headers Multimap Headers { get; } /// /// Gets or sets any error text defined by the calling client. /// string ErrorText { get; set; } /// /// Gets or sets any cookies passed along on the response. /// List Cookies { get; set; } /// /// The raw content of this response /// string RawContent { get; } } /// /// API Response /// public class ApiResponse : IApiResponse { #region Properties /// /// Gets or sets the status code (HTTP status code) /// /// The status code. public HttpStatusCode StatusCode { get; } /// /// Gets or sets the HTTP headers /// /// HTTP headers public Multimap Headers { get; } /// /// Gets or sets the data (parsed HTTP body) /// /// The data. public T Data { get; } /// /// Gets or sets any error text defined by the calling client. /// public string ErrorText { get; set; } /// /// Gets or sets any cookies passed along on the response. /// public List Cookies { get; set; } /// /// The content of this response /// public Type ResponseType { get { return typeof(T); } } /// /// The data type of /// public object Content { get { return Data; } } /// /// The raw content /// public string RawContent { get; } #endregion Properties #region Constructors /// /// Initializes a new instance of the class. /// /// HTTP status code. /// HTTP headers. /// Data (parsed HTTP body) /// Raw content. public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) { StatusCode = statusCode; Headers = headers; Data = data; RawContent = rawContent; } /// /// Initializes a new instance of the class. /// /// HTTP status code. /// HTTP headers. /// Data (parsed HTTP body) public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) { } /// /// Initializes a new instance of the class. /// /// HTTP status code. /// Data (parsed HTTP body) /// Raw content. public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) { } /// /// Initializes a new instance of the class. /// /// HTTP status code. /// Data (parsed HTTP body) public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) { } #endregion Constructors } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Utility functions providing some benefit to API client consumers. /// public static class ClientUtils { /// /// Sanitize filename by removing the path /// /// Filename /// Filename public static string SanitizeFilename(string filename) { Match match = Regex.Match(filename, @".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } /// /// Convert params to key/value pairs. /// Use collectionFormat to properly format lists and collections. /// /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi /// Key name. /// Value object. /// A multimap of keys with 1..n associated values. public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) { var parameters = new Multimap(); if (value is ICollection collection && collectionFormat == "multi") { foreach (var item in collection) { parameters.Add(name, ParameterToString(item)); } } else if (value is IDictionary dictionary) { if(collectionFormat == "deepObject") { foreach (DictionaryEntry entry in dictionary) { parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); } } else { foreach (DictionaryEntry entry in dictionary) { parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); } } } else { parameters.Add(name, ParameterToString(value)); } return parameters; } /// /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. /// If parameter is a list, join the list with ",". /// Otherwise just return the string. /// /// The parameter (header, path, query, form). /// An optional configuration instance, providing formatting options used in processing. /// Formatted string. public static string ParameterToString(object obj, IReadableConfiguration configuration = null) { if (obj is DateTime dateTime) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is DateTimeOffset dateTimeOffset) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; if (obj is ICollection collection) { List entries = new List(); foreach (var entry in collection) entries.Add(ParameterToString(entry, configuration)); return string.Join(",", entries); } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } /// /// Serializes the given object when not null. Otherwise return null. /// /// The object to serialize. /// Serialized string. public static string Serialize(object obj) { return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; } /// /// Encode string in base64 format. /// /// string to be encoded. /// Encoded string. public static string Base64Encode(string text) { return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); } /// /// Convert stream to byte array /// /// Input stream to be converted /// Byte array public static byte[] ReadAsBytes(Stream inputStream) { using (var ms = new MemoryStream()) { inputStream.CopyTo(ms); return ms.ToArray(); } } /// /// Select the Content-Type header's value from the given content-type array: /// if JSON type exists in the given array, use it; /// otherwise use the first one defined in 'consumes' /// /// The Content-Type array to select from. /// The Content-Type header to use. public static string SelectHeaderContentType(string[] contentTypes) { if (contentTypes.Length == 0) return null; foreach (var contentType in contentTypes) { if (IsJsonMime(contentType)) return contentType; } return contentTypes[0]; // use the first content type specified in 'consumes' } /// /// Select the Accept header's value from the given accepts array: /// if JSON exists in the given array, use it; /// otherwise use all of them (joining into a string) /// /// The accepts array to select from. /// The Accept header to use. public static string SelectHeaderAccept(string[] accepts) { if (accepts.Length == 0) return null; if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) return "application/json"; return string.Join(",", accepts); } /// /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. /// public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); /// /// Check if the given MIME is a JSON MIME. /// JSON MIME examples: /// application/json /// application/json; charset=UTF8 /// APPLICATION/JSON /// application/vnd.company+json /// /// MIME /// Returns True if MIME type is json. public static bool IsJsonMime(string mime) { if (string.IsNullOrWhiteSpace(mime)) return false; return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } /// /// Is the Enum decorated with EnumMember Attribute /// /// /// true if found private static bool HasEnumMemberAttrValue(object enumVal) { if (enumVal == null) throw new ArgumentNullException(nameof(enumVal)); var enumType = enumVal.GetType(); var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); if (attr != null) return true; return false; } /// /// Get the EnumMember value /// /// /// EnumMember value as string otherwise null private static string GetEnumMemberAttrValue(object enumVal) { if (enumVal == null) throw new ArgumentNullException(nameof(enumVal)); var enumType = enumVal.GetType(); var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); if (attr != null) { return attr.Value; } return null; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Represents a set of configuration settings /// public class Configuration : IReadableConfiguration { #region Constants /// /// Version of the package. /// /// Version of the package. public const string Version = "1.0.0"; /// /// Identifier for ISO 8601 DateTime Format /// /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. // ReSharper disable once InconsistentNaming public const string ISO8601_DATETIME_FORMAT = "o"; #endregion Constants #region Static Members /// /// Default creation of exceptions for a given method name and response object /// public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => { var status = (int)response.StatusCode; if (status >= 400) { return new ApiException(status, 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 #region Private Members /// /// Defines the base path of the target API server. /// Example: http://localhost:3000/v1/ /// private string _basePath; private bool _useDefaultCredentials = false; /// /// Gets or sets the API key based on the authentication name. /// This is the key and value comprising the "secret" for accessing an API. /// /// The API key. private IDictionary _apiKey; /// /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. /// /// The prefix of the API key. private IDictionary _apiKeyPrefix; private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; private string _tempFolderPath = Path.GetTempPath(); /// /// Gets or sets the servers defined in the OpenAPI spec. /// /// The servers private IList> _servers; /// /// Gets or sets the operation servers defined in the OpenAPI spec. /// /// The operation servers private IReadOnlyDictionary>> _operationServers; #endregion Private Members #region Constructors /// /// Initializes a new instance of the class /// [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration() { Proxy = null; UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); BasePath = "https://brecaldevel.bsmd-emswe.eu"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); ApiKeyPrefix = new ConcurrentDictionary(); Servers = new List>() { { new Dictionary { {"url", "https://brecaldevel.bsmd-emswe.eu"}, {"description", "Development server hosted on vcup"}, } } }; OperationServers = new Dictionary>>() { }; // Setting Timeout has side effects (forces ApiClient creation). Timeout = 100000; } /// /// Initializes a new instance of the class /// [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration( IDictionary defaultHeaders, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "https://brecaldevel.bsmd-emswe.eu") : this() { if (string.IsNullOrWhiteSpace(basePath)) throw new ArgumentException("The provided basePath is invalid.", "basePath"); if (defaultHeaders == null) throw new ArgumentNullException("defaultHeaders"); if (apiKey == null) throw new ArgumentNullException("apiKey"); if (apiKeyPrefix == null) throw new ArgumentNullException("apiKeyPrefix"); BasePath = basePath; foreach (var keyValuePair in defaultHeaders) { DefaultHeaders.Add(keyValuePair); } foreach (var keyValuePair in apiKey) { ApiKey.Add(keyValuePair); } foreach (var keyValuePair in apiKeyPrefix) { ApiKeyPrefix.Add(keyValuePair); } } #endregion Constructors #region Properties /// /// Gets or sets the base path for API access. /// public virtual string BasePath { get { return _basePath; } set { _basePath = value; } } /// /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. /// public virtual bool UseDefaultCredentials { get { return _useDefaultCredentials; } set { _useDefaultCredentials = value; } } /// /// Gets or sets the default header. /// [Obsolete("Use DefaultHeaders instead.")] public virtual IDictionary DefaultHeader { get { return DefaultHeaders; } set { DefaultHeaders = value; } } /// /// Gets or sets the default headers. /// public virtual IDictionary DefaultHeaders { get; set; } /// /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. /// public virtual int Timeout { get; set; } /// /// Gets or sets the proxy /// /// Proxy. public virtual WebProxy Proxy { get; set; } /// /// Gets or sets the HTTP user agent. /// /// Http user agent. public virtual string UserAgent { get; set; } /// /// Gets or sets the username (HTTP basic authentication). /// /// The username. public virtual string Username { get; set; } /// /// Gets or sets the password (HTTP basic authentication). /// /// The password. public virtual string Password { get; set; } /// /// Gets the API key with prefix. /// /// API key identifier (authentication scheme). /// API key with prefix. public string GetApiKeyWithPrefix(string apiKeyIdentifier) { string apiKeyValue; ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); string apiKeyPrefix; if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) { return apiKeyPrefix + " " + apiKeyValue; } return apiKeyValue; } /// /// Gets or sets certificate collection to be sent with requests. /// /// X509 Certificate collection. public X509CertificateCollection ClientCertificates { get; set; } /// /// Gets or sets the access token for OAuth2 authentication. /// /// This helper property simplifies code generation. /// /// The access token. public virtual string AccessToken { get; set; } /// /// Gets or sets the temporary folder path to store the files downloaded from the server. /// /// Folder path. public virtual string TempFolderPath { get { return _tempFolderPath; } set { if (string.IsNullOrEmpty(value)) { _tempFolderPath = Path.GetTempPath(); return; } // create the directory if it does not exist if (!Directory.Exists(value)) { Directory.CreateDirectory(value); } // check if the path contains directory separator at the end if (value[value.Length - 1] == Path.DirectorySeparatorChar) { _tempFolderPath = value; } else { _tempFolderPath = value + Path.DirectorySeparatorChar; } } } /// /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx /// No validation is done to ensure that the string you're providing is valid /// /// The DateTimeFormat string public virtual string DateTimeFormat { get { return _dateTimeFormat; } set { if (string.IsNullOrEmpty(value)) { // Never allow a blank or null string, go back to the default _dateTimeFormat = ISO8601_DATETIME_FORMAT; return; } // Caution, no validation when you choose date time format other than ISO 8601 // Take a look at the above links _dateTimeFormat = value; } } /// /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. /// /// Whatever you set here will be prepended to the value defined in AddApiKey. /// /// An example invocation here might be: /// /// ApiKeyPrefix["Authorization"] = "Bearer"; /// /// � where ApiKey["Authorization"] would then be used to set the value of your bearer token. /// /// /// OAuth2 workflows should set tokens via AccessToken. /// /// /// The prefix of the API key. public virtual IDictionary ApiKeyPrefix { get { return _apiKeyPrefix; } set { if (value == null) { throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); } _apiKeyPrefix = value; } } /// /// Gets or sets the API key based on the authentication name. /// /// The API key. public virtual IDictionary ApiKey { get { return _apiKey; } set { if (value == null) { throw new InvalidOperationException("ApiKey collection may not be null."); } _apiKey = value; } } /// /// Gets or sets the servers. /// /// The servers. public virtual IList> Servers { get { return _servers; } set { if (value == null) { throw new InvalidOperationException("Servers may not be null."); } _servers = value; } } /// /// Gets or sets the operation servers. /// /// The operation servers. public virtual IReadOnlyDictionary>> OperationServers { get { return _operationServers; } set { if (value == null) { throw new InvalidOperationException("Operation servers may not be null."); } _operationServers = value; } } /// /// Returns URL based on server settings without providing values /// for the variables /// /// Array index of the server settings. /// The server URL. public string GetServerUrl(int index) { return GetServerUrl(Servers, index, null); } /// /// Returns URL based on server settings. /// /// Array index of the server settings. /// Dictionary of the variables and the corresponding values. /// The server URL. public string GetServerUrl(int index, Dictionary inputVariables) { return GetServerUrl(Servers, index, inputVariables); } /// /// Returns URL based on operation server settings. /// /// Operation associated with the request path. /// Array index of the server settings. /// The operation server URL. public string GetOperationServerUrl(string operation, int index) { return GetOperationServerUrl(operation, index, null); } /// /// Returns URL based on operation server settings. /// /// Operation associated with the request path. /// Array index of the server settings. /// Dictionary of the variables and the corresponding values. /// The operation server URL. public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) { if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) { return GetServerUrl(operationServer, index, inputVariables); } return null; } /// /// Returns URL based on server settings. /// /// Dictionary of server settings. /// Array index of the server settings. /// Dictionary of the variables and the corresponding values. /// The server URL. private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) { if (index < 0 || index >= servers.Count) { throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); } if (inputVariables == null) { inputVariables = new Dictionary(); } IReadOnlyDictionary server = servers[index]; string url = (string)server["url"]; if (server.ContainsKey("variables")) { // go through each variable and assign a value foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) { IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); if (inputVariables.ContainsKey(variable.Key)) { if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) { url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); } else { throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); } } else { // use default value url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); } } } return url; } /// /// Gets and Sets the RemoteCertificateValidationCallback /// public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } #endregion Properties #region Methods /// /// Returns a string with essential information for debugging. /// public static string ToDebugReport() { 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.6.0\n"; report += " SDK Package Version: 1.0.0\n"; return report; } /// /// Add Api Key Header. /// /// Api Key name. /// Api Key value. /// public void AddApiKey(string key, string value) { ApiKey[key] = value; } /// /// Sets the API key prefix. /// /// Api Key name. /// Api Key value. public void AddApiKeyPrefix(string key, string value) { ApiKeyPrefix[key] = value; } #endregion Methods #region Static Members /// /// Merge configurations. /// /// First configuration. /// Second configuration. /// Merged configuration. public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) { if (second == null) return first ?? GlobalConfiguration.Instance; Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; var config = new Configuration { ApiKey = apiKey, ApiKeyPrefix = apiKeyPrefix, DefaultHeaders = defaultHeaders, BasePath = second.BasePath ?? first.BasePath, Timeout = second.Timeout, Proxy = second.Proxy ?? first.Proxy, UserAgent = second.UserAgent ?? first.UserAgent, Username = second.Username ?? first.Username, Password = second.Password ?? first.Password, AccessToken = second.AccessToken ?? first.AccessToken, TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, UseDefaultCredentials = second.UseDefaultCredentials, RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, }; return config; } #endregion Static Members } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// A delegate to ExceptionFactory method /// /// Method name /// Response /// Exceptions public delegate Exception ExceptionFactory(string methodName, IApiResponse response); } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// provides a compile-time extension point for globally configuring /// API Clients. /// /// /// A customized implementation via partial class may reside in another file and may /// be excluded from automatic generation via a .openapi-generator-ignore file. /// public partial class GlobalConfiguration : Configuration { #region Private Members private static readonly object GlobalConfigSync = new { }; private static IReadableConfiguration _globalConfiguration; #endregion Private Members #region Constructors /// private GlobalConfiguration() { } /// public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) { } static GlobalConfiguration() { Instance = new GlobalConfiguration(); } #endregion Constructors /// /// Gets or sets the default Configuration. /// /// Configuration. public static IReadableConfiguration Instance { get { return _globalConfiguration; } set { lock (GlobalConfigSync) { _globalConfiguration = value; } } } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Http methods supported by swagger /// public enum HttpMethod { /// HTTP GET request. Get, /// HTTP POST request. Post, /// HTTP PUT request. Put, /// HTTP DELETE request. Delete, /// HTTP HEAD request. Head, /// HTTP OPTIONS request. Options, /// HTTP PATCH request. Patch } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Represents configuration aspects required to interact with the API endpoints. /// public interface IApiAccessor { /// /// Gets or sets the configuration object /// /// An instance of the Configuration IReadableConfiguration Configuration { get; set; } /// /// Gets the base path of the API client. /// /// The base path string GetBasePath(); /// /// Provides a factory method hook for the creation of exceptions. /// ExceptionFactory ExceptionFactory { get; set; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Contract for Asynchronous RESTful API interactions. /// /// This interface allows consumers to provide a custom API accessor client. /// public interface IAsynchronousClient { /// /// Executes a non-blocking call to some using the GET http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Represents a readable-only configuration contract. /// public interface IReadableConfiguration { /// /// Gets the access token. /// /// Access token. string AccessToken { get; } /// /// Gets the API key. /// /// API key. IDictionary ApiKey { get; } /// /// Gets the API key prefix. /// /// API key prefix. IDictionary ApiKeyPrefix { get; } /// /// Gets the base path. /// /// Base path. string BasePath { get; } /// /// Gets the date time format. /// /// Date time format. string DateTimeFormat { get; } /// /// Gets the default header. /// /// Default header. [Obsolete("Use DefaultHeaders instead.")] IDictionary DefaultHeader { get; } /// /// Gets the default headers. /// /// Default headers. IDictionary DefaultHeaders { get; } /// /// Gets the temp folder path. /// /// Temp folder path. string TempFolderPath { get; } /// /// Gets the HTTP connection timeout (in milliseconds) /// /// HTTP connection timeout. int Timeout { get; } /// /// Gets the proxy. /// /// Proxy. WebProxy Proxy { get; } /// /// Gets the user agent. /// /// User agent. string UserAgent { get; } /// /// Gets the username. /// /// Username. string Username { get; } /// /// Gets the password. /// /// Password. string Password { get; } /// /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. /// bool UseDefaultCredentials { get; } /// /// Get the servers associated with the operation. /// /// Operation servers. IReadOnlyDictionary>> OperationServers { get; } /// /// Gets the API key with prefix. /// /// API key identifier (authentication scheme). /// API key with prefix. string GetApiKeyWithPrefix(string apiKeyIdentifier); /// /// Gets the Operation server url at the provided index. /// /// Operation server name. /// Index of the operation server settings. /// string GetOperationServerUrl(string operation, int index); /// /// Gets certificate collection to be sent with requests. /// /// X509 Certificate collection. X509CertificateCollection ClientCertificates { get; } /// /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and /// overriding certificate errors in the scope of a request. /// RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Contract for Synchronous RESTful API interactions. /// /// This interface allows consumers to provide a custom API accessor client. /// public interface ISynchronousClient { /// /// Executes a blocking call to some using the GET http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// The return type. /// The response data, decorated with ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the POST http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// The return type. /// The response data, decorated with ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the PUT http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// The return type. /// The response data, decorated with ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the DELETE http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// The return type. /// The response data, decorated with ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the HEAD http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// The return type. /// The response data, decorated with ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the OPTIONS http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// The return type. /// The response data, decorated with ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the PATCH http verb. /// /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. /// The return type. /// The response data, decorated with ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// A dictionary in which one key has many associated values. /// /// The type of the key /// The type of the value associated with the key. public class Multimap : IDictionary> { #region Private Fields private readonly Dictionary> _dictionary; #endregion Private Fields #region Constructors /// /// Empty Constructor. /// public Multimap() { _dictionary = new Dictionary>(); } /// /// Constructor with comparer. /// /// public Multimap(IEqualityComparer comparer) { _dictionary = new Dictionary>(comparer); } #endregion Constructors #region Enumerators /// /// To get the enumerator. /// /// Enumerator public IEnumerator>> GetEnumerator() { return _dictionary.GetEnumerator(); } /// /// To get the enumerator. /// /// Enumerator IEnumerator IEnumerable.GetEnumerator() { return _dictionary.GetEnumerator(); } #endregion Enumerators #region Public Members /// /// Add values to Multimap /// /// Key value pair public void Add(KeyValuePair> item) { if (!TryAdd(item.Key, item.Value)) throw new InvalidOperationException("Could not add values to Multimap."); } /// /// Add Multimap to Multimap /// /// Multimap public void Add(Multimap multimap) { foreach (var item in multimap) { if (!TryAdd(item.Key, item.Value)) throw new InvalidOperationException("Could not add values to Multimap."); } } /// /// Clear Multimap /// public void Clear() { _dictionary.Clear(); } /// /// Determines whether Multimap contains the specified item. /// /// Key value pair /// Method needs to be implemented /// true if the Multimap contains the item; otherwise, false. public bool Contains(KeyValuePair> item) { throw new NotImplementedException(); } /// /// Copy items of the Multimap to an array, /// starting at a particular array index. /// /// The array that is the destination of the items copied /// from Multimap. The array must have zero-based indexing. /// The zero-based index in array at which copying begins. /// Method needs to be implemented public void CopyTo(KeyValuePair>[] array, int arrayIndex) { throw new NotImplementedException(); } /// /// Removes the specified item from the Multimap. /// /// Key value pair /// true if the item is successfully removed; otherwise, false. /// Method needs to be implemented public bool Remove(KeyValuePair> item) { throw new NotImplementedException(); } /// /// Gets the number of items contained in the Multimap. /// public int Count => _dictionary.Count; /// /// Gets a value indicating whether the Multimap is read-only. /// public bool IsReadOnly => false; /// /// Adds an item with the provided key and value to the Multimap. /// /// The object to use as the key of the item to add. /// The object to use as the value of the item to add. /// Thrown when couldn't add the value to Multimap. public void Add(TKey key, IList value) { if (value != null && value.Count > 0) { if (_dictionary.TryGetValue(key, out var list)) { foreach (var k in value) list.Add(k); } else { list = new List(value); if (!TryAdd(key, list)) throw new InvalidOperationException("Could not add values to Multimap."); } } } /// /// Determines whether the Multimap contains an item with the specified key. /// /// The key to locate in the Multimap. /// true if the Multimap contains an item with /// the key; otherwise, false. public bool ContainsKey(TKey key) { return _dictionary.ContainsKey(key); } /// /// Removes item with the specified key from the Multimap. /// /// The key to locate in the Multimap. /// true if the item is successfully removed; otherwise, false. public bool Remove(TKey key) { return TryRemove(key, out var _); } /// /// Gets the value associated with the specified key. /// /// The key whose value to get. /// When this method returns, the value associated with the specified key, if the /// key is found; otherwise, the default value for the type of the value parameter. /// This parameter is passed uninitialized. /// true if the object that implements Multimap contains /// an item with the specified key; otherwise, false. public bool TryGetValue(TKey key, out IList value) { return _dictionary.TryGetValue(key, out value); } /// /// Gets or sets the item with the specified key. /// /// The key of the item to get or set. /// The value of the specified key. public IList this[TKey key] { get => _dictionary[key]; set => _dictionary[key] = value; } /// /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. /// public ICollection Keys => _dictionary.Keys; /// /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. /// public ICollection> Values => _dictionary.Values; /// /// Copy the items of the Multimap to an System.Array, /// starting at a particular System.Array index. /// /// The one-dimensional System.Array that is the destination of the items copied /// from Multimap. The System.Array must have zero-based indexing. /// The zero-based index in array at which copying begins. public void CopyTo(Array array, int index) { ((ICollection)_dictionary).CopyTo(array, index); } /// /// Adds an item with the provided key and value to the Multimap. /// /// The object to use as the key of the item to add. /// The object to use as the value of the item to add. /// Thrown when couldn't add value to Multimap. public void Add(TKey key, TValue value) { if (value != null) { if (_dictionary.TryGetValue(key, out var list)) { list.Add(value); } else { list = new List { value }; if (!TryAdd(key, list)) throw new InvalidOperationException("Could not add value to Multimap."); } } } #endregion Public Members #region Private Members /** * Helper method to encapsulate generator differences between dictionary types. */ private bool TryRemove(TKey key, out IList value) { _dictionary.TryGetValue(key, out value); return _dictionary.Remove(key); } /** * Helper method to encapsulate generator differences between dictionary types. */ private bool TryAdd(TKey key, IList value) { try { _dictionary.Add(key, value); } catch (ArgumentException) { return false; } return true; } #endregion Private Members } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types /// public class OpenAPIDateConverter : IsoDateTimeConverter { /// /// Initializes a new instance of the class. /// public OpenAPIDateConverter() { // full-date = date-fullyear "-" date-month "-" date-mday DateTimeFormat = "yyyy-MM-dd"; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// A container for generalized request inputs. This type allows consumers to extend the request functionality /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). /// public class RequestOptions { /// /// Parameters to be bound to path parts of the Request's URL /// public Dictionary PathParameters { get; set; } /// /// Query parameters to be applied to the request. /// Keys may have 1 or more values associated. /// public Multimap QueryParameters { get; set; } /// /// Header parameters to be applied to the request. /// Keys may have 1 or more values associated. /// public Multimap HeaderParameters { get; set; } /// /// Form parameters to be sent along with the request. /// public Dictionary FormParameters { get; set; } /// /// File parameters to be sent along with the request. /// public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. /// public List Cookies { get; set; } /// /// Operation associated with the request path. /// public string Operation { get; set; } /// /// Index associated with the operation. /// public int OperationIndex { get; set; } /// /// Any data associated with a request body. /// public Object Data { get; set; } /// /// Constructs a new instance of /// public RequestOptions() { PathParameters = new Dictionary(); QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); FileParameters = new Multimap(); Cookies = new List(); } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Client { /// /// Configuration class to set the polly retry policies to be applied to the requests. /// public static class RetryConfiguration { /// /// Retry policy /// public static Policy RetryPolicy { get; set; } /// /// Async retry policy /// public static AsyncPolicy AsyncRetryPolicy { get; set; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification /// public abstract partial class AbstractOpenAPISchema { /// /// Custom JSON serializer /// static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, MissingMemberHandling = MissingMemberHandling.Error, ContractResolver = new DefaultContractResolver { NamingStrategy = new CamelCaseNamingStrategy { OverrideSpecifiedNames = false } } }; /// /// Custom JSON serializer for objects with additional properties /// static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, MissingMemberHandling = MissingMemberHandling.Ignore, ContractResolver = new DefaultContractResolver { NamingStrategy = new CamelCaseNamingStrategy { OverrideSpecifiedNames = false } } }; /// /// Gets or Sets the actual instance /// public abstract Object ActualInstance { get; set; } /// /// Gets or Sets IsNullable to indicate whether the instance is nullable /// public bool IsNullable { get; protected set; } /// /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` /// public string SchemaType { get; protected set; } /// /// Converts the instance into JSON string. /// public abstract string ToJson(); } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Ship berth used for a ship call /// [DataContract(Name = "berth")] public partial class Berth : IValidatableObject { /// /// Initializes a new instance of the class. /// /// id. /// name. /// Optional reference to a participant (terminal). /// Optional reference to a participant (port authority). /// If true lock must be passed. /// Required reference to a port. /// Readonly field set by the database when berth was created. /// Readonly field set by the database when berth was last modified. /// marks the berth as logically 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?), int portId = default(int), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; this.OwnerId = ownerId; this.AuthorityId = authorityId; this.Lock = varLock; this.PortId = portId; this.Created = created; this.Modified = modified; this.Deleted = deleted; } /// /// Gets or Sets Id /// /// 3 [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets Name /// /// Pier 1 [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } /// /// Optional reference to a participant (terminal) /// /// Optional reference to a participant (terminal) /// 5 [DataMember(Name = "owner_id", EmitDefaultValue = true)] public int? OwnerId { get; set; } /// /// Optional reference to a participant (port authority) /// /// Optional reference to a participant (port authority) /// 6 [DataMember(Name = "authority_id", EmitDefaultValue = true)] public int? AuthorityId { get; set; } /// /// If true lock must be passed /// /// If true lock must be passed /// true [DataMember(Name = "lock", EmitDefaultValue = true)] public bool? Lock { get; set; } /// /// Required reference to a port /// /// Required reference to a port /// 1 [DataMember(Name = "port_id", EmitDefaultValue = true)] public int PortId { get; set; } /// /// Readonly field set by the database when berth was created /// /// Readonly field set by the database when berth was created /// 2023-08-21T08:23:35Z [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Readonly field set by the database when berth was last modified /// /// Readonly field set by the database when berth was last modified /// 2023-08-21T08:23:35Z [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { get; set; } /// /// marks the berth as logically deleted /// /// marks the berth as logically deleted /// false [DataMember(Name = "deleted", EmitDefaultValue = true)] public bool Deleted { 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 Berth {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" OwnerId: ").Append(OwnerId).Append("\n"); sb.Append(" AuthorityId: ").Append(AuthorityId).Append("\n"); sb.Append(" Lock: ").Append(Lock).Append("\n"); sb.Append(" PortId: ").Append(PortId).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n"); sb.Append(" Deleted: ").Append(Deleted).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Name (string) maxLength if (this.Name != null && this.Name.Length > 128) { yield return new ValidationResult("Invalid value for Name, length must be less than 128.", new [] { "Name" }); } yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Login credentials for the user /// [DataContract(Name = "credentials")] public partial class Credentials : IValidatableObject { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected Credentials() { } /// /// Initializes a new instance of the class. /// /// username (required). /// password (required). public Credentials(string username = default(string), string password = default(string)) { // to ensure "username" is required (not null) if (username == null) { throw new ArgumentNullException("username is a required property for Credentials and cannot be null"); } this.Username = username; // to ensure "password" is required (not null) if (password == null) { throw new ArgumentNullException("password is a required property for Credentials and cannot be null"); } this.Password = password; } /// /// Gets or Sets Username /// /// alfred [DataMember(Name = "username", IsRequired = true, EmitDefaultValue = true)] public string Username { get; set; } /// /// Gets or Sets Password /// /// 123456 [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = true)] public string Password { 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 Credentials {\n"); sb.Append(" Username: ").Append(Username).Append("\n"); sb.Append(" Password: ").Append(Password).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Structure returned when invalid data (bad request) is created. /// [DataContract(Name = "Error")] public partial class Error : IValidatableObject { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected Error() { } /// /// Initializes a new instance of the class. /// /// Input field that caused the error or general error message (required). /// Detailed description if error_field was an input field. public Error(string errorField = default(string), string errorDescription = default(string)) { // to ensure "errorField" is required (not null) if (errorField == null) { throw new ArgumentNullException("errorField is a required property for Error and cannot be null"); } this.ErrorField = errorField; this.ErrorDescription = errorDescription; } /// /// Input field that caused the error or general error message /// /// Input field that caused the error or general error message /// eta [DataMember(Name = "error_field", IsRequired = true, EmitDefaultValue = true)] public string ErrorField { get; set; } /// /// Detailed description if error_field was an input field /// /// Detailed description if error_field was an input field /// eta must be in the future [DataMember(Name = "error_description", EmitDefaultValue = true)] public string ErrorDescription { 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 Error {\n"); sb.Append(" ErrorField: ").Append(ErrorField).Append("\n"); sb.Append(" ErrorDescription: ").Append(ErrorDescription).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Evaluation of the ship call /// /// Evaluation of the ship call [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 * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.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 : 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 /// /// 3 [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets ParticipantId /// /// 5 [DataMember(Name = "participant_id", EmitDefaultValue = true)] public int ParticipantId { get; set; } /// /// Gets or Sets ShipcallId /// /// 42 [DataMember(Name = "shipcall_id", EmitDefaultValue = true)] public int ShipcallId { get; set; } /// /// Gets or Sets Timestamp /// /// 2023-08-21T08:23:35Z [DataMember(Name = "timestamp", EmitDefaultValue = true)] public DateTime Timestamp { get; set; } /// /// Gets or Sets Eta /// /// 2023-08-21T08:23:35Z [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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// A unique identifier for an entity /// [DataContract(Name = "Id")] public partial class Id : IValidatableObject { /// /// Initializes a new instance of the class. /// /// varId. public Id(int varId = default(int)) { this.VarId = varId; } /// /// Gets or Sets VarId /// /// 42 [DataMember(Name = "id", EmitDefaultValue = true)] public int VarId { 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 Id {\n"); sb.Append(" VarId: ").Append(VarId).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// result structure of a successful login attempt /// [DataContract(Name = "login_result")] public partial class LoginResult : IValidatableObject { /// /// Initializes a new instance of the class. /// /// id. /// participantId. /// firstName. /// lastName. /// userName. /// userPhone. /// userEmail. /// exp. /// token. public LoginResult(int id = default(int), int participantId = default(int), string firstName = default(string), string lastName = default(string), string userName = default(string), string userPhone = default(string), string userEmail = default(string), float exp = default(float), string token = default(string)) { this.Id = id; this.ParticipantId = participantId; this.FirstName = firstName; this.LastName = lastName; this.UserName = userName; this.UserPhone = userPhone; this.UserEmail = userEmail; this.Exp = exp; this.Token = token; } /// /// Gets or Sets Id /// /// 42 [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets ParticipantId /// /// 5 [DataMember(Name = "participant_id", EmitDefaultValue = true)] public int ParticipantId { get; set; } /// /// Gets or Sets FirstName /// /// John [DataMember(Name = "first_name", EmitDefaultValue = true)] public string FirstName { get; set; } /// /// Gets or Sets LastName /// /// Doe [DataMember(Name = "last_name", EmitDefaultValue = true)] public string LastName { get; set; } /// /// Gets or Sets UserName /// /// johndoe [DataMember(Name = "user_name", EmitDefaultValue = true)] public string UserName { get; set; } /// /// Gets or Sets UserPhone /// /// 1234567890 [DataMember(Name = "user_phone", EmitDefaultValue = true)] public string UserPhone { get; set; } /// /// Gets or Sets UserEmail /// /// no@where.com [DataMember(Name = "user_email", EmitDefaultValue = true)] public string UserEmail { get; set; } /// /// Gets or Sets Exp /// /// 1630000000 [DataMember(Name = "exp", EmitDefaultValue = true)] public float Exp { get; set; } /// /// Gets or Sets Token /// /// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c [DataMember(Name = "token", EmitDefaultValue = true)] public string Token { 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 LoginResult {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" ParticipantId: ").Append(ParticipantId).Append("\n"); sb.Append(" FirstName: ").Append(FirstName).Append("\n"); sb.Append(" LastName: ").Append(LastName).Append("\n"); sb.Append(" UserName: ").Append(UserName).Append("\n"); sb.Append(" UserPhone: ").Append(UserPhone).Append("\n"); sb.Append(" UserEmail: ").Append(UserEmail).Append("\n"); sb.Append(" Exp: ").Append(Exp).Append("\n"); sb.Append(" Token: ").Append(Token).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// a notification created by the engine if a times entry violates a rule /// [DataContract(Name = "notification")] public partial class Notification : IValidatableObject { /// /// Gets or Sets NotificationType /// [DataMember(Name = "notification_type", EmitDefaultValue = true)] public NotificationType? NotificationType { get; set; } /// /// Initializes a new instance of the class. /// /// id. /// shipcallId. /// notificationType. /// message. /// Readonly field set by the database when notification was created. /// Readonly field set by the database when notification was last modified. 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.ShipcallId = shipcallId; this.NotificationType = notificationType; this.Message = message; this.Created = created; this.Modified = modified; } /// /// Gets or Sets Id /// /// 42 [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets ShipcallId /// /// 5 [DataMember(Name = "shipcall_id", EmitDefaultValue = true)] public int ShipcallId { get; set; } /// /// Gets or Sets Message /// /// Entry XY violates rule Z [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } /// /// Readonly field set by the database when notification was created /// /// Readonly field set by the database when notification was created /// 2023-08-21T08:23:35Z [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Readonly field set by the database when notification was last modified /// /// Readonly field set by the database when notification was last modified /// 2023-08-21T08:23:35Z [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { 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 Notification {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" ShipcallId: ").Append(ShipcallId).Append("\n"); sb.Append(" NotificationType: ").Append(NotificationType).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"); 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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Type of notification /// /// Type of notification [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.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Type of object that was changed /// /// Type of object that was changed [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.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Type of operation that was performed /// /// Type of operation that was performed [JsonConverter(typeof(StringEnumConverter))] public enum OperationType { /// /// Enum Undefined for value: undefined /// [EnumMember(Value = "undefined")] Undefined = 1, /// /// Enum Insert for value: insert /// [EnumMember(Value = "insert")] Insert = 2, /// /// Enum Update for value: update /// [EnumMember(Value = "update")] Update = 3, /// /// Enum Delete for value: delete /// [EnumMember(Value = "delete")] Delete = 4 } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// A organisational entity that participates in Bremen Calling /// [DataContract(Name = "participant")] public partial class Participant : IValidatableObject { /// /// Initializes a new instance of the class. /// /// id. /// name. /// street. /// postalCode. /// city. /// a logical combination (bitflag) of possible values. This cannot be encoded in a Enumeration type with discrete values in OpenAPI version < 3.1.. /// Bit-encoded flag array for internal use. /// ports. /// Readonly field set by the database when participant was created. /// Readonly field set by the database when participant was last modified. /// marks the participant as logically 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?), List ports = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; this.Street = street; this.PostalCode = postalCode; this.City = city; this.Type = type; this.Flags = flags; this.Ports = ports; this.Created = created; this.Modified = modified; this.Deleted = deleted; } /// /// Gets or Sets Id /// /// 42 [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets Name /// /// BSMD [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } /// /// Gets or Sets Street /// /// Hermann-Hollerith-Str. 7 [DataMember(Name = "street", EmitDefaultValue = true)] public string Street { get; set; } /// /// Gets or Sets PostalCode /// /// 28359 [DataMember(Name = "postal code", EmitDefaultValue = true)] public string PostalCode { get; set; } /// /// Gets or Sets City /// /// Bremen [DataMember(Name = "city", EmitDefaultValue = true)] public string City { get; set; } /// /// a logical combination (bitflag) of possible values. This cannot be encoded in a Enumeration type with discrete values in OpenAPI version < 3.1. /// /// a logical combination (bitflag) of possible values. This cannot be encoded in a Enumeration type with discrete values in OpenAPI version < 3.1. /// 10 [DataMember(Name = "type", EmitDefaultValue = true)] public int Type { get; set; } /// /// Bit-encoded flag array for internal use /// /// Bit-encoded flag array for internal use /// 0 [DataMember(Name = "flags", EmitDefaultValue = true)] public int? Flags { get; set; } /// /// Gets or Sets Ports /// /// [1,2] [DataMember(Name = "ports", EmitDefaultValue = true)] public List Ports { get; set; } /// /// Readonly field set by the database when participant was created /// /// Readonly field set by the database when participant was created /// 2023-08-21T08:23:35Z [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Readonly field set by the database when participant was last modified /// /// Readonly field set by the database when participant was last modified /// 2023-08-21T08:23:35Z [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { get; set; } /// /// marks the participant as logically deleted /// /// marks the participant as logically deleted /// false [DataMember(Name = "deleted", EmitDefaultValue = true)] public bool Deleted { 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 Participant {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Street: ").Append(Street).Append("\n"); sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); sb.Append(" City: ").Append(City).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Flags: ").Append(Flags).Append("\n"); sb.Append(" Ports: ").Append(Ports).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n"); sb.Append(" Deleted: ").Append(Deleted).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Name (string) maxLength if (this.Name != null && this.Name.Length > 128) { yield return new ValidationResult("Invalid value for Name, length must be less than 128.", new [] { "Name" }); } // Street (string) maxLength if (this.Street != null && this.Street.Length > 128) { yield return new ValidationResult("Invalid value for Street, length must be less than 128.", new [] { "Street" }); } // PostalCode (string) maxLength if (this.PostalCode != null && this.PostalCode.Length > 5) { yield return new ValidationResult("Invalid value for PostalCode, length must be less than 5.", new [] { "PostalCode" }); } // City (string) maxLength if (this.City != null && this.City.Length > 64) { yield return new ValidationResult("Invalid value for City, length must be less than 64.", new [] { "City" }); } yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Participant assigned to a shipcall with a given role (type) /// [DataContract(Name = "participant_assignment")] public partial class ParticipantAssignment : IValidatableObject { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected ParticipantAssignment() { } /// /// Initializes a new instance of the class. /// /// participantId (required). /// Possible role values: 1: BSMD 2: TERMINAL, 4: PILOT, 8: AGENCY, 16: MOORING, 32: PORT_ADMINISTRATION, 64: TUG. A participant may appear multiple times with different roles. (required). public ParticipantAssignment(int participantId = default(int), int type = default(int)) { this.ParticipantId = participantId; this.Type = type; } /// /// Gets or Sets ParticipantId /// /// 5 [DataMember(Name = "participant_id", IsRequired = true, EmitDefaultValue = true)] public int ParticipantId { get; set; } /// /// Possible role values: 1: BSMD 2: TERMINAL, 4: PILOT, 8: AGENCY, 16: MOORING, 32: PORT_ADMINISTRATION, 64: TUG. A participant may appear multiple times with different roles. /// /// Possible role values: 1: BSMD 2: TERMINAL, 4: PILOT, 8: AGENCY, 16: MOORING, 32: PORT_ADMINISTRATION, 64: TUG. A participant may appear multiple times with different roles. /// 4 [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public int Type { 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 ParticipantAssignment {\n"); sb.Append(" ParticipantId: ").Append(ParticipantId).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Record of port data /// [DataContract(Name = "port")] public partial class Port : IValidatableObject { /// /// Initializes a new instance of the class. /// /// id. /// name. /// locode. /// Readonly field set by the database when port was created. /// Readonly field set by the database when port was last modified. /// marks the port as logically deleted (default to false). public Port(int id = default(int), string name = default(string), string locode = default(string), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; this.Locode = locode; this.Created = created; this.Modified = modified; this.Deleted = deleted; } /// /// Gets or Sets Id /// /// 2 [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets Name /// /// Hamburg [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } /// /// Gets or Sets Locode /// /// DEHAM [DataMember(Name = "locode", EmitDefaultValue = true)] public string Locode { get; set; } /// /// Readonly field set by the database when port was created /// /// Readonly field set by the database when port was created /// 2023-08-21T08:23:35Z [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Readonly field set by the database when port was last modified /// /// Readonly field set by the database when port was last modified /// 2023-08-21T08:23:35Z [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { get; set; } /// /// marks the port as logically deleted /// /// marks the port as logically deleted /// false [DataMember(Name = "deleted", EmitDefaultValue = true)] public bool Deleted { 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 Port {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Locode: ").Append(Locode).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n"); sb.Append(" Deleted: ").Append(Deleted).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Id (int) minimum if (this.Id < (int)1) { yield return new ValidationResult("Invalid value for Id, must be a value greater than or equal to 1.", new [] { "Id" }); } // Locode (string) maxLength if (this.Locode != null && this.Locode.Length > 5) { yield return new ValidationResult("Invalid value for Locode, length must be less than 5.", new [] { "Locode" }); } // Locode (string) minLength if (this.Locode != null && this.Locode.Length < 5) { yield return new ValidationResult("Invalid value for Locode, length must be greater than 5.", new [] { "Locode" }); } yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// a ship /// [DataContract(Name = "ship")] public partial class Ship : IValidatableObject { /// /// Initializes a new instance of the class. /// /// id. /// name. /// imo. /// callsign. /// Optional reference to participant (tug role). /// length. /// width. /// isTug (default to false). /// bollardPull. /// BSMD internal use. /// Readonly field set by the database when ship was created. /// Readonly field set by the database when ship was last modified. /// marks the ship as logically 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?), double? length = default(double?), double? width = default(double?), 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; this.Imo = imo; this.Callsign = callsign; this.ParticipantId = participantId; this.Length = length; this.Width = width; this.IsTug = isTug; this.BollardPull = bollardPull; this.Eni = eni; this.Created = created; this.Modified = modified; this.Deleted = deleted; } /// /// Gets or Sets Id /// /// 8 [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets Name /// /// MS Bremen [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } /// /// Gets or Sets Imo /// /// 1234567 [DataMember(Name = "imo", EmitDefaultValue = true)] public int? Imo { get; set; } /// /// Gets or Sets Callsign /// /// DBRE [DataMember(Name = "callsign", EmitDefaultValue = true)] public string Callsign { get; set; } /// /// Optional reference to participant (tug role) /// /// Optional reference to participant (tug role) /// 9 [DataMember(Name = "participant_id", EmitDefaultValue = true)] public int? ParticipantId { get; set; } /// /// Gets or Sets Length /// /// 200 [DataMember(Name = "length", EmitDefaultValue = true)] public double? Length { get; set; } /// /// Gets or Sets Width /// /// 30 [DataMember(Name = "width", EmitDefaultValue = true)] public double? Width { get; set; } /// /// Gets or Sets IsTug /// /// false [DataMember(Name = "is_tug", EmitDefaultValue = true)] public bool IsTug { get; set; } /// /// Gets or Sets BollardPull /// /// 100 [DataMember(Name = "bollard_pull", EmitDefaultValue = true)] public int? BollardPull { get; set; } /// /// BSMD internal use /// /// BSMD internal use /// 1234567 [DataMember(Name = "eni", EmitDefaultValue = true)] public int? Eni { get; set; } /// /// Readonly field set by the database when ship was created /// /// Readonly field set by the database when ship was created /// 2023-08-21T08:23:35Z [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Readonly field set by the database when ship was last modified /// /// Readonly field set by the database when ship was last modified /// 2023-08-21T08:23:35Z [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { get; set; } /// /// marks the ship as logically deleted /// /// marks the ship as logically deleted /// false [DataMember(Name = "deleted", EmitDefaultValue = true)] public bool Deleted { 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 Ship {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Imo: ").Append(Imo).Append("\n"); sb.Append(" Callsign: ").Append(Callsign).Append("\n"); sb.Append(" ParticipantId: ").Append(ParticipantId).Append("\n"); sb.Append(" Length: ").Append(Length).Append("\n"); sb.Append(" Width: ").Append(Width).Append("\n"); sb.Append(" IsTug: ").Append(IsTug).Append("\n"); sb.Append(" BollardPull: ").Append(BollardPull).Append("\n"); sb.Append(" Eni: ").Append(Eni).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n"); sb.Append(" Deleted: ").Append(Deleted).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Name (string) maxLength if (this.Name != null && this.Name.Length > 64) { yield return new ValidationResult("Invalid value for Name, length must be less than 64.", new [] { "Name" }); } // Callsign (string) maxLength if (this.Callsign != null && this.Callsign.Length > 8) { yield return new ValidationResult("Invalid value for Callsign, length must be less than 8.", new [] { "Callsign" }); } yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Ship call data /// [DataContract(Name = "shipcall")] public partial class Shipcall : IValidatableObject { /// /// Gets or Sets Type /// [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] protected Shipcall() { } /// /// Initializes a new instance of the class. /// /// id. /// shipId (required). /// portId. /// type (required). /// eta. /// voyage. /// etd. /// arrivalBerthId. /// departureBerthId. /// tugRequired. /// pilotRequired. /// flags. /// pierSide. /// bunkering. /// replenishingTerminal. /// replenishingLock. /// draft. /// tidalWindowFrom. /// tidalWindowTo. /// rainSensitiveCargo. /// recommendedTugs. /// anchored. /// mooredLock. /// canceled. /// evaluation. /// Physical reference point for all times given in shipcall and depending times entries. /// participants. /// Readonly field set by the database when shipcall was created. /// Readonly field set by the database when shipcall was last modified. public Shipcall(int id = default(int), int shipId = default(int), int portId = default(int), ShipcallType type = default(ShipcallType), DateTime? eta = default(DateTime?), string voyage = default(string), DateTime? etd = default(DateTime?), int? arrivalBerthId = default(int?), int? departureBerthId = default(int?), bool? tugRequired = default(bool?), bool? pilotRequired = default(bool?), int? flags = default(int?), bool? pierSide = default(bool?), bool? bunkering = default(bool?), bool? replenishingTerminal = default(bool?), bool? replenishingLock = default(bool?), double? draft = default(double?), DateTime? tidalWindowFrom = default(DateTime?), DateTime? tidalWindowTo = default(DateTime?), bool? rainSensitiveCargo = default(bool?), int? recommendedTugs = default(int?), bool? anchored = default(bool?), bool? mooredLock = default(bool?), bool? canceled = default(bool?), EvaluationType? evaluation = default(EvaluationType?), int? timeRefPoint = default(int?), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.ShipId = shipId; this.Type = type; this.Id = id; this.PortId = portId; this.Eta = eta; this.Voyage = voyage; this.Etd = etd; this.ArrivalBerthId = arrivalBerthId; this.DepartureBerthId = departureBerthId; this.TugRequired = tugRequired; this.PilotRequired = pilotRequired; this.Flags = flags; this.PierSide = pierSide; this.Bunkering = bunkering; this.ReplenishingTerminal = replenishingTerminal; this.ReplenishingLock = replenishingLock; this.Draft = draft; this.TidalWindowFrom = tidalWindowFrom; this.TidalWindowTo = tidalWindowTo; this.RainSensitiveCargo = rainSensitiveCargo; this.RecommendedTugs = recommendedTugs; this.Anchored = anchored; this.MooredLock = mooredLock; this.Canceled = canceled; this.Evaluation = evaluation; this.TimeRefPoint = timeRefPoint; this.Participants = participants; this.Created = created; this.Modified = modified; } /// /// Gets or Sets Id /// /// 6 [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets ShipId /// /// 8 [DataMember(Name = "ship_id", IsRequired = true, EmitDefaultValue = true)] public int ShipId { get; set; } /// /// Gets or Sets PortId /// /// 3 [DataMember(Name = "port_id", EmitDefaultValue = true)] public int PortId { get; set; } /// /// Gets or Sets Eta /// /// 2023-08-21T08:23:35Z [DataMember(Name = "eta", EmitDefaultValue = true)] public DateTime? Eta { get; set; } /// /// Gets or Sets Voyage /// /// Voyage 123 [DataMember(Name = "voyage", EmitDefaultValue = true)] public string Voyage { get; set; } /// /// Gets or Sets Etd /// /// 2023-08-21T08:23:35Z [DataMember(Name = "etd", EmitDefaultValue = true)] public DateTime? Etd { get; set; } /// /// Gets or Sets ArrivalBerthId /// /// 3 [DataMember(Name = "arrival_berth_id", EmitDefaultValue = true)] public int? ArrivalBerthId { get; set; } /// /// Gets or Sets DepartureBerthId /// /// 4 [DataMember(Name = "departure_berth_id", EmitDefaultValue = true)] public int? DepartureBerthId { get; set; } /// /// Gets or Sets TugRequired /// /// true [DataMember(Name = "tug_required", EmitDefaultValue = true)] public bool? TugRequired { get; set; } /// /// Gets or Sets PilotRequired /// /// true [DataMember(Name = "pilot_required", EmitDefaultValue = true)] public bool? PilotRequired { get; set; } /// /// Gets or Sets Flags /// /// 1 [DataMember(Name = "flags", EmitDefaultValue = true)] public int? Flags { get; set; } /// /// Gets or Sets PierSide /// /// false [DataMember(Name = "pier_side", EmitDefaultValue = true)] public bool? PierSide { get; set; } /// /// Gets or Sets Bunkering /// /// false [DataMember(Name = "bunkering", EmitDefaultValue = true)] public bool? Bunkering { get; set; } /// /// Gets or Sets ReplenishingTerminal /// /// false [DataMember(Name = "replenishing_terminal", EmitDefaultValue = true)] public bool? ReplenishingTerminal { get; set; } /// /// Gets or Sets ReplenishingLock /// /// false [DataMember(Name = "replenishing_lock", EmitDefaultValue = true)] public bool? ReplenishingLock { get; set; } /// /// Gets or Sets Draft /// /// 10.5 [DataMember(Name = "draft", EmitDefaultValue = true)] public double? Draft { get; set; } /// /// Gets or Sets TidalWindowFrom /// /// 2023-08-21T08:23:35Z [DataMember(Name = "tidal_window_from", EmitDefaultValue = true)] public DateTime? TidalWindowFrom { get; set; } /// /// Gets or Sets TidalWindowTo /// /// 2023-08-21T08:23:35Z [DataMember(Name = "tidal_window_to", EmitDefaultValue = true)] public DateTime? TidalWindowTo { get; set; } /// /// Gets or Sets RainSensitiveCargo /// /// false [DataMember(Name = "rain_sensitive_cargo", EmitDefaultValue = true)] public bool? RainSensitiveCargo { get; set; } /// /// Gets or Sets RecommendedTugs /// /// 2 [DataMember(Name = "recommended_tugs", EmitDefaultValue = true)] public int? RecommendedTugs { get; set; } /// /// Gets or Sets Anchored /// /// false [DataMember(Name = "anchored", EmitDefaultValue = true)] public bool? Anchored { get; set; } /// /// Gets or Sets MooredLock /// /// false [DataMember(Name = "moored_lock", EmitDefaultValue = true)] public bool? MooredLock { get; set; } /// /// Gets or Sets Canceled /// /// false [DataMember(Name = "canceled", EmitDefaultValue = true)] public bool? Canceled { get; set; } /// /// Gets or Sets EvaluationMessage /// /// Time window too short [DataMember(Name = "evaluation_message", EmitDefaultValue = true)] public string EvaluationMessage { get; private set; } /// /// Returns false as EvaluationMessage should not be serialized given that it's read-only. /// /// false (boolean) public bool ShouldSerializeEvaluationMessage() { return false; } public bool ShouldSerializeEvaluation() { return false; } /// /// Physical reference point for all times given in shipcall and depending times entries /// /// Physical reference point for all times given in shipcall and depending times entries /// 1 [DataMember(Name = "time_ref_point", EmitDefaultValue = true)] public int? TimeRefPoint { get; set; } /// /// Gets or Sets Participants /// /// [{"participant_id":5,"type":4},{"participant_id":6,"type":8}] [DataMember(Name = "participants", EmitDefaultValue = true)] public List Participants { get; set; } /// /// Readonly field set by the database when shipcall was created /// /// Readonly field set by the database when shipcall was created /// 2023-08-21T08:23:35Z [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Readonly field set by the database when shipcall was last modified /// /// Readonly field set by the database when shipcall was last modified /// 2023-08-21T08:23:35Z [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { 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 Shipcall {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" ShipId: ").Append(ShipId).Append("\n"); sb.Append(" PortId: ").Append(PortId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Eta: ").Append(Eta).Append("\n"); sb.Append(" Voyage: ").Append(Voyage).Append("\n"); sb.Append(" Etd: ").Append(Etd).Append("\n"); sb.Append(" ArrivalBerthId: ").Append(ArrivalBerthId).Append("\n"); sb.Append(" DepartureBerthId: ").Append(DepartureBerthId).Append("\n"); sb.Append(" TugRequired: ").Append(TugRequired).Append("\n"); sb.Append(" PilotRequired: ").Append(PilotRequired).Append("\n"); sb.Append(" Flags: ").Append(Flags).Append("\n"); sb.Append(" PierSide: ").Append(PierSide).Append("\n"); sb.Append(" Bunkering: ").Append(Bunkering).Append("\n"); sb.Append(" ReplenishingTerminal: ").Append(ReplenishingTerminal).Append("\n"); sb.Append(" ReplenishingLock: ").Append(ReplenishingLock).Append("\n"); sb.Append(" Draft: ").Append(Draft).Append("\n"); sb.Append(" TidalWindowFrom: ").Append(TidalWindowFrom).Append("\n"); sb.Append(" TidalWindowTo: ").Append(TidalWindowTo).Append("\n"); sb.Append(" RainSensitiveCargo: ").Append(RainSensitiveCargo).Append("\n"); sb.Append(" RecommendedTugs: ").Append(RecommendedTugs).Append("\n"); sb.Append(" Anchored: ").Append(Anchored).Append("\n"); sb.Append(" MooredLock: ").Append(MooredLock).Append("\n"); sb.Append(" Canceled: ").Append(Canceled).Append("\n"); sb.Append(" Evaluation: ").Append(Evaluation).Append("\n"); sb.Append(" EvaluationMessage: ").Append(EvaluationMessage).Append("\n"); sb.Append(" TimeRefPoint: ").Append(TimeRefPoint).Append("\n"); sb.Append(" Participants: ").Append(Participants).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Voyage (string) maxLength if (this.Voyage != null && this.Voyage.Length > 16) { yield return new ValidationResult("Invalid value for Voyage, length must be less than 16.", new [] { "Voyage" }); } // EvaluationMessage (string) maxLength if (this.EvaluationMessage != null && this.EvaluationMessage.Length > 512) { yield return new ValidationResult("Invalid value for EvaluationMessage, length must be less than 512.", new [] { "EvaluationMessage" }); } yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Type of ship call /// /// Type of ship call [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.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// the id parameter needs to be missing on POST and to be present on PUT (Update) calls, otherwise a 400 response will be generated /// [DataContract(Name = "times")] public partial class Times : IValidatableObject { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected Times() { } /// /// Initializes a new instance of the class. /// /// id. /// Arrival time at berth. /// If true, the eta is fixed and cannot be changed. /// departure time from berth. /// If true, the etd is fixed and cannot be changed. /// arrival time at lock. /// If true, the lock time is fixed and cannot be changed. /// Expected time of entry into the zone. /// If true, the zone entry time is fixed and cannot be changed. /// Start time for terminal operations. /// End time for terminal operations. /// Additional remarks. /// Reference to a shipcall id (required). /// Reference to a participant id (required). /// Reference to a berth id. /// Additional info text for berth. /// true if ship is rotated, false otherwise. /// participantType. /// ata can be set by mooring if actual times are different from planned. /// atd can be set by mooring if actual times are different from planned. /// Optional end of the interval for the times eta entry. /// Optional end of the interval for the times etd entry. /// Readonly field set by the database when times record was created. /// Readonly field set by the database when times record was last 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? ata = default(DateTime?), DateTime? atd = default(DateTime?), DateTime? etaIntervalEnd = default(DateTime?), DateTime? etdIntervalEnd = default(DateTime?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.ShipcallId = shipcallId; this.ParticipantId = participantId; this.Id = id; this.EtaBerth = etaBerth; this.EtaBerthFixed = etaBerthFixed; this.EtdBerth = etdBerth; this.EtdBerthFixed = etdBerthFixed; this.LockTime = lockTime; this.LockTimeFixed = lockTimeFixed; this.ZoneEntry = zoneEntry; this.ZoneEntryFixed = zoneEntryFixed; this.OperationsStart = operationsStart; this.OperationsEnd = operationsEnd; this.Remarks = remarks; this.BerthId = berthId; this.BerthInfo = berthInfo; this.PierSide = pierSide; this.ParticipantType = participantType; this.Ata = ata; this.Atd = atd; this.EtaIntervalEnd = etaIntervalEnd; this.EtdIntervalEnd = etdIntervalEnd; this.Created = created; this.Modified = modified; } /// /// Gets or Sets Id /// /// 2 [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Arrival time at berth /// /// Arrival time at berth /// 2023-08-21T08:23:35Z [DataMember(Name = "eta_berth", EmitDefaultValue = true)] public DateTime? EtaBerth { get; set; } /// /// If true, the eta is fixed and cannot be changed /// /// If true, the eta is fixed and cannot be changed /// true [DataMember(Name = "eta_berth_fixed", EmitDefaultValue = true)] public bool? EtaBerthFixed { get; set; } /// /// departure time from berth /// /// departure time from berth /// 2023-08-21T08:23:35Z [DataMember(Name = "etd_berth", EmitDefaultValue = true)] public DateTime? EtdBerth { get; set; } /// /// If true, the etd is fixed and cannot be changed /// /// If true, the etd is fixed and cannot be changed /// true [DataMember(Name = "etd_berth_fixed", EmitDefaultValue = true)] public bool? EtdBerthFixed { get; set; } /// /// arrival time at lock /// /// arrival time at lock /// 2023-08-21T08:23:35Z [DataMember(Name = "lock_time", EmitDefaultValue = true)] public DateTime? LockTime { get; set; } /// /// If true, the lock time is fixed and cannot be changed /// /// If true, the lock time is fixed and cannot be changed /// true [DataMember(Name = "lock_time_fixed", EmitDefaultValue = true)] public bool? LockTimeFixed { get; set; } /// /// Expected time of entry into the zone /// /// Expected time of entry into the zone /// 2023-08-21T08:23:35Z [DataMember(Name = "zone_entry", EmitDefaultValue = true)] public DateTime? ZoneEntry { get; set; } /// /// If true, the zone entry time is fixed and cannot be changed /// /// If true, the zone entry time is fixed and cannot be changed /// true [DataMember(Name = "zone_entry_fixed", EmitDefaultValue = true)] public bool? ZoneEntryFixed { get; set; } /// /// Start time for terminal operations /// /// Start time for terminal operations /// 2023-08-21T08:23:35Z [DataMember(Name = "operations_start", EmitDefaultValue = true)] public DateTime? OperationsStart { get; set; } /// /// End time for terminal operations /// /// End time for terminal operations /// 2023-08-21T08:23:35Z [DataMember(Name = "operations_end", EmitDefaultValue = true)] public DateTime? OperationsEnd { get; set; } /// /// Additional remarks /// /// Additional remarks /// Please be aware of the strong current [DataMember(Name = "remarks", EmitDefaultValue = true)] public string Remarks { get; set; } /// /// Reference to a shipcall id /// /// Reference to a shipcall id /// 23 [DataMember(Name = "shipcall_id", IsRequired = true, EmitDefaultValue = true)] public int ShipcallId { get; set; } /// /// Reference to a participant id /// /// Reference to a participant id /// 34 [DataMember(Name = "participant_id", IsRequired = true, EmitDefaultValue = true)] public int ParticipantId { get; set; } /// /// Reference to a berth id /// /// Reference to a berth id /// 1 [DataMember(Name = "berth_id", EmitDefaultValue = true)] public int? BerthId { get; set; } /// /// Additional info text for berth /// /// Additional info text for berth /// 200m length [DataMember(Name = "berth_info", EmitDefaultValue = true)] public string BerthInfo { get; set; } /// /// true if ship is rotated, false otherwise /// /// true if ship is rotated, false otherwise /// true [DataMember(Name = "pier_side", EmitDefaultValue = true)] public bool? PierSide { get; set; } /// /// Gets or Sets ParticipantType /// /// 4 [DataMember(Name = "participant_type", EmitDefaultValue = true)] public int ParticipantType { get; set; } /// /// ata can be set by mooring if actual times are different from planned /// /// ata can be set by mooring if actual times are different from planned /// 2023-08-21T08:23:35Z [DataMember(Name = "ata", EmitDefaultValue = true)] public DateTime? Ata { get; set; } /// /// atd can be set by mooring if actual times are different from planned /// /// atd can be set by mooring if actual times are different from planned /// 2023-08-21T08:23:35Z [DataMember(Name = "atd", EmitDefaultValue = true)] public DateTime? Atd { get; set; } /// /// Optional end of the interval for the times eta entry /// /// Optional end of the interval for the times eta entry /// 2023-08-21T08:23:35Z [DataMember(Name = "eta_interval_end", EmitDefaultValue = true)] public DateTime? EtaIntervalEnd { get; set; } /// /// Optional end of the interval for the times etd entry /// /// Optional end of the interval for the times etd entry /// 2023-08-21T08:23:35Z [DataMember(Name = "etd_interval_end", EmitDefaultValue = true)] public DateTime? EtdIntervalEnd { get; set; } /// /// Readonly field set by the database when times record was created /// /// Readonly field set by the database when times record was created /// 2023-08-21T08:23:35Z [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Readonly field set by the database when times record was last modified /// /// Readonly field set by the database when times record was last modified /// 2023-08-21T08:23:35Z [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { 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 Times {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" EtaBerth: ").Append(EtaBerth).Append("\n"); sb.Append(" EtaBerthFixed: ").Append(EtaBerthFixed).Append("\n"); sb.Append(" EtdBerth: ").Append(EtdBerth).Append("\n"); sb.Append(" EtdBerthFixed: ").Append(EtdBerthFixed).Append("\n"); sb.Append(" LockTime: ").Append(LockTime).Append("\n"); sb.Append(" LockTimeFixed: ").Append(LockTimeFixed).Append("\n"); sb.Append(" ZoneEntry: ").Append(ZoneEntry).Append("\n"); sb.Append(" ZoneEntryFixed: ").Append(ZoneEntryFixed).Append("\n"); sb.Append(" OperationsStart: ").Append(OperationsStart).Append("\n"); sb.Append(" OperationsEnd: ").Append(OperationsEnd).Append("\n"); sb.Append(" Remarks: ").Append(Remarks).Append("\n"); sb.Append(" ShipcallId: ").Append(ShipcallId).Append("\n"); sb.Append(" ParticipantId: ").Append(ParticipantId).Append("\n"); sb.Append(" BerthId: ").Append(BerthId).Append("\n"); sb.Append(" BerthInfo: ").Append(BerthInfo).Append("\n"); sb.Append(" PierSide: ").Append(PierSide).Append("\n"); sb.Append(" ParticipantType: ").Append(ParticipantType).Append("\n"); sb.Append(" Ata: ").Append(Ata).Append("\n"); sb.Append(" Atd: ").Append(Atd).Append("\n"); sb.Append(" EtaIntervalEnd: ").Append(EtaIntervalEnd).Append("\n"); sb.Append(" EtdIntervalEnd: ").Append(EtdIntervalEnd).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Remarks (string) maxLength if (this.Remarks != null && this.Remarks.Length > 512) { yield return new ValidationResult("Invalid value for Remarks, length must be less than 512.", new [] { "Remarks" }); } // BerthInfo (string) maxLength if (this.BerthInfo != null && this.BerthInfo.Length > 512) { yield return new ValidationResult("Invalid value for BerthInfo, length must be less than 512.", new [] { "BerthInfo" }); } yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 1.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// fields that a user may change /// [DataContract(Name = "user_details")] public partial class UserDetails : IValidatableObject { /// /// Initializes a new instance of the class. /// /// id. /// oldPassword. /// newPassword. /// firstName. /// lastName. /// userPhone. /// userEmail. public UserDetails(int id = default(int), string oldPassword = default(string), string newPassword = default(string), string firstName = default(string), string lastName = default(string), string userPhone = default(string), string userEmail = default(string)) { this.Id = id; this.OldPassword = oldPassword; this.NewPassword = newPassword; this.FirstName = firstName; this.LastName = lastName; this.UserPhone = userPhone; this.UserEmail = userEmail; } /// /// Gets or Sets Id /// /// 42 [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets OldPassword /// /// oldpassword [DataMember(Name = "old_password", EmitDefaultValue = true)] public string OldPassword { get; set; } /// /// Gets or Sets NewPassword /// /// newpassword [DataMember(Name = "new_password", EmitDefaultValue = true)] public string NewPassword { get; set; } /// /// Gets or Sets FirstName /// /// John [DataMember(Name = "first_name", EmitDefaultValue = true)] public string FirstName { get; set; } /// /// Gets or Sets LastName /// /// Doe [DataMember(Name = "last_name", EmitDefaultValue = true)] public string LastName { get; set; } /// /// Gets or Sets UserPhone /// /// 1234567890 [DataMember(Name = "user_phone", EmitDefaultValue = true)] public string UserPhone { get; set; } /// /// Gets or Sets UserEmail /// /// no@where.com [DataMember(Name = "user_email", EmitDefaultValue = true)] public string UserEmail { 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 UserDetails {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" OldPassword: ").Append(OldPassword).Append("\n"); sb.Append(" NewPassword: ").Append(NewPassword).Append("\n"); sb.Append(" FirstName: ").Append(FirstName).Append("\n"); sb.Append(" LastName: ").Append(LastName).Append("\n"); sb.Append(" UserPhone: ").Append(UserPhone).Append("\n"); sb.Append(" UserEmail: ").Append(UserEmail).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); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // OldPassword (string) maxLength if (this.OldPassword != null && this.OldPassword.Length > 128) { yield return new ValidationResult("Invalid value for OldPassword, length must be less than 128.", new [] { "OldPassword" }); } // NewPassword (string) maxLength if (this.NewPassword != null && this.NewPassword.Length > 128) { yield return new 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 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 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 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 ValidationResult("Invalid value for UserEmail, length must be less than 128.", new [] { "UserEmail" }); } yield break; } } #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' }