This repository has been archived on 2025-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
BreCal/misc/BreCalApi.cs

8954 lines
432 KiB
C#
Raw Blame History

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