//---------------------- // // Generated REST API Client Code Generator v1.8.4.0 on 01.11.2023 15:27:09 // Using the tool OpenAPI Generator v7.0.0 // //---------------------- using BreCalClient.misc.Client; using BreCalClient.misc.Model; 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: 0.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Api { #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' /// /// Represents a collection of functions to interact with the API endpoints /// public interface IDefaultApiSync : IApiAccessor { #region Synchronous Operations /// /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. /// List<Berth> List BerthsGet(int operationIndex = 0); /// /// Gets a list of all berths registered /// /// /// /// /// Thrown when fails to make API call /// Index associated with the operation. /// ApiResponse of List<Berth> ApiResponse> BerthsGetWithHttpInfo(int operationIndex = 0); /// /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials /// Index associated with the operation. /// LoginResult LoginResult LoginPost(Credentials credentials, int operationIndex = 0); /// /// Returns a JWT session token and user data if successful /// /// /// /// /// Thrown when fails to make API call /// Login credentials /// Index associated with the operation. /// ApiResponse of LoginResult ApiResponse LoginPostWithHttpInfo(Credentials credentials, int operationIndex = 0); /// /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Notification Notification NotificationsGet(int participantId, int shipcallId, int operationIndex = 0); /// /// Gets a list of notifications pursuant to a specified participant and ship call /// /// /// /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// ApiResponse of Notification ApiResponse NotificationsGetWithHttpInfo(int participantId, int shipcallId, int operationIndex = 0); /// /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) /// Index associated with the operation. /// List<Participant> List ParticipantsGet(int? userId = default(int?), int operationIndex = 0); /// /// gets a particular participant entry corresponding to user id /// /// /// /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) /// Index associated with the operation. /// ApiResponse of List<Participant> ApiResponse> ParticipantsGetWithHttpInfo(int? userId = default(int?), int operationIndex = 0); /// /// Gets a list of 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 /// /// /// /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// ApiResponse of List<Shipcall> ApiResponse> ShipcallsGetWithHttpInfo(int? pastDays = default(int?), int operationIndex = 0); /// /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Id Id ShipcallsPost(Shipcall shipcall, int operationIndex = 0); /// /// Create a new ship call /// /// /// /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// ApiResponse of Id ApiResponse ShipcallsPostWithHttpInfo(Shipcall shipcall, int operationIndex = 0); /// /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Id Id ShipcallsPut(Shipcall shipcall, int operationIndex = 0); /// /// Updates a ship call /// /// /// /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// ApiResponse of Id ApiResponse ShipcallsPutWithHttpInfo(Shipcall shipcall, int operationIndex = 0); /// /// gets a list of registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. /// List<Ship> List ShipsGet(int operationIndex = 0); /// /// gets a list of registered shipcalls /// /// /// /// /// Thrown when fails to make API call /// Index associated with the operation. /// ApiResponse of List<Ship> ApiResponse> ShipsGetWithHttpInfo(int operationIndex = 0); /// /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// /// Index associated with the operation. /// void TimesDelete(int id, int operationIndex = 0); /// /// Delete a times entry for a ship call. /// /// /// /// /// Thrown when fails to make API call /// /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse TimesDeleteWithHttpInfo(int id, int operationIndex = 0); /// /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) /// Index associated with the operation. /// List<Times> List TimesGet(int? shipcallId = default(int?), int operationIndex = 0); /// /// Get all recorded times for a a ship call /// /// /// /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) /// Index associated with the operation. /// ApiResponse of List<Times> ApiResponse> TimesGetWithHttpInfo(int? shipcallId = default(int?), int operationIndex = 0); /// /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Id Id TimesPost(Times times, int operationIndex = 0); /// /// Create a new times entry for a ship call /// /// /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. /// Index associated with the operation. /// ApiResponse of Id ApiResponse TimesPostWithHttpInfo(Times times, int operationIndex = 0); /// /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// Id Id TimesPut(Times times, int operationIndex = 0); /// /// Update a times entry for a ship call /// /// /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// ApiResponse of Id ApiResponse TimesPutWithHttpInfo(Times times, int operationIndex = 0); /// /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details /// Index associated with the operation. /// void UserPut(UserDetails userDetails, int operationIndex = 0); /// /// Update user details (first/last name, phone, password) /// /// /// /// /// Thrown when fails to make API call /// User details /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse UserPutWithHttpInfo(UserDetails userDetails, int operationIndex = 0); #endregion Synchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public interface IDefaultApiAsync : IApiAccessor { #region Asynchronous Operations /// /// Gets a list of all berths registered /// /// /// /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Berth> System.Threading.Tasks.Task> BerthsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets a list of all berths registered /// /// /// /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Berth>) System.Threading.Tasks.Task>> BerthsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns a JWT session token and user data if successful /// /// /// /// /// 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 LoginPostAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns a JWT session token and user data if successful /// /// /// /// /// 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> LoginPostWithHttpInfoAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets a list of notifications pursuant to a specified participant and ship call /// /// /// /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Notification System.Threading.Tasks.Task NotificationsGetAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets a list of notifications pursuant to a specified participant and ship call /// /// /// /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Notification) System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// gets a particular participant entry corresponding to user id /// /// /// /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Participant> System.Threading.Tasks.Task> ParticipantsGetAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// gets a particular participant entry corresponding to user id /// /// /// /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Participant>) System.Threading.Tasks.Task>> ParticipantsGetWithHttpInfoAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets a list of ship calls /// /// /// /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Shipcall> System.Threading.Tasks.Task> ShipcallsGetAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets a list of ship calls /// /// /// /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Shipcall>) System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create a new ship call /// /// /// /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id System.Threading.Tasks.Task ShipcallsPostAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create a new ship call /// /// /// /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) System.Threading.Tasks.Task> ShipcallsPostWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a ship call /// /// /// /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id System.Threading.Tasks.Task ShipcallsPutAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a ship call /// /// /// /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) System.Threading.Tasks.Task> ShipcallsPutWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// gets a list of registered shipcalls /// /// /// /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Ship> System.Threading.Tasks.Task> ShipsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// gets a list of registered shipcalls /// /// /// /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Ship>) System.Threading.Tasks.Task>> ShipsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete a times entry for a ship call. /// /// /// /// /// Thrown when fails to make API call /// /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void System.Threading.Tasks.Task TimesDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete a times entry for a ship call. /// /// /// /// /// Thrown when fails to make API call /// /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> TimesDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get all recorded times for a a ship call /// /// /// /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Times> System.Threading.Tasks.Task> TimesGetAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get all recorded times for a a ship call /// /// /// /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Times>) System.Threading.Tasks.Task>> TimesGetWithHttpInfoAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create a new times entry for a ship call /// /// /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id System.Threading.Tasks.Task TimesPostAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create a new times entry for a ship call /// /// /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) System.Threading.Tasks.Task> TimesPostWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update a times entry for a ship call /// /// /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id System.Threading.Tasks.Task TimesPutAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update a times entry for a ship call /// /// /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) System.Threading.Tasks.Task> TimesPutWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update user details (first/last name, phone, password) /// /// /// /// /// Thrown when fails to make API call /// User details /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void System.Threading.Tasks.Task UserPutAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update user details (first/last name, phone, password) /// /// /// /// /// Thrown when fails to make API call /// User details /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> UserPutWithHttpInfoAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public interface IDefaultApi : IDefaultApiSync, IDefaultApiAsync { } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class DefaultApi : IDefaultApi { private BreCalClient.misc.Client.ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public DefaultApi() : this((string)null) { } /// /// Initializes a new instance of the class. /// /// public DefaultApi(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 DefaultApi(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 DefaultApi(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 /// /// 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 /// /// 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 = "DefaultApi.BerthsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = this.Client.Get>("/berths", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("BerthsGet", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Berth> public async System.Threading.Tasks.Task> BerthsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await BerthsGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Berth>) public async System.Threading.Tasks.Task>> BerthsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // to determine the Accept header string[] _accepts = new string[] { "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Operation = "DefaultApi.BerthsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync>("/berths", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("BerthsGet", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials /// Index associated with the operation. /// LoginResult public LoginResult LoginPost(Credentials credentials, int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse localVarResponse = LoginPostWithHttpInfo(credentials); return localVarResponse.Data; } /// /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials /// Index associated with the operation. /// ApiResponse of LoginResult public BreCalClient.misc.Client.ApiResponse LoginPostWithHttpInfo(Credentials credentials, int operationIndex = 0) { // verify the required parameter 'credentials' is set if (credentials == null) { throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'credentials' when calling DefaultApi->LoginPost"); } 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 = "DefaultApi.LoginPost"; 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("LoginPost", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of LoginResult public async System.Threading.Tasks.Task LoginPostAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await LoginPostWithHttpInfoAsync(credentials, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (LoginResult) public async System.Threading.Tasks.Task> LoginPostWithHttpInfoAsync(Credentials credentials, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'credentials' is set if (credentials == null) { throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'credentials' when calling DefaultApi->LoginPost"); } 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 = "DefaultApi.LoginPost"; 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("LoginPost", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Notification public Notification NotificationsGet(int participantId, int shipcallId, int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse localVarResponse = NotificationsGetWithHttpInfo(participantId, shipcallId); return localVarResponse.Data; } /// /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// ApiResponse of Notification public BreCalClient.misc.Client.ApiResponse NotificationsGetWithHttpInfo(int participantId, 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("", "participant_id", participantId)); localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); localVarRequestOptions.Operation = "DefaultApi.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 /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Notification public async System.Threading.Tasks.Task NotificationsGetAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await NotificationsGetWithHttpInfoAsync(participantId, shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant /// **Id of ship call**. *Example: 52*. Id given in ship call list /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Notification) public async System.Threading.Tasks.Task> NotificationsGetWithHttpInfoAsync(int participantId, int shipcallId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // 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("", "participant_id", participantId)); localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); localVarRequestOptions.Operation = "DefaultApi.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 a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) /// Index associated with the operation. /// List<Participant> public List ParticipantsGet(int? userId = default(int?), int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse> localVarResponse = ParticipantsGetWithHttpInfo(userId); return localVarResponse.Data; } /// /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) /// Index associated with the operation. /// ApiResponse of List<Participant> public BreCalClient.misc.Client.ApiResponse> ParticipantsGetWithHttpInfo(int? userId = default(int?), int operationIndex = 0) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // to determine the Accept header string[] _accepts = new string[] { "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } if (userId != null) { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "user_id", userId)); } localVarRequestOptions.Operation = "DefaultApi.ParticipantsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = this.Client.Get>("/participants", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ParticipantsGet", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Participant> public async System.Threading.Tasks.Task> ParticipantsGetAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await ParticipantsGetWithHttpInfoAsync(userId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Participant>) public async System.Threading.Tasks.Task>> ParticipantsGetWithHttpInfoAsync(int? userId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // to determine the Accept header string[] _accepts = new string[] { "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } if (userId != null) { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "user_id", userId)); } localVarRequestOptions.Operation = "DefaultApi.ParticipantsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync>("/participants", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ParticipantsGet", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Gets a list of ship calls /// /// 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 /// /// 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 = "DefaultApi.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 /// /// 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(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await ShipcallsGetWithHttpInfoAsync(pastDays, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Gets a list of ship calls /// /// Thrown when fails to make API call /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Shipcall>) public async System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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 = "DefaultApi.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; } /// /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Id public Id ShipcallsPost(Shipcall shipcall, int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse localVarResponse = ShipcallsPostWithHttpInfo(shipcall); return localVarResponse.Data; } /// /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// ApiResponse of Id public BreCalClient.misc.Client.ApiResponse ShipcallsPostWithHttpInfo(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 DefaultApi->ShipcallsPost"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header string[] _accepts = new string[] { "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 = "DefaultApi.ShipcallsPost"; 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("ShipcallsPost", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id public async System.Threading.Tasks.Task ShipcallsPostAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipcallsPostWithHttpInfoAsync(shipcall, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) public async System.Threading.Tasks.Task> ShipcallsPostWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'shipcall' is set if (shipcall == null) { throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'shipcall' when calling DefaultApi->ShipcallsPost"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header string[] _accepts = new string[] { "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 = "DefaultApi.ShipcallsPost"; 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("ShipcallsPost", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Id public Id ShipcallsPut(Shipcall shipcall, int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse localVarResponse = ShipcallsPutWithHttpInfo(shipcall); return localVarResponse.Data; } /// /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// ApiResponse of Id public BreCalClient.misc.Client.ApiResponse ShipcallsPutWithHttpInfo(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 DefaultApi->ShipcallsPut"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header string[] _accepts = new string[] { "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 = "DefaultApi.ShipcallsPut"; 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("ShipcallsPut", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id public async System.Threading.Tasks.Task ShipcallsPutAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await ShipcallsPutWithHttpInfoAsync(shipcall, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) public async System.Threading.Tasks.Task> ShipcallsPutWithHttpInfoAsync(Shipcall shipcall, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'shipcall' is set if (shipcall == null) { throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'shipcall' when calling DefaultApi->ShipcallsPut"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header string[] _accepts = new string[] { "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 = "DefaultApi.ShipcallsPut"; 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("ShipcallsPut", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// gets a list of registered 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 registered 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 = "DefaultApi.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 registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Ship> public async System.Threading.Tasks.Task> ShipsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await ShipsGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// gets a list of registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Ship>) public async System.Threading.Tasks.Task>> ShipsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // to determine the Accept header string[] _accepts = new string[] { "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Operation = "DefaultApi.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; } /// /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// /// Index associated with the operation. /// public void TimesDelete(int id, int operationIndex = 0) { TimesDeleteWithHttpInfo(id); } /// /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// /// Index associated with the operation. /// ApiResponse of Object(void) public BreCalClient.misc.Client.ApiResponse TimesDeleteWithHttpInfo(int id, int operationIndex = 0) { 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 = "DefaultApi.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. /// /// Thrown when fails to make API call /// /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void public async System.Threading.Tasks.Task TimesDeleteAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await TimesDeleteWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); } /// /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse public async System.Threading.Tasks.Task> TimesDeleteWithHttpInfoAsync(int id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // 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 = "DefaultApi.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; } /// /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) /// Index associated with the operation. /// List<Times> public List TimesGet(int? shipcallId = default(int?), int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse> localVarResponse = TimesGetWithHttpInfo(shipcallId); return localVarResponse.Data; } /// /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) /// Index associated with the operation. /// ApiResponse of List<Times> 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 = "DefaultApi.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; } /// /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Times> public async System.Threading.Tasks.Task> TimesGetAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse> localVarResponse = await TimesGetWithHttpInfoAsync(shipcallId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Times>) public async System.Threading.Tasks.Task>> TimesGetWithHttpInfoAsync(int? shipcallId = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { }; // to determine the Accept header string[] _accepts = new string[] { "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } if (shipcallId != null) { localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "shipcall_id", shipcallId)); } localVarRequestOptions.Operation = "DefaultApi.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; } /// /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Id public Id TimesPost(Times times, int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse localVarResponse = TimesPostWithHttpInfo(times); return localVarResponse.Data; } /// /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. /// Index associated with the operation. /// ApiResponse of Id public BreCalClient.misc.Client.ApiResponse TimesPostWithHttpInfo(Times times, int operationIndex = 0) { // verify the required parameter 'times' is set if (times == null) { throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling DefaultApi->TimesPost"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header string[] _accepts = new string[] { "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = times; localVarRequestOptions.Operation = "DefaultApi.TimesPost"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = this.Client.Post("/times", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TimesPost", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id public async System.Threading.Tasks.Task TimesPostAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesPostWithHttpInfoAsync(times, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) public async System.Threading.Tasks.Task> TimesPostWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'times' is set if (times == null) { throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling DefaultApi->TimesPost"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header string[] _accepts = new string[] { "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = times; localVarRequestOptions.Operation = "DefaultApi.TimesPost"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.PostAsync("/times", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TimesPost", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// Id public Id TimesPut(Times times, int operationIndex = 0) { BreCalClient.misc.Client.ApiResponse localVarResponse = TimesPutWithHttpInfo(times); return localVarResponse.Data; } /// /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// ApiResponse of Id public BreCalClient.misc.Client.ApiResponse TimesPutWithHttpInfo(Times times, int operationIndex = 0) { // verify the required parameter 'times' is set if (times == null) { throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling DefaultApi->TimesPut"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header string[] _accepts = new string[] { "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = times; localVarRequestOptions.Operation = "DefaultApi.TimesPut"; 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("TimesPut", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of Id public async System.Threading.Tasks.Task TimesPutAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.ApiResponse localVarResponse = await TimesPutWithHttpInfoAsync(times, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (Id) public async System.Threading.Tasks.Task> TimesPutWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'times' is set if (times == null) { throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'times' when calling DefaultApi->TimesPut"); } BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header string[] _accepts = new string[] { "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = times; localVarRequestOptions.Operation = "DefaultApi.TimesPut"; 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("TimesPut", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details /// Index associated with the operation. /// public void UserPut(UserDetails userDetails, int operationIndex = 0) { UserPutWithHttpInfo(userDetails); } /// /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details /// Index associated with the operation. /// ApiResponse of Object(void) public BreCalClient.misc.Client.ApiResponse UserPutWithHttpInfo(UserDetails userDetails, int operationIndex = 0) { // verify the required parameter 'userDetails' is set if (userDetails == null) { throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'userDetails' when calling DefaultApi->UserPut"); } 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 = "DefaultApi.UserPut"; 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("UserPut", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } /// /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void public async System.Threading.Tasks.Task UserPutAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await UserPutWithHttpInfoAsync(userDetails, operationIndex, cancellationToken).ConfigureAwait(false); } /// /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse public async System.Threading.Tasks.Task> UserPutWithHttpInfoAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'userDetails' is set if (userDetails == null) { throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'userDetails' when calling DefaultApi->UserPut"); } 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 = "DefaultApi.UserPut"; 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("UserPut", localVarResponse); if (_exception != null) { throw _exception; } } return localVarResponse; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 0.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 BreCalClient.misc.Model.AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema return ((BreCalClient.misc.Model.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("'", "")); File.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, System.Globalization.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 => RestSharp.ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; public 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 = BreCalClient.misc.Client.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, System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } } } return request; } 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; } private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; var cookies = new CookieContainer(); if (options.Cookies != null && options.Cookies.Count > 0) { foreach (var cookie in options.Cookies) { cookies.Add(new Cookie(cookie.Name, cookie.Value)); } } var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; using (RestClient client = new RestClient(clientOptions, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) { InterceptRequest(request); RestResponse response; if (RetryConfiguration.RetryPolicy != null) { var policy = RetryConfiguration.RetryPolicy; var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) { ErrorException = policyResult.FinalException }; } else { response = client.Execute(request); } // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof(BreCalClient.misc.Model.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 async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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 }; using (RestClient client = new RestClient(clientOptions, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) { InterceptRequest(request); RestResponse response; if (RetryConfiguration.AsyncRetryPolicy != null) { var policy = RetryConfiguration.AsyncRetryPolicy; var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) { ErrorException = policyResult.FinalException }; } else { response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); } // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof(BreCalClient.misc.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } else if (typeof(T).Name == "Stream") // for binary response { response.Data = (T)(object)new MemoryStream(response.RawBytes); } else if (typeof(T).Name == "Byte[]") // for byte response { response.Data = (T)(object)response.RawBytes; } InterceptResponse(request, response); var result = ToApiResponse(response); if (response.ErrorMessage != null) { result.ErrorText = response.ErrorMessage; } if (response.Cookies != null && response.Cookies.Count > 0) { if (result.Cookies == null) result.Cookies = new List(); foreach (var restResponseCookie in response.Cookies.Cast()) { var cookie = new Cookie( restResponseCookie.Name, restResponseCookie.Value, restResponseCookie.Path, restResponseCookie.Domain ) { Comment = restResponseCookie.Comment, CommentUri = restResponseCookie.CommentUri, Discard = restResponseCookie.Discard, Expired = restResponseCookie.Expired, Expires = restResponseCookie.Expires, HttpOnly = restResponseCookie.HttpOnly, Port = restResponseCookie.Port, Secure = restResponseCookie.Secure, Version = restResponseCookie.Version }; result.Cookies.Add(cookie); } } return result; } } #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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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: 0.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: 0.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: 0.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(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: 0.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); } 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 /// [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration() { Proxy = null; UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); BasePath = "https://brecaltest.bsmd-emswe.eu"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); ApiKeyPrefix = new ConcurrentDictionary(); Servers = new List>() { { new Dictionary { {"url", "https://brecaltest.bsmd-emswe.eu"}, {"description", "Test server hosted on vcup"}, } } }; OperationServers = new Dictionary>>() { }; // Setting Timeout has side effects (forces ApiClient creation). Timeout = 100000; } /// /// Initializes a new instance of the class /// [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration( IDictionary defaultHeaders, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "https://brecaltest.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: 0.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: 0.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: 0.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: 0.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: 0.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: 0.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(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(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(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(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(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(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(System.Threading.CancellationToken)); } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 0.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: 0.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: 0.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: 0.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: 0.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: 0.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: 0.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: 0.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 : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// /// id. /// name. /// ownerId. /// authorityId. /// varLock. /// created. /// modified. /// deleted (default to false). public Berth(int id = default(int), string name = default(string), int? ownerId = default(int?), int? authorityId = default(int?), bool? varLock = default(bool?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; this.OwnerId = ownerId; this.AuthorityId = authorityId; this.VarLock = varLock; this.Created = created; this.Modified = modified; this.Deleted = deleted; } /// /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets Name /// [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } /// /// Gets or Sets OwnerId /// [DataMember(Name = "owner_id", EmitDefaultValue = true)] public int? OwnerId { get; set; } /// /// Gets or Sets AuthorityId /// [DataMember(Name = "authority_id", EmitDefaultValue = true)] public int? AuthorityId { get; set; } /// /// Gets or Sets VarLock /// [DataMember(Name = "lock", EmitDefaultValue = true)] public bool? VarLock { get; set; } /// /// Gets or Sets Created /// [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { get; set; } /// /// Gets or Sets Deleted /// [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(" VarLock: ").Append(VarLock).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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as Berth); } /// /// Returns true if Berth instances are equal /// /// Instance of Berth to be compared /// Boolean public bool Equals(Berth input) { if (input == null) { return false; } return ( this.Id == input.Id || this.Id.Equals(input.Id) ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) ) && ( this.OwnerId == input.OwnerId || (this.OwnerId != null && this.OwnerId.Equals(input.OwnerId)) ) && ( this.AuthorityId == input.AuthorityId || (this.AuthorityId != null && this.AuthorityId.Equals(input.AuthorityId)) ) && ( this.VarLock == input.VarLock || (this.VarLock != null && this.VarLock.Equals(input.VarLock)) ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } if (this.OwnerId != null) { hashCode = (hashCode * 59) + this.OwnerId.GetHashCode(); } if (this.AuthorityId != null) { hashCode = (hashCode * 59) + this.AuthorityId.GetHashCode(); } if (this.VarLock != null) { hashCode = (hashCode * 59) + this.VarLock.GetHashCode(); } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); } if (this.Modified != null) { hashCode = (hashCode * 59) + this.Modified.GetHashCode(); } hashCode = (hashCode * 59) + this.Deleted.GetHashCode(); return hashCode; } } /// /// 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 System.ComponentModel.DataAnnotations.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: 0.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Credentials /// [DataContract(Name = "credentials")] public partial class Credentials : IEquatable, 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 /// [DataMember(Name = "username", IsRequired = true, EmitDefaultValue = true)] public string Username { get; set; } /// /// Gets or Sets Password /// [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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as Credentials); } /// /// Returns true if Credentials instances are equal /// /// Instance of Credentials to be compared /// Boolean public bool Equals(Credentials input) { if (input == null) { return false; } return ( this.Username == input.Username || (this.Username != null && this.Username.Equals(input.Username)) ) && ( this.Password == input.Password || (this.Password != null && this.Password.Equals(input.Password)) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (this.Username != null) { hashCode = (hashCode * 59) + this.Username.GetHashCode(); } if (this.Password != null) { hashCode = (hashCode * 59) + this.Password.GetHashCode(); } return hashCode; } } /// /// 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: 0.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Error /// [DataContract(Name = "Error")] public partial class Error : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected Error() { } /// /// Initializes a new instance of the class. /// /// A human readable error message (required). public Error(string message = default(string)) { // to ensure "message" is required (not null) if (message == null) { throw new ArgumentNullException("message is a required property for Error and cannot be null"); } this.Message = message; } /// /// A human readable error message /// /// A human readable error message [DataMember(Name = "message", IsRequired = true, EmitDefaultValue = true)] public string Message { 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(" Message: ").Append(Message).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as Error); } /// /// Returns true if Error instances are equal /// /// Instance of Error to be compared /// Boolean public bool Equals(Error input) { if (input == null) { return false; } return ( this.Message == input.Message || (this.Message != null && this.Message.Equals(input.Message)) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (this.Message != null) { hashCode = (hashCode * 59) + this.Message.GetHashCode(); } return hashCode; } } /// /// 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: 0.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 : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// /// varId. public Id(int varId = default(int)) { this.VarId = varId; } /// /// Gets or Sets VarId /// [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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as Id); } /// /// Returns true if Id instances are equal /// /// Instance of Id to be compared /// Boolean public bool Equals(Id input) { if (input == null) { return false; } return ( this.VarId == input.VarId || this.VarId.Equals(input.VarId) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = (hashCode * 59) + this.VarId.GetHashCode(); return hashCode; } } /// /// 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: 0.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 : IEquatable, 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 /// [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets ParticipantId /// [DataMember(Name = "participant_id", EmitDefaultValue = true)] public int ParticipantId { get; set; } /// /// Gets or Sets FirstName /// [DataMember(Name = "first_name", EmitDefaultValue = true)] public string FirstName { get; set; } /// /// Gets or Sets LastName /// [DataMember(Name = "last_name", EmitDefaultValue = true)] public string LastName { get; set; } /// /// Gets or Sets UserName /// [DataMember(Name = "user_name", EmitDefaultValue = true)] public string UserName { get; set; } /// /// Gets or Sets UserPhone /// [DataMember(Name = "user_phone", EmitDefaultValue = true)] public string UserPhone { get; set; } /// /// Gets or Sets UserEmail /// [DataMember(Name = "user_email", EmitDefaultValue = true)] public string UserEmail { get; set; } /// /// Gets or Sets Exp /// [DataMember(Name = "exp", EmitDefaultValue = true)] public float Exp { get; set; } /// /// Gets or Sets Token /// [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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as LoginResult); } /// /// Returns true if LoginResult instances are equal /// /// Instance of LoginResult to be compared /// Boolean public bool Equals(LoginResult input) { if (input == null) { return false; } return ( this.Id == input.Id || this.Id.Equals(input.Id) ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) ) && ( this.UserName == input.UserName || (this.UserName != null && this.UserName.Equals(input.UserName)) ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) ) && ( this.UserEmail == input.UserEmail || (this.UserEmail != null && this.UserEmail.Equals(input.UserEmail)) ) && ( this.Exp == input.Exp || this.Exp.Equals(input.Exp) ) && ( this.Token == input.Token || (this.Token != null && this.Token.Equals(input.Token)) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); if (this.FirstName != null) { hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); } if (this.LastName != null) { hashCode = (hashCode * 59) + this.LastName.GetHashCode(); } if (this.UserName != null) { hashCode = (hashCode * 59) + this.UserName.GetHashCode(); } if (this.UserPhone != null) { hashCode = (hashCode * 59) + this.UserPhone.GetHashCode(); } if (this.UserEmail != null) { hashCode = (hashCode * 59) + this.UserEmail.GetHashCode(); } hashCode = (hashCode * 59) + this.Exp.GetHashCode(); if (this.Token != null) { hashCode = (hashCode * 59) + this.Token.GetHashCode(); } return hashCode; } } /// /// 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: 0.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 : IEquatable, IValidatableObject { /// /// Defines NotificationType /// [JsonConverter(typeof(StringEnumConverter))] public enum NotificationTypeEnum { /// /// Enum Undefined for value: undefined /// [EnumMember(Value = "undefined")] Undefined = 1, /// /// Enum Email for value: email /// [EnumMember(Value = "email")] Email = 2, /// /// Enum Push for value: push /// [EnumMember(Value = "push")] Push = 3 } /// /// Gets or Sets NotificationType /// [DataMember(Name = "notification_type", EmitDefaultValue = true)] public NotificationTypeEnum? NotificationType { get; set; } /// /// Initializes a new instance of the class. /// /// id. /// timesId. /// participantId. /// notificationType. /// timestamp. /// acknowledged. /// created. /// modified. public Notification(int id = default(int), int timesId = default(int), int participantId = default(int), NotificationTypeEnum? notificationType = default(NotificationTypeEnum?), DateTime timestamp = default(DateTime), bool acknowledged = default(bool), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.TimesId = timesId; this.ParticipantId = participantId; this.NotificationType = notificationType; this.Timestamp = timestamp; this.Acknowledged = acknowledged; this.Created = created; this.Modified = modified; } /// /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets TimesId /// [DataMember(Name = "times_id", EmitDefaultValue = true)] public int TimesId { get; set; } /// /// Gets or Sets ParticipantId /// [DataMember(Name = "participant_id", EmitDefaultValue = true)] public int ParticipantId { get; set; } /// /// Gets or Sets Timestamp /// [DataMember(Name = "timestamp", EmitDefaultValue = true)] public DateTime Timestamp { get; set; } /// /// Gets or Sets Acknowledged /// [DataMember(Name = "acknowledged", EmitDefaultValue = true)] public bool Acknowledged { get; set; } /// /// Gets or Sets Created /// [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Gets or Sets Modified /// [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(" TimesId: ").Append(TimesId).Append("\n"); sb.Append(" ParticipantId: ").Append(ParticipantId).Append("\n"); sb.Append(" NotificationType: ").Append(NotificationType).Append("\n"); sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); sb.Append(" Acknowledged: ").Append(Acknowledged).Append("\n"); sb.Append(" 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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as Notification); } /// /// Returns true if Notification instances are equal /// /// Instance of Notification to be compared /// Boolean public bool Equals(Notification input) { if (input == null) { return false; } return ( this.Id == input.Id || this.Id.Equals(input.Id) ) && ( this.TimesId == input.TimesId || this.TimesId.Equals(input.TimesId) ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) ) && ( this.NotificationType == input.NotificationType || this.NotificationType.Equals(input.NotificationType) ) && ( this.Timestamp == input.Timestamp || (this.Timestamp != null && this.Timestamp.Equals(input.Timestamp)) ) && ( this.Acknowledged == input.Acknowledged || this.Acknowledged.Equals(input.Acknowledged) ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); hashCode = (hashCode * 59) + this.TimesId.GetHashCode(); hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); hashCode = (hashCode * 59) + this.NotificationType.GetHashCode(); if (this.Timestamp != null) { hashCode = (hashCode * 59) + this.Timestamp.GetHashCode(); } hashCode = (hashCode * 59) + this.Acknowledged.GetHashCode(); if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); } if (this.Modified != null) { hashCode = (hashCode * 59) + this.Modified.GetHashCode(); } return hashCode; } } /// /// 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: 0.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 : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// /// id. /// name. /// street. /// postalCode. /// city. /// type. /// flags. /// created. /// modified. /// deleted (default to false). public Participant(int id = default(int), string name = default(string), string street = default(string), string postalCode = default(string), string city = default(string), int type = default(int), int? flags = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; this.Street = street; this.PostalCode = postalCode; this.City = city; this.Type = type; this.Flags = flags; this.Created = created; this.Modified = modified; this.Deleted = deleted; } /// /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets Name /// [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } /// /// Gets or Sets Street /// [DataMember(Name = "street", EmitDefaultValue = true)] public string Street { get; set; } /// /// Gets or Sets PostalCode /// [DataMember(Name = "postal code", EmitDefaultValue = true)] public string PostalCode { get; set; } /// /// Gets or Sets City /// [DataMember(Name = "city", EmitDefaultValue = true)] public string City { get; set; } /// /// Gets or Sets Type /// [DataMember(Name = "type", EmitDefaultValue = true)] public int Type { get; set; } /// /// Gets or Sets Flags /// [DataMember(Name = "flags", EmitDefaultValue = true)] public int? Flags { get; set; } /// /// Gets or Sets Created /// [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { get; set; } /// /// Gets or Sets Deleted /// [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(" 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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as Participant); } /// /// Returns true if Participant instances are equal /// /// Instance of Participant to be compared /// Boolean public bool Equals(Participant input) { if (input == null) { return false; } return ( this.Id == input.Id || this.Id.Equals(input.Id) ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) ) && ( this.Street == input.Street || (this.Street != null && this.Street.Equals(input.Street)) ) && ( this.PostalCode == input.PostalCode || (this.PostalCode != null && this.PostalCode.Equals(input.PostalCode)) ) && ( this.City == input.City || (this.City != null && this.City.Equals(input.City)) ) && ( this.Type == input.Type || this.Type.Equals(input.Type) ) && ( this.Flags == input.Flags || (this.Flags != null && this.Flags.Equals(input.Flags)) ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } if (this.Street != null) { hashCode = (hashCode * 59) + this.Street.GetHashCode(); } if (this.PostalCode != null) { hashCode = (hashCode * 59) + this.PostalCode.GetHashCode(); } if (this.City != null) { hashCode = (hashCode * 59) + this.City.GetHashCode(); } hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.Flags != null) { hashCode = (hashCode * 59) + this.Flags.GetHashCode(); } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); } if (this.Modified != null) { hashCode = (hashCode * 59) + this.Modified.GetHashCode(); } hashCode = (hashCode * 59) + this.Deleted.GetHashCode(); return hashCode; } } /// /// 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 System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, length must be less than 128.", new [] { "Name" }); } // Street (string) maxLength if (this.Street != null && this.Street.Length > 128) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Street, length must be less than 128.", new [] { "Street" }); } // PostalCode (string) maxLength if (this.PostalCode != null && this.PostalCode.Length > 5) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PostalCode, length must be less than 5.", new [] { "PostalCode" }); } // City (string) maxLength if (this.City != null && this.City.Length > 64) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for City, length must be less than 64.", new [] { "City" }); } yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 0.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 : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected ParticipantAssignment() { } /// /// Initializes a new instance of the class. /// /// participantId (required). /// type (required). public ParticipantAssignment(int participantId = default(int), int type = default(int)) { this.ParticipantId = participantId; this.Type = type; } /// /// Gets or Sets ParticipantId /// [DataMember(Name = "participant_id", IsRequired = true, EmitDefaultValue = true)] public int ParticipantId { get; set; } /// /// Gets or Sets Type /// [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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as ParticipantAssignment); } /// /// Returns true if ParticipantAssignment instances are equal /// /// Instance of ParticipantAssignment to be compared /// Boolean public bool Equals(ParticipantAssignment input) { if (input == null) { return false; } return ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) ) && ( this.Type == input.Type || this.Type.Equals(input.Type) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); hashCode = (hashCode * 59) + this.Type.GetHashCode(); return hashCode; } } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 0.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 : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// /// id. /// name. /// imo. /// callsign. /// participantId. /// length. /// width. /// isTug (default to false). /// bollardPull. /// eni. /// created. /// modified. /// deleted (default to false). public Ship(int id = default(int), string name = default(string), int? imo = default(int?), string callsign = default(string), int? participantId = default(int?), float? length = default(float?), float? width = default(float?), bool isTug = false, int? bollardPull = default(int?), int? eni = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { 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 /// [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets Name /// [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } /// /// Gets or Sets Imo /// [DataMember(Name = "imo", EmitDefaultValue = true)] public int? Imo { get; set; } /// /// Gets or Sets Callsign /// [DataMember(Name = "callsign", EmitDefaultValue = true)] public string Callsign { get; set; } /// /// Gets or Sets ParticipantId /// [DataMember(Name = "participant_id", EmitDefaultValue = true)] public int? ParticipantId { get; set; } /// /// Gets or Sets Length /// [DataMember(Name = "length", EmitDefaultValue = true)] public float? Length { get; set; } /// /// Gets or Sets Width /// [DataMember(Name = "width", EmitDefaultValue = true)] public float? Width { get; set; } /// /// Gets or Sets IsTug /// [DataMember(Name = "is_tug", EmitDefaultValue = true)] public bool IsTug { get; set; } /// /// Gets or Sets BollardPull /// [DataMember(Name = "bollard_pull", EmitDefaultValue = true)] public int? BollardPull { get; set; } /// /// Gets or Sets Eni /// [DataMember(Name = "eni", EmitDefaultValue = true)] public int? Eni { get; set; } /// /// Gets or Sets Created /// [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { get; set; } /// /// Gets or Sets Deleted /// [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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as Ship); } /// /// Returns true if Ship instances are equal /// /// Instance of Ship to be compared /// Boolean public bool Equals(Ship input) { if (input == null) { return false; } return ( this.Id == input.Id || this.Id.Equals(input.Id) ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) ) && ( this.Imo == input.Imo || (this.Imo != null && this.Imo.Equals(input.Imo)) ) && ( this.Callsign == input.Callsign || (this.Callsign != null && this.Callsign.Equals(input.Callsign)) ) && ( this.ParticipantId == input.ParticipantId || (this.ParticipantId != null && this.ParticipantId.Equals(input.ParticipantId)) ) && ( this.Length == input.Length || (this.Length != null && this.Length.Equals(input.Length)) ) && ( this.Width == input.Width || (this.Width != null && this.Width.Equals(input.Width)) ) && ( this.IsTug == input.IsTug || this.IsTug.Equals(input.IsTug) ) && ( this.BollardPull == input.BollardPull || (this.BollardPull != null && this.BollardPull.Equals(input.BollardPull)) ) && ( this.Eni == input.Eni || (this.Eni != null && this.Eni.Equals(input.Eni)) ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } if (this.Imo != null) { hashCode = (hashCode * 59) + this.Imo.GetHashCode(); } if (this.Callsign != null) { hashCode = (hashCode * 59) + this.Callsign.GetHashCode(); } if (this.ParticipantId != null) { hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); } if (this.Length != null) { hashCode = (hashCode * 59) + this.Length.GetHashCode(); } if (this.Width != null) { hashCode = (hashCode * 59) + this.Width.GetHashCode(); } hashCode = (hashCode * 59) + this.IsTug.GetHashCode(); if (this.BollardPull != null) { hashCode = (hashCode * 59) + this.BollardPull.GetHashCode(); } if (this.Eni != null) { hashCode = (hashCode * 59) + this.Eni.GetHashCode(); } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); } if (this.Modified != null) { hashCode = (hashCode * 59) + this.Modified.GetHashCode(); } hashCode = (hashCode * 59) + this.Deleted.GetHashCode(); return hashCode; } } /// /// 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 System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, length must be less than 64.", new [] { "Name" }); } // Callsign (string) maxLength if (this.Callsign != null && this.Callsign.Length > 8) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Callsign, length must be less than 8.", new [] { "Callsign" }); } yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 0.6.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ namespace BreCalClient.misc.Model { /// /// Shipcall /// [DataContract(Name = "shipcall")] public partial class Shipcall : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected Shipcall() { } /// /// Initializes a new instance of the class. /// /// The unique identifier of a ship call (required). /// shipId (required). /// type (required). /// eta. /// voyage. /// etd. /// arrivalBerthId. /// departureBerthId. /// tugRequired. /// pilotRequired. /// flags. /// pierSide. /// bunkering. /// replenishingTerminal. /// replenishingLock. /// draft. /// tidalWindowFrom. /// tidalWindowTo. /// rainSensitiveCargo. /// recommendedTugs. /// anchored. /// mooredLock. /// canceled. /// evaluation. /// evaluationMessage. /// participants. /// created. /// modified. public Shipcall(int id = default(int), int shipId = default(int), int type = default(int), DateTime? eta = default(DateTime?), string voyage = default(string), DateTime? etd = default(DateTime?), int? arrivalBerthId = default(int?), int? departureBerthId = default(int?), bool? tugRequired = default(bool?), bool? pilotRequired = default(bool?), int? flags = default(int?), bool? pierSide = default(bool?), bool? bunkering = default(bool?), bool? replenishingTerminal = default(bool?), bool? replenishingLock = default(bool?), float? draft = default(float?), DateTime? tidalWindowFrom = default(DateTime?), DateTime? tidalWindowTo = default(DateTime?), bool? rainSensitiveCargo = default(bool?), int? recommendedTugs = default(int?), bool? anchored = default(bool?), bool? mooredLock = default(bool?), bool? canceled = default(bool?), int? evaluation = default(int?), string evaluationMessage = default(string), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.ShipId = shipId; this.Type = type; 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.EvaluationMessage = evaluationMessage; this.Participants = participants; this.Created = created; this.Modified = modified; } /// /// The unique identifier of a ship call /// /// The unique identifier of a ship call [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets ShipId /// [DataMember(Name = "ship_id", IsRequired = true, EmitDefaultValue = true)] public int ShipId { get; set; } /// /// Gets or Sets Type /// [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public int Type { get; set; } /// /// Gets or Sets Eta /// [DataMember(Name = "eta", EmitDefaultValue = true)] public DateTime? Eta { get; set; } /// /// Gets or Sets Voyage /// [DataMember(Name = "voyage", EmitDefaultValue = true)] public string Voyage { get; set; } /// /// Gets or Sets Etd /// [DataMember(Name = "etd", EmitDefaultValue = true)] public DateTime? Etd { get; set; } /// /// Gets or Sets ArrivalBerthId /// [DataMember(Name = "arrival_berth_id", EmitDefaultValue = true)] public int? ArrivalBerthId { get; set; } /// /// Gets or Sets DepartureBerthId /// [DataMember(Name = "departure_berth_id", EmitDefaultValue = true)] public int? DepartureBerthId { get; set; } /// /// Gets or Sets TugRequired /// [DataMember(Name = "tug_required", EmitDefaultValue = true)] public bool? TugRequired { get; set; } /// /// Gets or Sets PilotRequired /// [DataMember(Name = "pilot_required", EmitDefaultValue = true)] public bool? PilotRequired { get; set; } /// /// Gets or Sets Flags /// [DataMember(Name = "flags", EmitDefaultValue = true)] public int? Flags { get; set; } /// /// Gets or Sets PierSide /// [DataMember(Name = "pier_side", EmitDefaultValue = true)] public bool? PierSide { get; set; } /// /// Gets or Sets Bunkering /// [DataMember(Name = "bunkering", EmitDefaultValue = true)] public bool? Bunkering { get; set; } /// /// Gets or Sets ReplenishingTerminal /// [DataMember(Name = "replenishing_terminal", EmitDefaultValue = true)] public bool? ReplenishingTerminal { get; set; } /// /// Gets or Sets ReplenishingLock /// [DataMember(Name = "replenishing_lock", EmitDefaultValue = true)] public bool? ReplenishingLock { get; set; } /// /// Gets or Sets Draft /// [DataMember(Name = "draft", EmitDefaultValue = true)] public float? Draft { get; set; } /// /// Gets or Sets TidalWindowFrom /// [DataMember(Name = "tidal_window_from", EmitDefaultValue = true)] public DateTime? TidalWindowFrom { get; set; } /// /// Gets or Sets TidalWindowTo /// [DataMember(Name = "tidal_window_to", EmitDefaultValue = true)] public DateTime? TidalWindowTo { get; set; } /// /// Gets or Sets RainSensitiveCargo /// [DataMember(Name = "rain_sensitive_cargo", EmitDefaultValue = true)] public bool? RainSensitiveCargo { get; set; } /// /// Gets or Sets RecommendedTugs /// [DataMember(Name = "recommended_tugs", EmitDefaultValue = true)] public int? RecommendedTugs { get; set; } /// /// Gets or Sets Anchored /// [DataMember(Name = "anchored", EmitDefaultValue = true)] public bool? Anchored { get; set; } /// /// Gets or Sets MooredLock /// [DataMember(Name = "moored_lock", EmitDefaultValue = true)] public bool? MooredLock { get; set; } /// /// Gets or Sets Canceled /// [DataMember(Name = "canceled", EmitDefaultValue = true)] public bool? Canceled { get; set; } /// /// Gets or Sets Evaluation /// [DataMember(Name = "evaluation", EmitDefaultValue = true)] public int? Evaluation { get; set; } /// /// Gets or Sets EvaluationMessage /// [DataMember(Name = "evaluation_message", EmitDefaultValue = true)] public string EvaluationMessage { get; set; } /// /// Gets or Sets Participants /// [DataMember(Name = "participants", EmitDefaultValue = true)] public List Participants { get; set; } /// /// Gets or Sets Created /// [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Gets or Sets Modified /// [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(" 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(" 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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as Shipcall); } /// /// Returns true if Shipcall instances are equal /// /// Instance of Shipcall to be compared /// Boolean public bool Equals(Shipcall input) { if (input == null) { return false; } return ( this.Id == input.Id || this.Id.Equals(input.Id) ) && ( this.ShipId == input.ShipId || this.ShipId.Equals(input.ShipId) ) && ( this.Type == input.Type || this.Type.Equals(input.Type) ) && ( this.Eta == input.Eta || (this.Eta != null && this.Eta.Equals(input.Eta)) ) && ( this.Voyage == input.Voyage || (this.Voyage != null && this.Voyage.Equals(input.Voyage)) ) && ( this.Etd == input.Etd || (this.Etd != null && this.Etd.Equals(input.Etd)) ) && ( this.ArrivalBerthId == input.ArrivalBerthId || (this.ArrivalBerthId != null && this.ArrivalBerthId.Equals(input.ArrivalBerthId)) ) && ( this.DepartureBerthId == input.DepartureBerthId || (this.DepartureBerthId != null && this.DepartureBerthId.Equals(input.DepartureBerthId)) ) && ( this.TugRequired == input.TugRequired || (this.TugRequired != null && this.TugRequired.Equals(input.TugRequired)) ) && ( this.PilotRequired == input.PilotRequired || (this.PilotRequired != null && this.PilotRequired.Equals(input.PilotRequired)) ) && ( this.Flags == input.Flags || (this.Flags != null && this.Flags.Equals(input.Flags)) ) && ( this.PierSide == input.PierSide || (this.PierSide != null && this.PierSide.Equals(input.PierSide)) ) && ( this.Bunkering == input.Bunkering || (this.Bunkering != null && this.Bunkering.Equals(input.Bunkering)) ) && ( this.ReplenishingTerminal == input.ReplenishingTerminal || (this.ReplenishingTerminal != null && this.ReplenishingTerminal.Equals(input.ReplenishingTerminal)) ) && ( this.ReplenishingLock == input.ReplenishingLock || (this.ReplenishingLock != null && this.ReplenishingLock.Equals(input.ReplenishingLock)) ) && ( this.Draft == input.Draft || (this.Draft != null && this.Draft.Equals(input.Draft)) ) && ( this.TidalWindowFrom == input.TidalWindowFrom || (this.TidalWindowFrom != null && this.TidalWindowFrom.Equals(input.TidalWindowFrom)) ) && ( this.TidalWindowTo == input.TidalWindowTo || (this.TidalWindowTo != null && this.TidalWindowTo.Equals(input.TidalWindowTo)) ) && ( this.RainSensitiveCargo == input.RainSensitiveCargo || (this.RainSensitiveCargo != null && this.RainSensitiveCargo.Equals(input.RainSensitiveCargo)) ) && ( this.RecommendedTugs == input.RecommendedTugs || (this.RecommendedTugs != null && this.RecommendedTugs.Equals(input.RecommendedTugs)) ) && ( this.Anchored == input.Anchored || (this.Anchored != null && this.Anchored.Equals(input.Anchored)) ) && ( this.MooredLock == input.MooredLock || (this.MooredLock != null && this.MooredLock.Equals(input.MooredLock)) ) && ( this.Canceled == input.Canceled || (this.Canceled != null && this.Canceled.Equals(input.Canceled)) ) && ( this.Evaluation == input.Evaluation || (this.Evaluation != null && this.Evaluation.Equals(input.Evaluation)) ) && ( this.EvaluationMessage == input.EvaluationMessage || (this.EvaluationMessage != null && this.EvaluationMessage.Equals(input.EvaluationMessage)) ) && ( this.Participants == input.Participants || this.Participants != null && input.Participants != null && this.Participants.SequenceEqual(input.Participants) ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); hashCode = (hashCode * 59) + this.ShipId.GetHashCode(); hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.Eta != null) { hashCode = (hashCode * 59) + this.Eta.GetHashCode(); } if (this.Voyage != null) { hashCode = (hashCode * 59) + this.Voyage.GetHashCode(); } if (this.Etd != null) { hashCode = (hashCode * 59) + this.Etd.GetHashCode(); } if (this.ArrivalBerthId != null) { hashCode = (hashCode * 59) + this.ArrivalBerthId.GetHashCode(); } if (this.DepartureBerthId != null) { hashCode = (hashCode * 59) + this.DepartureBerthId.GetHashCode(); } if (this.TugRequired != null) { hashCode = (hashCode * 59) + this.TugRequired.GetHashCode(); } if (this.PilotRequired != null) { hashCode = (hashCode * 59) + this.PilotRequired.GetHashCode(); } if (this.Flags != null) { hashCode = (hashCode * 59) + this.Flags.GetHashCode(); } if (this.PierSide != null) { hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); } if (this.Bunkering != null) { hashCode = (hashCode * 59) + this.Bunkering.GetHashCode(); } if (this.ReplenishingTerminal != null) { hashCode = (hashCode * 59) + this.ReplenishingTerminal.GetHashCode(); } if (this.ReplenishingLock != null) { hashCode = (hashCode * 59) + this.ReplenishingLock.GetHashCode(); } if (this.Draft != null) { hashCode = (hashCode * 59) + this.Draft.GetHashCode(); } if (this.TidalWindowFrom != null) { hashCode = (hashCode * 59) + this.TidalWindowFrom.GetHashCode(); } if (this.TidalWindowTo != null) { hashCode = (hashCode * 59) + this.TidalWindowTo.GetHashCode(); } if (this.RainSensitiveCargo != null) { hashCode = (hashCode * 59) + this.RainSensitiveCargo.GetHashCode(); } if (this.RecommendedTugs != null) { hashCode = (hashCode * 59) + this.RecommendedTugs.GetHashCode(); } if (this.Anchored != null) { hashCode = (hashCode * 59) + this.Anchored.GetHashCode(); } if (this.MooredLock != null) { hashCode = (hashCode * 59) + this.MooredLock.GetHashCode(); } if (this.Canceled != null) { hashCode = (hashCode * 59) + this.Canceled.GetHashCode(); } if (this.Evaluation != null) { hashCode = (hashCode * 59) + this.Evaluation.GetHashCode(); } if (this.EvaluationMessage != null) { hashCode = (hashCode * 59) + this.EvaluationMessage.GetHashCode(); } if (this.Participants != null) { hashCode = (hashCode * 59) + this.Participants.GetHashCode(); } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); } if (this.Modified != null) { hashCode = (hashCode * 59) + this.Modified.GetHashCode(); } return hashCode; } } /// /// 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 System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Voyage, length must be less than 16.", new [] { "Voyage" }); } yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 0.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 : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected Times() { } /// /// Initializes a new instance of the class. /// /// id. /// etaBerth. /// etaBerthFixed. /// etdBerth. /// etdBerthFixed. /// lockTime. /// lockTimeFixed. /// zoneEntry. /// zoneEntryFixed. /// operationsStart. /// operationsEnd. /// remarks. /// shipcallId (required). /// participantId (required). /// berthId. /// berthInfo. /// pierSide. /// participantType. /// created. /// modified. public Times(int id = default(int), DateTime? etaBerth = default(DateTime?), bool? etaBerthFixed = default(bool?), DateTime? etdBerth = default(DateTime?), bool? etdBerthFixed = default(bool?), DateTime? lockTime = default(DateTime?), bool? lockTimeFixed = default(bool?), DateTime? zoneEntry = default(DateTime?), bool? zoneEntryFixed = default(bool?), DateTime? operationsStart = default(DateTime?), DateTime? operationsEnd = default(DateTime?), string remarks = default(string), int shipcallId = default(int), int participantId = default(int), int? berthId = default(int?), string berthInfo = default(string), bool? pierSide = default(bool?), int? participantType = default(int?), 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.Created = created; this.Modified = modified; } /// /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets EtaBerth /// [DataMember(Name = "eta_berth", EmitDefaultValue = true)] public DateTime? EtaBerth { get; set; } /// /// Gets or Sets EtaBerthFixed /// [DataMember(Name = "eta_berth_fixed", EmitDefaultValue = true)] public bool? EtaBerthFixed { get; set; } /// /// Gets or Sets EtdBerth /// [DataMember(Name = "etd_berth", EmitDefaultValue = true)] public DateTime? EtdBerth { get; set; } /// /// Gets or Sets EtdBerthFixed /// [DataMember(Name = "etd_berth_fixed", EmitDefaultValue = true)] public bool? EtdBerthFixed { get; set; } /// /// Gets or Sets LockTime /// [DataMember(Name = "lock_time", EmitDefaultValue = true)] public DateTime? LockTime { get; set; } /// /// Gets or Sets LockTimeFixed /// [DataMember(Name = "lock_time_fixed", EmitDefaultValue = true)] public bool? LockTimeFixed { get; set; } /// /// Gets or Sets ZoneEntry /// [DataMember(Name = "zone_entry", EmitDefaultValue = true)] public DateTime? ZoneEntry { get; set; } /// /// Gets or Sets ZoneEntryFixed /// [DataMember(Name = "zone_entry_fixed", EmitDefaultValue = true)] public bool? ZoneEntryFixed { get; set; } /// /// Gets or Sets OperationsStart /// [DataMember(Name = "operations_start", EmitDefaultValue = true)] public DateTime? OperationsStart { get; set; } /// /// Gets or Sets OperationsEnd /// [DataMember(Name = "operations_end", EmitDefaultValue = true)] public DateTime? OperationsEnd { get; set; } /// /// Gets or Sets Remarks /// [DataMember(Name = "remarks", EmitDefaultValue = true)] public string Remarks { get; set; } /// /// Gets or Sets ShipcallId /// [DataMember(Name = "shipcall_id", IsRequired = true, EmitDefaultValue = true)] public int ShipcallId { get; set; } /// /// Gets or Sets ParticipantId /// [DataMember(Name = "participant_id", IsRequired = true, EmitDefaultValue = true)] public int ParticipantId { get; set; } /// /// Gets or Sets BerthId /// [DataMember(Name = "berth_id", EmitDefaultValue = true)] public int? BerthId { get; set; } /// /// Gets or Sets BerthInfo /// [DataMember(Name = "berth_info", EmitDefaultValue = true)] public string BerthInfo { get; set; } /// /// Gets or Sets PierSide /// [DataMember(Name = "pier_side", EmitDefaultValue = true)] public bool? PierSide { get; set; } /// /// Gets or Sets ParticipantType /// [DataMember(Name = "participant_type", EmitDefaultValue = true)] public int? ParticipantType { get; set; } /// /// Gets or Sets Created /// [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// /// Gets or Sets Modified /// [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(" 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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as Times); } /// /// Returns true if Times instances are equal /// /// Instance of Times to be compared /// Boolean public bool Equals(Times input) { if (input == null) { return false; } return ( this.Id == input.Id || this.Id.Equals(input.Id) ) && ( this.EtaBerth == input.EtaBerth || (this.EtaBerth != null && this.EtaBerth.Equals(input.EtaBerth)) ) && ( this.EtaBerthFixed == input.EtaBerthFixed || (this.EtaBerthFixed != null && this.EtaBerthFixed.Equals(input.EtaBerthFixed)) ) && ( this.EtdBerth == input.EtdBerth || (this.EtdBerth != null && this.EtdBerth.Equals(input.EtdBerth)) ) && ( this.EtdBerthFixed == input.EtdBerthFixed || (this.EtdBerthFixed != null && this.EtdBerthFixed.Equals(input.EtdBerthFixed)) ) && ( this.LockTime == input.LockTime || (this.LockTime != null && this.LockTime.Equals(input.LockTime)) ) && ( this.LockTimeFixed == input.LockTimeFixed || (this.LockTimeFixed != null && this.LockTimeFixed.Equals(input.LockTimeFixed)) ) && ( this.ZoneEntry == input.ZoneEntry || (this.ZoneEntry != null && this.ZoneEntry.Equals(input.ZoneEntry)) ) && ( this.ZoneEntryFixed == input.ZoneEntryFixed || (this.ZoneEntryFixed != null && this.ZoneEntryFixed.Equals(input.ZoneEntryFixed)) ) && ( this.OperationsStart == input.OperationsStart || (this.OperationsStart != null && this.OperationsStart.Equals(input.OperationsStart)) ) && ( this.OperationsEnd == input.OperationsEnd || (this.OperationsEnd != null && this.OperationsEnd.Equals(input.OperationsEnd)) ) && ( this.Remarks == input.Remarks || (this.Remarks != null && this.Remarks.Equals(input.Remarks)) ) && ( this.ShipcallId == input.ShipcallId || this.ShipcallId.Equals(input.ShipcallId) ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) ) && ( this.BerthId == input.BerthId || (this.BerthId != null && this.BerthId.Equals(input.BerthId)) ) && ( this.BerthInfo == input.BerthInfo || (this.BerthInfo != null && this.BerthInfo.Equals(input.BerthInfo)) ) && ( this.PierSide == input.PierSide || (this.PierSide != null && this.PierSide.Equals(input.PierSide)) ) && ( this.ParticipantType == input.ParticipantType || (this.ParticipantType != null && this.ParticipantType.Equals(input.ParticipantType)) ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.EtaBerth != null) { hashCode = (hashCode * 59) + this.EtaBerth.GetHashCode(); } if (this.EtaBerthFixed != null) { hashCode = (hashCode * 59) + this.EtaBerthFixed.GetHashCode(); } if (this.EtdBerth != null) { hashCode = (hashCode * 59) + this.EtdBerth.GetHashCode(); } if (this.EtdBerthFixed != null) { hashCode = (hashCode * 59) + this.EtdBerthFixed.GetHashCode(); } if (this.LockTime != null) { hashCode = (hashCode * 59) + this.LockTime.GetHashCode(); } if (this.LockTimeFixed != null) { hashCode = (hashCode * 59) + this.LockTimeFixed.GetHashCode(); } if (this.ZoneEntry != null) { hashCode = (hashCode * 59) + this.ZoneEntry.GetHashCode(); } if (this.ZoneEntryFixed != null) { hashCode = (hashCode * 59) + this.ZoneEntryFixed.GetHashCode(); } if (this.OperationsStart != null) { hashCode = (hashCode * 59) + this.OperationsStart.GetHashCode(); } if (this.OperationsEnd != null) { hashCode = (hashCode * 59) + this.OperationsEnd.GetHashCode(); } if (this.Remarks != null) { hashCode = (hashCode * 59) + this.Remarks.GetHashCode(); } hashCode = (hashCode * 59) + this.ShipcallId.GetHashCode(); hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); if (this.BerthId != null) { hashCode = (hashCode * 59) + this.BerthId.GetHashCode(); } if (this.BerthInfo != null) { hashCode = (hashCode * 59) + this.BerthInfo.GetHashCode(); } if (this.PierSide != null) { hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); } if (this.ParticipantType != null) { hashCode = (hashCode * 59) + this.ParticipantType.GetHashCode(); } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); } if (this.Modified != null) { hashCode = (hashCode * 59) + this.Modified.GetHashCode(); } return hashCode; } } /// /// 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 System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Remarks, length must be less than 512.", new [] { "Remarks" }); } yield break; } } } /* * Bremen calling API * * Administer DEBRE ship calls, times and notifications * * The version of the OpenAPI document: 0.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 : IEquatable, 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 /// [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// /// Gets or Sets OldPassword /// [DataMember(Name = "old_password", EmitDefaultValue = true)] public string OldPassword { get; set; } /// /// Gets or Sets NewPassword /// [DataMember(Name = "new_password", EmitDefaultValue = true)] public string NewPassword { get; set; } /// /// Gets or Sets FirstName /// [DataMember(Name = "first_name", EmitDefaultValue = true)] public string FirstName { get; set; } /// /// Gets or Sets LastName /// [DataMember(Name = "last_name", EmitDefaultValue = true)] public string LastName { get; set; } /// /// Gets or Sets UserPhone /// [DataMember(Name = "user_phone", EmitDefaultValue = true)] public string UserPhone { get; set; } /// /// Gets or Sets UserEmail /// [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); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return this.Equals(input as UserDetails); } /// /// Returns true if UserDetails instances are equal /// /// Instance of UserDetails to be compared /// Boolean public bool Equals(UserDetails input) { if (input == null) { return false; } return ( this.Id == input.Id || this.Id.Equals(input.Id) ) && ( this.OldPassword == input.OldPassword || (this.OldPassword != null && this.OldPassword.Equals(input.OldPassword)) ) && ( this.NewPassword == input.NewPassword || (this.NewPassword != null && this.NewPassword.Equals(input.NewPassword)) ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) ) && ( this.UserEmail == input.UserEmail || (this.UserEmail != null && this.UserEmail.Equals(input.UserEmail)) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.OldPassword != null) { hashCode = (hashCode * 59) + this.OldPassword.GetHashCode(); } if (this.NewPassword != null) { hashCode = (hashCode * 59) + this.NewPassword.GetHashCode(); } if (this.FirstName != null) { hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); } if (this.LastName != null) { hashCode = (hashCode * 59) + this.LastName.GetHashCode(); } if (this.UserPhone != null) { hashCode = (hashCode * 59) + this.UserPhone.GetHashCode(); } if (this.UserEmail != null) { hashCode = (hashCode * 59) + this.UserEmail.GetHashCode(); } return hashCode; } } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { 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' }