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