diff --git a/.editorconfig b/.editorconfig
index 81a6f6b..db96db1 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -18,7 +18,7 @@ insert_final_newline = false
# Organize usings
dotnet_separate_import_directive_groups = true
-file_header_template = --------------------------------------------------------------------------------------------------------------------\n\nOpenSky project 2021-2022\n\n--------------------------------------------------------------------------------------------------------------------
+file_header_template = --------------------------------------------------------------------------------------------------------------------\n\nOpenSky project 2021-2023\n\n--------------------------------------------------------------------------------------------------------------------
# this. and Me. preferences
dotnet_style_qualification_for_event = true:suggestion
diff --git a/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs b/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs
index c0052d6..d301eaf 100644
--- a/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs
+++ b/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs
@@ -1,6 +1,6 @@
//----------------------
//
-// Generated using the NSwag toolchain v13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
+// Generated using the NSwag toolchain v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
//
//----------------------
@@ -9,62 +9,76 @@
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
+#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
+#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
+#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
namespace OpenSkyApi
{
using System = global::System;
-
- [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v11.0.0.0))")]
+
+ [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class OpenSkyService : OpenSkyServiceBase
{
private string _baseUrl = "";
private System.Net.Http.HttpClient _httpClient;
private System.Lazy _settings;
-
+
public OpenSkyService(string baseUrl, System.Net.Http.HttpClient httpClient)
{
- BaseUrl = baseUrl;
- _httpClient = httpClient;
+ BaseUrl = baseUrl;
+ _httpClient = httpClient;
_settings = new System.Lazy(CreateSerializerSettings);
}
-
+
private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings()
{
var settings = new Newtonsoft.Json.JsonSerializerSettings();
UpdateJsonSerializerSettings(settings);
return settings;
}
-
- public string BaseUrl
+
+ public string BaseUrl
{
get { return _baseUrl; }
set { _baseUrl = value; }
}
-
+
protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }
-
+
partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
+
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);
-
- /// Gets the user's account overview including profile image.
+
+ ///
+ /// Gets the user's account overview including profile image.
+ ///
+ ///
+ /// sushi.at, 11/07/2021.
+ ///
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task GetAccountOverviewAsync()
+ public virtual System.Threading.Tasks.Task GetAccountOverviewAsync()
{
return GetAccountOverviewAsync(System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Gets the user's account overview including profile image.
+ ///
+ /// Gets the user's account overview including profile image.
+ ///
+ ///
+ /// sushi.at, 11/07/2021.
+ ///
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task GetAccountOverviewAsync(System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetAccountOverviewAsync(System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Account/accountOverview");
-
+
var client_ = _httpClient;
var disposeClient_ = false;
try
@@ -73,12 +87,14 @@ public async System.Threading.Tasks.Task GetAccountO
{
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -89,13 +105,13 @@ public async System.Threading.Tasks.Task GetAccountO
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -104,7 +120,7 @@ public async System.Threading.Tasks.Task GetAccountO
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -121,24 +137,34 @@ public async System.Threading.Tasks.Task GetAccountO
client_.Dispose();
}
}
-
- /// Gets the user's linked accounts.
+
+ ///
+ /// Gets the user's linked accounts.
+ ///
+ ///
+ /// sushi.at, 11/07/2021.
+ ///
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task GetLinkedAccountsAsync()
+ public virtual System.Threading.Tasks.Task GetLinkedAccountsAsync()
{
return GetLinkedAccountsAsync(System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Gets the user's linked accounts.
+ ///
+ /// Gets the user's linked accounts.
+ ///
+ ///
+ /// sushi.at, 11/07/2021.
+ ///
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task GetLinkedAccountsAsync(System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetLinkedAccountsAsync(System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Account/linkedAccounts");
-
+
var client_ = _httpClient;
var disposeClient_ = false;
try
@@ -147,12 +173,14 @@ public async System.Threading.Tasks.Task GetLinkedAcc
{
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -163,13 +191,13 @@ public async System.Threading.Tasks.Task GetLinkedAcc
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -178,7 +206,7 @@ public async System.Threading.Tasks.Task GetLinkedAcc
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -195,43 +223,56 @@ public async System.Threading.Tasks.Task GetLinkedAcc
client_.Dispose();
}
}
-
- /// Updates user's linked accounts.
+
+ ///
+ /// Updates user's linked accounts.
+ ///
+ ///
+ /// sushi.at, 11/07/2021.
+ ///
/// The linked accounts.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task UpdateLinkedAccountsAsync(LinkedAccounts body)
+ public virtual System.Threading.Tasks.Task UpdateLinkedAccountsAsync(LinkedAccounts body)
{
return UpdateLinkedAccountsAsync(body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Updates user's linked accounts.
+ ///
+ /// Updates user's linked accounts.
+ ///
+ ///
+ /// sushi.at, 11/07/2021.
+ ///
/// The linked accounts.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task UpdateLinkedAccountsAsync(LinkedAccounts body, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task UpdateLinkedAccountsAsync(LinkedAccounts body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Account/linkedAccounts");
-
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("PUT");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -242,13 +283,13 @@ public async System.Threading.Tasks.Task UpdateLinkedAccounts
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -257,7 +298,7 @@ public async System.Threading.Tasks.Task UpdateLinkedAccounts
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -274,45 +315,56 @@ public async System.Threading.Tasks.Task UpdateLinkedAccounts
client_.Dispose();
}
}
-
- /// Sets the token renewal country verification.
- /// True to enable, false to disable the verification.
+
+ ///
+ /// Get profile image for the specified user ID.
+ ///
+ ///
+ /// sushi.at, 23/11/2023.
+ ///
+ /// The ID of the OpenSky user.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task SetTokenRenewalCountryVerificationAsync(bool enableVerification)
+ public virtual System.Threading.Tasks.Task GetProfileImageAsync(System.Guid userId)
{
- return SetTokenRenewalCountryVerificationAsync(enableVerification, System.Threading.CancellationToken.None);
+ return GetProfileImageAsync(userId, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Sets the token renewal country verification.
- /// True to enable, false to disable the verification.
+ ///
+ /// Get profile image for the specified user ID.
+ ///
+ ///
+ /// sushi.at, 23/11/2023.
+ ///
+ /// The ID of the OpenSky user.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task SetTokenRenewalCountryVerificationAsync(bool enableVerification, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetProfileImageAsync(System.Guid userId, System.Threading.CancellationToken cancellationToken)
{
- if (enableVerification == null)
- throw new System.ArgumentNullException("enableVerification");
-
+ if (userId == null)
+ throw new System.ArgumentNullException("userId");
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Account/tokenRenewalCountryVerification/{enableVerification}");
- urlBuilder_.Replace("{enableVerification}", System.Uri.EscapeDataString(ConvertToString(enableVerification, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Account/profileImage/{userId}");
+ urlBuilder_.Replace("{userId}", System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
- request_.Method = new System.Net.Http.HttpMethod("PUT");
+ request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -323,13 +375,13 @@ public async System.Threading.Tasks.Task SetTokenRenewalCount
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -338,7 +390,7 @@ public async System.Threading.Tasks.Task SetTokenRenewalCount
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -355,52 +407,50 @@ public async System.Threading.Tasks.Task SetTokenRenewalCount
client_.Dispose();
}
}
-
- /// Upload profile image.
+
+ ///
+ /// Get the list of all OpenSky users.
+ ///
+ ///
+ /// sushi.at, 22/11/2023.
+ ///
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task UploadProfileImageAsync(FileParameter fileUpload)
+ public virtual System.Threading.Tasks.Task GetUsersAsync()
{
- return UploadProfileImageAsync(fileUpload, System.Threading.CancellationToken.None);
+ return GetUsersAsync(System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Upload profile image.
+ ///
+ /// Get the list of all OpenSky users.
+ ///
+ ///
+ /// sushi.at, 22/11/2023.
+ ///
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task UploadProfileImageAsync(FileParameter fileUpload, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetUsersAsync(System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Account/profileImage");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Account/users");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var boundary_ = System.Guid.NewGuid().ToString();
- var content_ = new System.Net.Http.MultipartFormDataContent(boundary_);
- content_.Headers.Remove("Content-Type");
- content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_);
- if (fileUpload == null)
- throw new System.ArgumentNullException("fileUpload");
- else
- {
- var content_fileUpload_ = new System.Net.Http.StreamContent(fileUpload.Data);
- if (!string.IsNullOrEmpty(fileUpload.ContentType))
- content_fileUpload_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(fileUpload.ContentType);
- content_.Add(content_fileUpload_, "fileUpload", fileUpload.FileName ?? "fileUpload");
- }
- request_.Content = content_;
- request_.Method = new System.Net.Http.HttpMethod("POST");
+ request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -411,13 +461,13 @@ public async System.Threading.Tasks.Task UploadProfileImageAs
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -426,7 +476,7 @@ public async System.Threading.Tasks.Task UploadProfileImageAs
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -443,44 +493,56 @@ public async System.Threading.Tasks.Task UploadProfileImageAs
client_.Dispose();
}
}
-
- /// Get the aircraft record for the specified registry.
- /// The registry.
+
+ ///
+ /// Adds or removes the moderator role from the specified user.
+ ///
+ ///
+ /// sushi.at, 21/11/2023.
+ ///
+ /// The moderator role model.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task GetAircraftAsync(string registry)
+ public virtual System.Threading.Tasks.Task SetModeratorRoleAsync(ModeratorRole body)
{
- return GetAircraftAsync(registry, System.Threading.CancellationToken.None);
+ return SetModeratorRoleAsync(body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Get the aircraft record for the specified registry.
- /// The registry.
+ ///
+ /// Adds or removes the moderator role from the specified user.
+ ///
+ ///
+ /// sushi.at, 21/11/2023.
+ ///
+ /// The moderator role model.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task GetAircraftAsync(string registry, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task SetModeratorRoleAsync(ModeratorRole body, System.Threading.CancellationToken cancellationToken)
{
- if (registry == null)
- throw new System.ArgumentNullException("registry");
-
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/{registry}");
- urlBuilder_.Replace("{registry}", System.Uri.EscapeDataString(ConvertToString(registry, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Account/moderatorRole");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Method = new System.Net.Http.HttpMethod("GET");
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ request_.Content = content_;
+ request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -491,13 +553,13 @@ public async System.Threading.Tasks.Task GetAircraftAsync(s
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -506,7 +568,7 @@ public async System.Threading.Tasks.Task GetAircraftAsync(s
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -523,44 +585,57 @@ public async System.Threading.Tasks.Task GetAircraftAsync(s
client_.Dispose();
}
}
-
- /// Get the aircraft at a given airport.
- /// The icao of the airport.
+
+ ///
+ /// Sets the token renewal country verification.
+ ///
+ ///
+ /// sushi.at, 30/11/2021.
+ ///
+ /// True to enable, false to disable the verification.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task GetAircraftAtAirportAsync(string icao)
+ public virtual System.Threading.Tasks.Task SetTokenRenewalCountryVerificationAsync(bool enableVerification)
{
- return GetAircraftAtAirportAsync(icao, System.Threading.CancellationToken.None);
+ return SetTokenRenewalCountryVerificationAsync(enableVerification, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Get the aircraft at a given airport.
- /// The icao of the airport.
+ ///
+ /// Sets the token renewal country verification.
+ ///
+ ///
+ /// sushi.at, 30/11/2021.
+ ///
+ /// True to enable, false to disable the verification.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task GetAircraftAtAirportAsync(string icao, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task SetTokenRenewalCountryVerificationAsync(bool enableVerification, System.Threading.CancellationToken cancellationToken)
{
- if (icao == null)
- throw new System.ArgumentNullException("icao");
-
+ if (enableVerification == null)
+ throw new System.ArgumentNullException("enableVerification");
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/atAirport/{icao}");
- urlBuilder_.Replace("{icao}", System.Uri.EscapeDataString(ConvertToString(icao, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Account/tokenRenewalCountryVerification/{enableVerification}");
+ urlBuilder_.Replace("{enableVerification}", System.Uri.EscapeDataString(ConvertToString(enableVerification, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Method = new System.Net.Http.HttpMethod("GET");
+ request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
+ request_.Method = new System.Net.Http.HttpMethod("PUT");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -571,13 +646,13 @@ public async System.Threading.Tasks.Task GetAirc
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -586,7 +661,7 @@ public async System.Threading.Tasks.Task GetAirc
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -603,38 +678,65 @@ public async System.Threading.Tasks.Task GetAirc
client_.Dispose();
}
}
-
- /// Get the player owned aircraft.
+
+ ///
+ /// Upload profile image.
+ ///
+ ///
+ /// sushi.at, 12/07/2021.
+ ///
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task GetMyAircraftAsync()
+ public virtual System.Threading.Tasks.Task UploadProfileImageAsync(FileParameter fileUpload)
{
- return GetMyAircraftAsync(System.Threading.CancellationToken.None);
+ return UploadProfileImageAsync(fileUpload, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Get the player owned aircraft.
+ ///
+ /// Upload profile image.
+ ///
+ ///
+ /// sushi.at, 12/07/2021.
+ ///
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task GetMyAircraftAsync(System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task UploadProfileImageAsync(FileParameter fileUpload, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/myAircraft");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Account/profileImage");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Method = new System.Net.Http.HttpMethod("GET");
+ var boundary_ = System.Guid.NewGuid().ToString();
+ var content_ = new System.Net.Http.MultipartFormDataContent(boundary_);
+ content_.Headers.Remove("Content-Type");
+ content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_);
+
+ if (fileUpload == null)
+ throw new System.ArgumentNullException("fileUpload");
+ else
+ {
+ var content_fileUpload_ = new System.Net.Http.StreamContent(fileUpload.Data);
+ if (!string.IsNullOrEmpty(fileUpload.ContentType))
+ content_fileUpload_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(fileUpload.ContentType);
+ content_.Add(content_fileUpload_, "fileUpload", fileUpload.FileName ?? "fileUpload");
+ }
+ request_.Content = content_;
+ request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -645,13 +747,13 @@ public async System.Threading.Tasks.Task GetMyAi
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -660,7 +762,7 @@ public async System.Threading.Tasks.Task GetMyAi
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -677,43 +779,56 @@ public async System.Threading.Tasks.Task GetMyAi
client_.Dispose();
}
}
-
- /// Perform ground operations for the specified aircraft.
- /// The operations to be performed (fuel and payload loading).
+
+ ///
+ /// Get the aircraft record for the specified registry.
+ ///
+ ///
+ /// sushi.at, 19/07/2021.
+ ///
+ /// The registry.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task PerformGroundOperationsAsync(GroundOperations body)
+ public virtual System.Threading.Tasks.Task GetAircraftAsync(string registry)
{
- return PerformGroundOperationsAsync(body, System.Threading.CancellationToken.None);
+ return GetAircraftAsync(registry, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Perform ground operations for the specified aircraft.
- /// The operations to be performed (fuel and payload loading).
+ ///
+ /// Get the aircraft record for the specified registry.
+ ///
+ ///
+ /// sushi.at, 19/07/2021.
+ ///
+ /// The registry.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task PerformGroundOperationsAsync(GroundOperations body, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetAircraftAsync(string registry, System.Threading.CancellationToken cancellationToken)
{
+ if (registry == null)
+ throw new System.ArgumentNullException("registry");
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/groundOperations");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/{registry}");
+ urlBuilder_.Replace("{registry}", System.Uri.EscapeDataString(ConvertToString(registry, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
- content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
- request_.Content = content_;
- request_.Method = new System.Net.Http.HttpMethod("PUT");
+ request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -724,13 +839,13 @@ public async System.Threading.Tasks.Task PerformGroundOperati
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -739,7 +854,7 @@ public async System.Threading.Tasks.Task PerformGroundOperati
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -756,43 +871,56 @@ public async System.Threading.Tasks.Task PerformGroundOperati
client_.Dispose();
}
}
-
- /// Purchase specified aircraft.
- /// The purchase aircraft model.
+
+ ///
+ /// Get the aircraft at a given airport.
+ ///
+ ///
+ /// sushi.at, 19/07/2021.
+ ///
+ /// The icao of the airport.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task PurchaseAircraftAsync(PurchaseAircraft body)
+ public virtual System.Threading.Tasks.Task GetAircraftAtAirportAsync(string icao)
{
- return PurchaseAircraftAsync(body, System.Threading.CancellationToken.None);
+ return GetAircraftAtAirportAsync(icao, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Purchase specified aircraft.
- /// The purchase aircraft model.
+ ///
+ /// Get the aircraft at a given airport.
+ ///
+ ///
+ /// sushi.at, 19/07/2021.
+ ///
+ /// The icao of the airport.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task PurchaseAircraftAsync(PurchaseAircraft body, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetAircraftAtAirportAsync(string icao, System.Threading.CancellationToken cancellationToken)
{
+ if (icao == null)
+ throw new System.ArgumentNullException("icao");
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/purchase");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/atAirport/{icao}");
+ urlBuilder_.Replace("{icao}", System.Uri.EscapeDataString(ConvertToString(icao, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
- content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
- request_.Content = content_;
- request_.Method = new System.Net.Http.HttpMethod("POST");
+ request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -803,13 +931,13 @@ public async System.Threading.Tasks.Task PurchaseAircraftAsyn
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -818,7 +946,7 @@ public async System.Threading.Tasks.Task PurchaseAircraftAsyn
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -835,43 +963,50 @@ public async System.Threading.Tasks.Task PurchaseAircraftAsyn
client_.Dispose();
}
}
-
- /// Purchase new aircraft.
- /// The purchase new aircraft model.
+
+ ///
+ /// Get the player owned aircraft.
+ ///
+ ///
+ /// sushi.at, 19/07/2021.
+ ///
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task PurchaseNewAircraftAsync(PurchaseNewAircraft body)
+ public virtual System.Threading.Tasks.Task GetMyAircraftAsync()
{
- return PurchaseNewAircraftAsync(body, System.Threading.CancellationToken.None);
+ return GetMyAircraftAsync(System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Purchase new aircraft.
- /// The purchase new aircraft model.
+ ///
+ /// Get the player owned aircraft.
+ ///
+ ///
+ /// sushi.at, 19/07/2021.
+ ///
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task PurchaseNewAircraftAsync(PurchaseNewAircraft body, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetMyAircraftAsync(System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/purchaseNew");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/myAircraft");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
- content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
- request_.Content = content_;
- request_.Method = new System.Net.Http.HttpMethod("POST");
+ request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -882,13 +1017,13 @@ public async System.Threading.Tasks.Task PurchaseNewAircraftA
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -897,7 +1032,7 @@ public async System.Threading.Tasks.Task PurchaseNewAircraftA
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -914,41 +1049,56 @@ public async System.Threading.Tasks.Task PurchaseNewAircraftA
client_.Dispose();
}
}
-
- /// Searches for aircraft around a given airport.
+
+ ///
+ /// Perform ground operations for the specified aircraft.
+ ///
+ ///
+ /// sushi.at, 20/12/2021.
+ ///
+ /// The operations to be performed (fuel and payload loading).
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task SearchAircraftAroundAirportAsync(AircraftSearchAroundAirport body)
+ public virtual System.Threading.Tasks.Task PerformGroundOperationsAsync(GroundOperations body)
{
- return SearchAircraftAroundAirportAsync(body, System.Threading.CancellationToken.None);
+ return PerformGroundOperationsAsync(body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Searches for aircraft around a given airport.
+ ///
+ /// Perform ground operations for the specified aircraft.
+ ///
+ ///
+ /// sushi.at, 20/12/2021.
+ ///
+ /// The operations to be performed (fuel and payload loading).
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task SearchAircraftAroundAirportAsync(AircraftSearchAroundAirport body, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task PerformGroundOperationsAsync(GroundOperations body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/searchAroundAirport");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/groundOperations");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
- request_.Method = new System.Net.Http.HttpMethod("POST");
+ request_.Method = new System.Net.Http.HttpMethod("PUT");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -959,13 +1109,13 @@ public async System.Threading.Tasks.Task SearchA
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -974,7 +1124,7 @@ public async System.Threading.Tasks.Task SearchA
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -991,43 +1141,56 @@ public async System.Threading.Tasks.Task SearchA
client_.Dispose();
}
}
-
- /// Searches for aircraft matching the criteria in the specified country.
- /// The search.
+
+ ///
+ /// Purchase specified aircraft.
+ ///
+ ///
+ /// sushi.at, 19/07/2021.
+ ///
+ /// The purchase aircraft model.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task SearchAircraftInCountryAsync(AircraftSearchInCountry body)
+ public virtual System.Threading.Tasks.Task PurchaseAircraftAsync(PurchaseAircraft body)
{
- return SearchAircraftInCountryAsync(body, System.Threading.CancellationToken.None);
+ return PurchaseAircraftAsync(body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Searches for aircraft matching the criteria in the specified country.
- /// The search.
+ ///
+ /// Purchase specified aircraft.
+ ///
+ ///
+ /// sushi.at, 19/07/2021.
+ ///
+ /// The purchase aircraft model.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task SearchAircraftInCountryAsync(AircraftSearchInCountry body, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task PurchaseAircraftAsync(PurchaseAircraft body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/searchInCountry");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/purchase");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1038,13 +1201,13 @@ public async System.Threading.Tasks.Task SearchA
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1053,7 +1216,7 @@ public async System.Threading.Tasks.Task SearchA
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1070,45 +1233,56 @@ public async System.Threading.Tasks.Task SearchA
client_.Dispose();
}
}
-
- /// Sell aircraft back to system.
- /// The registry of the aircraft to sell.
+
+ ///
+ /// Purchase new aircraft.
+ ///
+ ///
+ /// sushi.at, 14/02/2022.
+ ///
+ /// The purchase new aircraft model.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task SellAircraftToSystemAsync(string registry)
+ public virtual System.Threading.Tasks.Task PurchaseNewAircraftAsync(PurchaseNewAircraft body)
{
- return SellAircraftToSystemAsync(registry, System.Threading.CancellationToken.None);
+ return PurchaseNewAircraftAsync(body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Sell aircraft back to system.
- /// The registry of the aircraft to sell.
+ ///
+ /// Purchase new aircraft.
+ ///
+ ///
+ /// sushi.at, 14/02/2022.
+ ///
+ /// The purchase new aircraft model.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task SellAircraftToSystemAsync(string registry, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task PurchaseNewAircraftAsync(PurchaseNewAircraft body, System.Threading.CancellationToken cancellationToken)
{
- if (registry == null)
- throw new System.ArgumentNullException("registry");
-
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/sellToSystem/{registry}");
- urlBuilder_.Replace("{registry}", System.Uri.EscapeDataString(ConvertToString(registry, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/purchaseNew");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1119,13 +1293,13 @@ public async System.Threading.Tasks.Task SellAircraftToSystem
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1134,7 +1308,7 @@ public async System.Threading.Tasks.Task SellAircraftToSystem
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1151,43 +1325,54 @@ public async System.Threading.Tasks.Task SellAircraftToSystem
client_.Dispose();
}
}
-
- /// Updates the specified aircraft (user editable properties only)
- /// The update aircraft.
+
+ ///
+ /// Searches for aircraft around a given airport.
+ ///
+ ///
+ /// sushi.at, 24/02/2022.
+ ///
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task UpdateAircraftAsync(UpdateAircraft body)
+ public virtual System.Threading.Tasks.Task SearchAircraftAroundAirportAsync(AircraftSearchAroundAirport body)
{
- return UpdateAircraftAsync(body, System.Threading.CancellationToken.None);
+ return SearchAircraftAroundAirportAsync(body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Updates the specified aircraft (user editable properties only)
- /// The update aircraft.
+ ///
+ /// Searches for aircraft around a given airport.
+ ///
+ ///
+ /// sushi.at, 24/02/2022.
+ ///
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task UpdateAircraftAsync(UpdateAircraft body, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task SearchAircraftAroundAirportAsync(AircraftSearchAroundAirport body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/searchAroundAirport");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
- request_.Method = new System.Net.Http.HttpMethod("PUT");
+ request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1198,13 +1383,13 @@ public async System.Threading.Tasks.Task UpdateAircraftAsync(
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1213,7 +1398,7 @@ public async System.Threading.Tasks.Task UpdateAircraftAsync(
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1230,43 +1415,56 @@ public async System.Threading.Tasks.Task UpdateAircraftAsync(
client_.Dispose();
}
}
-
- /// Adds a new aircraft type.
- /// The new aircraft type to add.
+
+ ///
+ /// Searches for aircraft matching the criteria in the specified country.
+ ///
+ ///
+ /// sushi.at, 27/07/2021.
+ ///
+ /// The search.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task AddAircraftTypeAsync(AircraftType body)
+ public virtual System.Threading.Tasks.Task SearchAircraftInCountryAsync(AircraftSearchInCountry body)
{
- return AddAircraftTypeAsync(body, System.Threading.CancellationToken.None);
+ return SearchAircraftInCountryAsync(body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Adds a new aircraft type.
- /// The new aircraft type to add.
+ ///
+ /// Searches for aircraft matching the criteria in the specified country.
+ ///
+ ///
+ /// sushi.at, 27/07/2021.
+ ///
+ /// The search.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task AddAircraftTypeAsync(AircraftType body, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task SearchAircraftInCountryAsync(AircraftSearchInCountry body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/searchInCountry");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1277,13 +1475,13 @@ public async System.Threading.Tasks.Task AddAircraftTypeAsync
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1292,7 +1490,7 @@ public async System.Threading.Tasks.Task AddAircraftTypeAsync
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1309,38 +1507,57 @@ public async System.Threading.Tasks.Task AddAircraftTypeAsync
client_.Dispose();
}
}
-
- /// Gets all enabled and current aircraft types.
+
+ ///
+ /// Sell aircraft back to system.
+ ///
+ ///
+ /// sushi.at, 23/12/2021.
+ ///
+ /// The registry of the aircraft to sell.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task GetAircraftTypesAsync()
+ public virtual System.Threading.Tasks.Task SellAircraftToSystemAsync(string registry)
{
- return GetAircraftTypesAsync(System.Threading.CancellationToken.None);
+ return SellAircraftToSystemAsync(registry, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Gets all enabled and current aircraft types.
+ ///
+ /// Sell aircraft back to system.
+ ///
+ ///
+ /// sushi.at, 23/12/2021.
+ ///
+ /// The registry of the aircraft to sell.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task GetAircraftTypesAsync(System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task SellAircraftToSystemAsync(string registry, System.Threading.CancellationToken cancellationToken)
{
+ if (registry == null)
+ throw new System.ArgumentNullException("registry");
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft/sellToSystem/{registry}");
+ urlBuilder_.Replace("{registry}", System.Uri.EscapeDataString(ConvertToString(registry, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Method = new System.Net.Http.HttpMethod("GET");
+ request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
+ request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1351,13 +1568,13 @@ public async System.Threading.Tasks.Task Get
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1366,7 +1583,7 @@ public async System.Threading.Tasks.Task Get
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1383,43 +1600,56 @@ public async System.Threading.Tasks.Task Get
client_.Dispose();
}
}
-
- /// Updates an existing aircraft type.
- /// The aircraft type to update.
+
+ ///
+ /// Updates the specified aircraft (user editable properties only)
+ ///
+ ///
+ /// sushi.at, 17/09/2021.
+ ///
+ /// The update aircraft.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task UpdateAircraftTypeAsync(AircraftType body)
+ public virtual System.Threading.Tasks.Task UpdateAircraftAsync(UpdateAircraft body)
{
- return UpdateAircraftTypeAsync(body, System.Threading.CancellationToken.None);
+ return UpdateAircraftAsync(body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Updates an existing aircraft type.
- /// The aircraft type to update.
+ ///
+ /// Updates the specified aircraft (user editable properties only)
+ ///
+ ///
+ /// sushi.at, 17/09/2021.
+ ///
+ /// The update aircraft.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task UpdateAircraftTypeAsync(AircraftType body, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task UpdateAircraftAsync(UpdateAircraft body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Aircraft");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("PUT");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1430,13 +1660,13 @@ public async System.Threading.Tasks.Task UpdateAircraftTypeAs
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1445,7 +1675,7 @@ public async System.Threading.Tasks.Task UpdateAircraftTypeAs
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1462,44 +1692,63 @@ public async System.Threading.Tasks.Task UpdateAircraftTypeAs
client_.Dispose();
}
}
-
- /// Deletes the specified aircraft type.
- /// Identifier for the type.
+
+ ///
+ /// Adds a new aircraft type.
+ ///
+ ///
+ /// sushi.at, 02/06/2021.
+ ///
+ /// The ID of the aircraft type this one is an update for (auto adjusts next version and variants).
+ /// The new aircraft type to add.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task DeleteAircraftTypeAsync(System.Guid typeID)
+ public virtual System.Threading.Tasks.Task AddAircraftTypeAsync(System.Guid? upgradeForType, AircraftType body)
{
- return DeleteAircraftTypeAsync(typeID, System.Threading.CancellationToken.None);
+ return AddAircraftTypeAsync(upgradeForType, body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Deletes the specified aircraft type.
- /// Identifier for the type.
+ ///
+ /// Adds a new aircraft type.
+ ///
+ ///
+ /// sushi.at, 02/06/2021.
+ ///
+ /// The ID of the aircraft type this one is an update for (auto adjusts next version and variants).
+ /// The new aircraft type to add.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task DeleteAircraftTypeAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task AddAircraftTypeAsync(System.Guid? upgradeForType, AircraftType body, System.Threading.CancellationToken cancellationToken)
{
- if (typeID == null)
- throw new System.ArgumentNullException("typeID");
-
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/{typeID}");
- urlBuilder_.Replace("{typeID}", System.Uri.EscapeDataString(ConvertToString(typeID, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType?");
+ if (upgradeForType != null)
+ {
+ urlBuilder_.Append(System.Uri.EscapeDataString("upgradeForType") + "=").Append(System.Uri.EscapeDataString(ConvertToString(upgradeForType, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ }
+ urlBuilder_.Length--;
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Method = new System.Net.Http.HttpMethod("DELETE");
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ request_.Content = content_;
+ request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1510,13 +1759,13 @@ public async System.Threading.Tasks.Task DeleteAircraftTypeAs
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1525,7 +1774,7 @@ public async System.Threading.Tasks.Task DeleteAircraftTypeAs
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1542,45 +1791,50 @@ public async System.Threading.Tasks.Task DeleteAircraftTypeAs
client_.Dispose();
}
}
-
- /// Disables the specified aircraft type.
- /// Identifier for the type.
+
+ ///
+ /// Gets all enabled and current aircraft types.
+ ///
+ ///
+ /// sushi.at, 02/06/2021.
+ ///
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task DisableAircraftTypeAsync(System.Guid typeID)
+ public virtual System.Threading.Tasks.Task GetAircraftTypesAsync()
{
- return DisableAircraftTypeAsync(typeID, System.Threading.CancellationToken.None);
+ return GetAircraftTypesAsync(System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Disables the specified aircraft type.
- /// Identifier for the type.
+ ///
+ /// Gets all enabled and current aircraft types.
+ ///
+ ///
+ /// sushi.at, 02/06/2021.
+ ///
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task DisableAircraftTypeAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetAircraftTypesAsync(System.Threading.CancellationToken cancellationToken)
{
- if (typeID == null)
- throw new System.ArgumentNullException("typeID");
-
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/disable/{typeID}");
- urlBuilder_.Replace("{typeID}", System.Uri.EscapeDataString(ConvertToString(typeID, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
- request_.Method = new System.Net.Http.HttpMethod("PUT");
+ request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1591,13 +1845,13 @@ public async System.Threading.Tasks.Task DisableAircraftTypeA
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1606,7 +1860,7 @@ public async System.Threading.Tasks.Task DisableAircraftTypeA
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1623,45 +1877,56 @@ public async System.Threading.Tasks.Task DisableAircraftTypeA
client_.Dispose();
}
}
-
- /// Disables the specified aircraft type's detailed checks (only to be used on patch days until a new aircraft type version can be created!).
- /// Identifier for the type.
+
+ ///
+ /// Updates an existing aircraft type.
+ ///
+ ///
+ /// sushi.at, 11/06/2021.
+ ///
+ /// The aircraft type to update.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task DisableAircraftTypeDetailedChecksAsync(System.Guid typeID)
+ public virtual System.Threading.Tasks.Task UpdateAircraftTypeAsync(AircraftType body)
{
- return DisableAircraftTypeDetailedChecksAsync(typeID, System.Threading.CancellationToken.None);
+ return UpdateAircraftTypeAsync(body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Disables the specified aircraft type's detailed checks (only to be used on patch days until a new aircraft type version can be created!).
- /// Identifier for the type.
+ ///
+ /// Updates an existing aircraft type.
+ ///
+ ///
+ /// sushi.at, 11/06/2021.
+ ///
+ /// The aircraft type to update.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task DisableAircraftTypeDetailedChecksAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task UpdateAircraftTypeAsync(AircraftType body, System.Threading.CancellationToken cancellationToken)
{
- if (typeID == null)
- throw new System.ArgumentNullException("typeID");
-
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/disableDetailedChecks/{typeID}");
- urlBuilder_.Replace("{typeID}", System.Uri.EscapeDataString(ConvertToString(typeID, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("PUT");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1672,13 +1937,13 @@ public async System.Threading.Tasks.Task DisableAircraftTypeD
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1687,7 +1952,7 @@ public async System.Threading.Tasks.Task DisableAircraftTypeD
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1704,45 +1969,56 @@ public async System.Threading.Tasks.Task DisableAircraftTypeD
client_.Dispose();
}
}
-
- /// Enables the specified aircraft type.
+
+ ///
+ /// Deletes the specified aircraft type.
+ ///
+ ///
+ /// sushi.at, 11/06/2021.
+ ///
/// Identifier for the type.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task EnableAircraftTypeAsync(System.Guid typeID)
+ public virtual System.Threading.Tasks.Task DeleteAircraftTypeAsync(System.Guid typeID)
{
- return EnableAircraftTypeAsync(typeID, System.Threading.CancellationToken.None);
+ return DeleteAircraftTypeAsync(typeID, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Enables the specified aircraft type.
+ ///
+ /// Deletes the specified aircraft type.
+ ///
+ ///
+ /// sushi.at, 11/06/2021.
+ ///
/// Identifier for the type.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task EnableAircraftTypeAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task DeleteAircraftTypeAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
{
if (typeID == null)
throw new System.ArgumentNullException("typeID");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/enable/{typeID}");
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/{typeID}");
urlBuilder_.Replace("{typeID}", System.Uri.EscapeDataString(ConvertToString(typeID, System.Globalization.CultureInfo.InvariantCulture)));
-
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
- request_.Method = new System.Net.Http.HttpMethod("PUT");
+ request_.Method = new System.Net.Http.HttpMethod("DELETE");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1753,13 +2029,13 @@ public async System.Threading.Tasks.Task EnableAircraftTypeAs
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1768,7 +2044,7 @@ public async System.Threading.Tasks.Task EnableAircraftTypeAs
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1785,30 +2061,40 @@ public async System.Threading.Tasks.Task EnableAircraftTypeAs
client_.Dispose();
}
}
-
- /// Enables the specified aircraft type's detailed checks (only to be used on patch days until a new aircraft type version can be created!).
+
+ ///
+ /// Disables the specified aircraft type.
+ ///
+ ///
+ /// sushi.at, 09/06/2021.
+ ///
/// Identifier for the type.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task EnableAircraftTypeDetailedChecksAsync(System.Guid typeID)
+ public virtual System.Threading.Tasks.Task DisableAircraftTypeAsync(System.Guid typeID)
{
- return EnableAircraftTypeDetailedChecksAsync(typeID, System.Threading.CancellationToken.None);
+ return DisableAircraftTypeAsync(typeID, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Enables the specified aircraft type's detailed checks (only to be used on patch days until a new aircraft type version can be created!).
+ ///
+ /// Disables the specified aircraft type.
+ ///
+ ///
+ /// sushi.at, 09/06/2021.
+ ///
/// Identifier for the type.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task EnableAircraftTypeDetailedChecksAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task DisableAircraftTypeAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
{
if (typeID == null)
throw new System.ArgumentNullException("typeID");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/enableDetailedChecks/{typeID}");
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/disable/{typeID}");
urlBuilder_.Replace("{typeID}", System.Uri.EscapeDataString(ConvertToString(typeID, System.Globalization.CultureInfo.InvariantCulture)));
-
+
var client_ = _httpClient;
var disposeClient_ = false;
try
@@ -1818,12 +2104,14 @@ public async System.Threading.Tasks.Task EnableAircraftTypeDe
request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
request_.Method = new System.Net.Http.HttpMethod("PUT");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1834,13 +2122,13 @@ public async System.Threading.Tasks.Task EnableAircraftTypeDe
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1849,7 +2137,7 @@ public async System.Threading.Tasks.Task EnableAircraftTypeDe
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -1866,38 +2154,57 @@ public async System.Threading.Tasks.Task EnableAircraftTypeDe
client_.Dispose();
}
}
-
- /// Get the list aircraft manufacturers.
+
+ ///
+ /// Disables the specified aircraft type's detailed checks (only to be used on patch days until a new aircraft type version can be created!).
+ ///
+ ///
+ /// sushi.at, 09/06/2021.
+ ///
+ /// Identifier for the type.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task GetAircraftManufacturersAsync()
+ public virtual System.Threading.Tasks.Task DisableAircraftTypeDetailedChecksAsync(System.Guid typeID)
{
- return GetAircraftManufacturersAsync(System.Threading.CancellationToken.None);
+ return DisableAircraftTypeDetailedChecksAsync(typeID, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Get the list aircraft manufacturers.
+ ///
+ /// Disables the specified aircraft type's detailed checks (only to be used on patch days until a new aircraft type version can be created!).
+ ///
+ ///
+ /// sushi.at, 09/06/2021.
+ ///
+ /// Identifier for the type.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task GetAircraftManufacturersAsync(System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task DisableAircraftTypeDetailedChecksAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
{
+ if (typeID == null)
+ throw new System.ArgumentNullException("typeID");
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/manufacturers");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/disableDetailedChecks/{typeID}");
+ urlBuilder_.Replace("{typeID}", System.Uri.EscapeDataString(ConvertToString(typeID, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Method = new System.Net.Http.HttpMethod("GET");
+ request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
+ request_.Method = new System.Net.Http.HttpMethod("PUT");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1908,13 +2215,13 @@ public async System.Threading.Tasks.Task(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -1923,7 +2230,7 @@ public async System.Threading.Tasks.TaskGet image for the specified aircraft type.
+
+ ///
+ /// Enables the specified aircraft type.
+ ///
+ ///
+ /// sushi.at, 09/06/2021.
+ ///
/// Identifier for the type.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task GetAircraftTypeImageAsync(System.Guid typeID)
+ public virtual System.Threading.Tasks.Task EnableAircraftTypeAsync(System.Guid typeID)
{
- return GetAircraftTypeImageAsync(typeID, System.Threading.CancellationToken.None);
+ return EnableAircraftTypeAsync(typeID, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Get image for the specified aircraft type.
+ ///
+ /// Enables the specified aircraft type.
+ ///
+ ///
+ /// sushi.at, 09/06/2021.
+ ///
/// Identifier for the type.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task GetAircraftTypeImageAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task EnableAircraftTypeAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
{
if (typeID == null)
throw new System.ArgumentNullException("typeID");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/image/{typeID}");
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/enable/{typeID}");
urlBuilder_.Replace("{typeID}", System.Uri.EscapeDataString(ConvertToString(typeID, System.Globalization.CultureInfo.InvariantCulture)));
-
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- request_.Method = new System.Net.Http.HttpMethod("GET");
+ request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
+ request_.Method = new System.Net.Http.HttpMethod("PUT");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -1988,13 +2308,13 @@ public async System.Threading.Tasks.Task GetAircraftTypeIm
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -2003,7 +2323,7 @@ public async System.Threading.Tasks.Task GetAircraftTypeIm
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -2020,58 +2340,57 @@ public async System.Threading.Tasks.Task GetAircraftTypeIm
client_.Dispose();
}
}
-
- /// Update the image of the specified aircraft type.
- /// Identifier for the aircraft type.
+
+ ///
+ /// Enables the specified aircraft type's detailed checks (only to be used on patch days until a new aircraft type version can be created!).
+ ///
+ ///
+ /// sushi.at, 09/06/2021.
+ ///
+ /// Identifier for the type.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task UpdateAircraftTypeImageAsync(System.Guid typeID, FileParameter fileUpload)
+ public virtual System.Threading.Tasks.Task EnableAircraftTypeDetailedChecksAsync(System.Guid typeID)
{
- return UpdateAircraftTypeImageAsync(typeID, fileUpload, System.Threading.CancellationToken.None);
+ return EnableAircraftTypeDetailedChecksAsync(typeID, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Update the image of the specified aircraft type.
- /// Identifier for the aircraft type.
+ ///
+ /// Enables the specified aircraft type's detailed checks (only to be used on patch days until a new aircraft type version can be created!).
+ ///
+ ///
+ /// sushi.at, 09/06/2021.
+ ///
+ /// Identifier for the type.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task UpdateAircraftTypeImageAsync(System.Guid typeID, FileParameter fileUpload, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task EnableAircraftTypeDetailedChecksAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
{
if (typeID == null)
throw new System.ArgumentNullException("typeID");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/image/{typeID}");
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/enableDetailedChecks/{typeID}");
urlBuilder_.Replace("{typeID}", System.Uri.EscapeDataString(ConvertToString(typeID, System.Globalization.CultureInfo.InvariantCulture)));
-
+
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
{
- var boundary_ = System.Guid.NewGuid().ToString();
- var content_ = new System.Net.Http.MultipartFormDataContent(boundary_);
- content_.Headers.Remove("Content-Type");
- content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_);
- if (fileUpload == null)
- throw new System.ArgumentNullException("fileUpload");
- else
- {
- var content_fileUpload_ = new System.Net.Http.StreamContent(fileUpload.Data);
- if (!string.IsNullOrEmpty(fileUpload.ContentType))
- content_fileUpload_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(fileUpload.ContentType);
- content_.Add(content_fileUpload_, "fileUpload", fileUpload.FileName ?? "fileUpload");
- }
- request_.Content = content_;
- request_.Method = new System.Net.Http.HttpMethod("POST");
+ request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
+ request_.Method = new System.Net.Http.HttpMethod("PUT");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -2082,13 +2401,13 @@ public async System.Threading.Tasks.Task UpdateAircraftTypeIm
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -2097,7 +2416,7 @@ public async System.Threading.Tasks.Task UpdateAircraftTypeIm
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -2114,24 +2433,34 @@ public async System.Threading.Tasks.Task UpdateAircraftTypeIm
client_.Dispose();
}
}
-
- /// Get available aircraft upgrades.
+
+ ///
+ /// Get the list aircraft manufacturers.
+ ///
+ ///
+ /// sushi.at, 20/02/2022.
+ ///
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task GetAircraftTypeUpgradesAsync()
+ public virtual System.Threading.Tasks.Task GetAircraftManufacturersAsync()
{
- return GetAircraftTypeUpgradesAsync(System.Threading.CancellationToken.None);
+ return GetAircraftManufacturersAsync(System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Get available aircraft upgrades.
+ ///
+ /// Get the list aircraft manufacturers.
+ ///
+ ///
+ /// sushi.at, 20/02/2022.
+ ///
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task GetAircraftTypeUpgradesAsync(System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetAircraftManufacturersAsync(System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/upgrades");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/manufacturers");
+
var client_ = _httpClient;
var disposeClient_ = false;
try
@@ -2140,12 +2469,14 @@ public async System.Threading.Tasks.Task(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -2171,7 +2502,7 @@ public async System.Threading.Tasks.TaskGets all aircraft types (including disabled and previous versions).
+
+ ///
+ /// Get image for the specified aircraft type.
+ ///
+ ///
+ /// sushi.at, 19/02/2022.
+ ///
+ /// Identifier for the type.
/// Success
/// A server side error occurred.
- public System.Threading.Tasks.Task GetAllAircraftTypesAsync()
+ public virtual System.Threading.Tasks.Task GetAircraftTypeImageAsync(System.Guid typeID)
{
- return GetAllAircraftTypesAsync(System.Threading.CancellationToken.None);
+ return GetAircraftTypeImageAsync(typeID, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- /// Gets all aircraft types (including disabled and previous versions).
+ ///
+ /// Get image for the specified aircraft type.
+ ///
+ ///
+ /// sushi.at, 19/02/2022.
+ ///
+ /// Identifier for the type.
/// Success
/// A server side error occurred.
- public async System.Threading.Tasks.Task GetAllAircraftTypesAsync(System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetAircraftTypeImageAsync(System.Guid typeID, System.Threading.CancellationToken cancellationToken)
{
+ if (typeID == null)
+ throw new System.ArgumentNullException("typeID");
+
var urlBuilder_ = new System.Text.StringBuilder();
- urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/all");
-
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AircraftType/image/{typeID}");
+ urlBuilder_.Replace("{typeID}", System.Uri.EscapeDataString(ConvertToString(typeID, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
var disposeClient_ = false;
try
@@ -2214,12 +2561,14 @@ public async System.Threading.Tasks.Task Get
{
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
-
+
PrepareRequest(client_, request_, urlBuilder_);
+
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+
PrepareRequest(client_, request_, url_);
-
+
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
@@ -2230,13 +2579,13 @@ public async System.Threading.Tasks.Task Get
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
+
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@@ -2245,7 +2594,7 @@ public async System.Threading.Tasks.Task Get
}
else
{
- var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
@@ -2262,46 +2611,71 @@ public async System.Threading.Tasks.Task Get
client_.Dispose();
}
}
-
- ///