diff --git a/KeyfactorClientSDK/Client.cs b/KeyfactorClientSDK/Client.cs
index e138c30..c7812f2 100644
--- a/KeyfactorClientSDK/Client.cs
+++ b/KeyfactorClientSDK/Client.cs
@@ -1,17 +1,4 @@
-
-/******************************************************************************/
-/* Copyright 2022 Keyfactor */
-/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
-/* not use this file except in compliance with the License. You may obtain a */
-/* copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless */
-/* required by applicable law or agreed to in writing, software distributed */
-/* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES */
-/* OR CONDITIONS OF ANY KIND, either express or implied. See the License for */
-/* the specific language governing permissions and limitations under the */
-/* License. */
-/******************************************************************************/
-
-//----------------------
+//----------------------
//
// Generated using the NSwag toolchain v13.0.5.0 (NJsonSchema v10.0.22.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
//
@@ -26,41 +13,40 @@
namespace Keyfactor
{
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.0.5.0 (NJsonSchema v10.0.22.0 (Newtonsoft.Json v11.0.0.0))")]
- public partial class Client
+ public partial class Client
{
private string _baseUrl;
private System.Net.Http.HttpClient _httpClient;
private System.Lazy _settings;
private string x_keyfactor_requested_with = "APIClient";
private string x_keyfactor_api_version = "1";
-
- public Client(string baseURL, string BasicAuthToken, System.Net.Http.HttpClient? httpClient = null)
+
+ public Client(string baseURL, string BasicAuthToken, System.Net.Http.HttpClient? httpClient=null)
{
_baseUrl = baseURL;
_httpClient = httpClient ?? new System.Net.Http.HttpClient();
- _httpClient.DefaultRequestHeaders.Add("Authorization", $"Basic {BasicAuthToken}");
- _settings = new System.Lazy(() =>
+ _httpClient.DefaultRequestHeaders.Add("Authorization", $"Basic {BasicAuthToken}");
+ _settings = new System.Lazy(() =>
{
var settings = new Newtonsoft.Json.JsonSerializerSettings();
- settings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
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);
-
+
/// Returns details for a single agent, specified by ID
/// Agent Id to Search
/// Desired version of the api, if not provided defaults to v1
@@ -71,7 +57,7 @@ public System.Threading.Tasks.Task GetAgentDetailAsync(System.Gui
{
return GetAgentDetailAsync(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns details for a single agent, specified by ID
/// Agent Id to Search
@@ -83,29 +69,29 @@ public async System.Threading.Tasks.Task GetAgentDetailAsync(Syst
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Agents/{id}");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -115,11 +101,11 @@ public async System.Threading.Tasks.Task GetAgentDetailAsync(Syst
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -127,10 +113,10 @@ public async System.Threading.Tasks.Task GetAgentDetailAsync(Syst
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(AgentResponse);
}
finally
@@ -144,7 +130,7 @@ public async System.Threading.Tasks.Task GetAgentDetailAsync(Syst
{
}
}
-
+
/// Returns all agents according to the provided filter and output parameters
/// Desired version of the api, if not provided defaults to v1
/// Contents of the query (ex: field1 -eq value1 AND field2 -gt value2)
@@ -157,9 +143,9 @@ public async System.Threading.Tasks.Task GetAgentDetailAsync(Syst
/// A server side error occurred.
public System.Threading.Tasks.Task> GetAgentsAsync(string pq_queryString, int? pq_pageReturned, int? pq_returnLimit, string pq_sortField, SortAscending? pq_sortAscending)
{
- return GetAgentsAsync(pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
+ return GetAgentsAsync( pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns all agents according to the provided filter and output parameters
/// Desired version of the api, if not provided defaults to v1
@@ -175,46 +161,46 @@ public async System.Threading.Tasks.Task GetAgentDetailAsync(Syst
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Agents?");
- if (pq_queryString != null)
+ if (pq_queryString != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_pageReturned != null)
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -224,11 +210,11 @@ public async System.Threading.Tasks.Task GetAgentDetailAsync(Syst
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -236,10 +222,10 @@ public async System.Threading.Tasks.Task GetAgentDetailAsync(Syst
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -253,7 +239,7 @@ public async System.Threading.Tasks.Task GetAgentDetailAsync(Syst
{
}
}
-
+
/// Reset a list of agents
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -262,9 +248,9 @@ public async System.Threading.Tasks.Task GetAgentDetailAsync(Syst
/// A server side error occurred.
public System.Threading.Tasks.Task Reset0Async(System.Collections.Generic.IEnumerable body)
{
- return Reset0Async(body, System.Threading.CancellationToken.None);
+ return Reset0Async( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Reset a list of agents
/// Desired version of the api, if not provided defaults to v1
@@ -276,27 +262,27 @@ public async System.Threading.Tasks.Task Reset0Async(System.Collections.Generic.
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Agents/Reset");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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");
-
+
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);
try
{
@@ -306,18 +292,18 @@ public async System.Threading.Tasks.Task Reset0Async(System.Collections.Generic.
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -332,7 +318,7 @@ public async System.Threading.Tasks.Task Reset0Async(System.Collections.Generic.
{
}
}
-
+
/// Approve a list of agents
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -341,9 +327,9 @@ public async System.Threading.Tasks.Task Reset0Async(System.Collections.Generic.
/// A server side error occurred.
public System.Threading.Tasks.Task ApproveAsync(System.Collections.Generic.IEnumerable body)
{
- return ApproveAsync(body, System.Threading.CancellationToken.None);
+ return ApproveAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Approve a list of agents
/// Desired version of the api, if not provided defaults to v1
@@ -355,27 +341,27 @@ public async System.Threading.Tasks.Task ApproveAsync(System.Collections.Generic
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Agents/Approve");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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");
-
+
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);
try
{
@@ -385,18 +371,18 @@ public async System.Threading.Tasks.Task ApproveAsync(System.Collections.Generic
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -411,7 +397,7 @@ public async System.Threading.Tasks.Task ApproveAsync(System.Collections.Generic
{
}
}
-
+
/// Disapprove a list of agents
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -420,9 +406,9 @@ public async System.Threading.Tasks.Task ApproveAsync(System.Collections.Generic
/// A server side error occurred.
public System.Threading.Tasks.Task DisapproveAsync(System.Collections.Generic.IEnumerable body)
{
- return DisapproveAsync(body, System.Threading.CancellationToken.None);
+ return DisapproveAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Disapprove a list of agents
/// Desired version of the api, if not provided defaults to v1
@@ -434,27 +420,27 @@ public async System.Threading.Tasks.Task DisapproveAsync(System.Collections.Gene
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Agents/Disapprove");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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");
-
+
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);
try
{
@@ -464,18 +450,18 @@ public async System.Threading.Tasks.Task DisapproveAsync(System.Collections.Gene
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -490,7 +476,7 @@ public async System.Threading.Tasks.Task DisapproveAsync(System.Collections.Gene
{
}
}
-
+
/// Reset an agent to a new state
/// Guid Id of Agent to reset
/// Desired version of the api, if not provided defaults to v1
@@ -501,7 +487,7 @@ public System.Threading.Tasks.Task Reset1Async(System.Guid id)
{
return Reset1Async(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Reset an agent to a new state
/// Guid Id of Agent to reset
@@ -513,29 +499,29 @@ public async System.Threading.Tasks.Task Reset1Async(System.Guid id, System.Thre
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Agents/{id}/Reset");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json");
request_.Method = new System.Net.Http.HttpMethod("POST");
-
+
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);
try
{
@@ -545,18 +531,18 @@ public async System.Threading.Tasks.Task Reset1Async(System.Guid id, System.Thre
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -571,7 +557,7 @@ public async System.Threading.Tasks.Task Reset1Async(System.Guid id, System.Thre
{
}
}
-
+
/// Schedules a job on the agent to retrieve log files
/// Guid Id of the agent to schedule the job for.
/// Desired version of the api, if not provided defaults to v1
@@ -582,7 +568,7 @@ public System.Threading.Tasks.Task FetchLogsAsync(System.Guid id)
{
return FetchLogsAsync(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Schedules a job on the agent to retrieve log files
/// Guid Id of the agent to schedule the job for.
@@ -594,29 +580,29 @@ public async System.Threading.Tasks.Task FetchLogsAsync(System.Guid id, System.T
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Agents/{id}/FetchLogs");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json");
request_.Method = new System.Net.Http.HttpMethod("POST");
-
+
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);
try
{
@@ -626,18 +612,18 @@ public async System.Threading.Tasks.Task FetchLogsAsync(System.Guid id, System.T
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -652,7 +638,7 @@ public async System.Threading.Tasks.Task FetchLogsAsync(System.Guid id, System.T
{
}
}
-
+
/// Update the AuthCertificateReenrollment value for an agent to request or require (or unset the request) the agent
/// to enroll for a new client authentication certificate on its next registration.
/// Desired version of the api, if not provided defaults to v1
@@ -662,9 +648,9 @@ public async System.Threading.Tasks.Task FetchLogsAsync(System.Guid id, System.T
/// A server side error occurred.
public System.Threading.Tasks.Task SetAuthCertificateReenrollmentAsync(UpdateOrchestratorAuthCertificateReenrollmentRequest body)
{
- return SetAuthCertificateReenrollmentAsync(body, System.Threading.CancellationToken.None);
+ return SetAuthCertificateReenrollmentAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Update the AuthCertificateReenrollment value for an agent to request or require (or unset the request) the agent
/// to enroll for a new client authentication certificate on its next registration.
@@ -677,28 +663,28 @@ public async System.Threading.Tasks.Task(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -720,10 +706,10 @@ public async System.Threading.Tasks.Task
- {
- public ObjectResponseResult(T responseObject, string responseText)
- {
- this.Object = responseObject;
- this.Text = responseText;
- }
-
- public T Object { get; }
-
- public string Text { get; }
- }
-
- public bool ReadResponseAsString { get; set; }
-
- protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers)
- {
- if (response == null || response.Content == null)
- {
- return new ObjectResponseResult(default(T), string.Empty);
- }
-
- if (ReadResponseAsString)
- {
- var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings);
- return new ObjectResponseResult(typedBody, responseText);
- }
- catch (Newtonsoft.Json.JsonException exception)
- {
- var message = "Could not deserialize the response body string as " + typeof(T).FullName + ".";
- throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception);
- }
- }
- else
- {
- try
- {
- using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
- using (var streamReader = new System.IO.StreamReader(responseStream))
- using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader))
- {
- var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings);
- var typedBody = serializer.Deserialize(jsonTextReader);
- return new ObjectResponseResult(typedBody, string.Empty);
- }
- }
- catch (Newtonsoft.Json.JsonException exception)
- {
- var message = "Could not deserialize the response body stream as " + typeof(T).FullName + ".";
- throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception);
- }
- }
- }
-
- private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo)
- {
- if (value is System.Enum)
- {
- string name = System.Enum.GetName(value.GetType(), value);
- if (name != null)
- {
- var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
- if (field != null)
- {
- var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute))
- as System.Runtime.Serialization.EnumMemberAttribute;
- if (attribute != null)
- {
- return attribute.Value != null ? attribute.Value : name;
- }
- }
- }
- }
- else if (value is bool)
- {
- return System.Convert.ToString(value, cultureInfo).ToLowerInvariant();
- }
- else if (value is byte[])
- {
- return System.Convert.ToBase64String((byte[])value);
- }
- else if (value != null && value.GetType().IsArray)
- {
- var array = System.Linq.Enumerable.OfType((System.Array)value);
- return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo)));
- }
-
- return System.Convert.ToString(value, cultureInfo);
- }
-
-
+
+ protected struct ObjectResponseResult
+ {
+ public ObjectResponseResult(T responseObject, string responseText)
+ {
+ this.Object = responseObject;
+ this.Text = responseText;
+ }
+
+ public T Object { get; }
+
+ public string Text { get; }
+ }
+
+ public bool ReadResponseAsString { get; set; }
+
+ protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers)
+ {
+ if (response == null || response.Content == null)
+ {
+ return new ObjectResponseResult(default(T), string.Empty);
+ }
+
+ if (ReadResponseAsString)
+ {
+ var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings);
+ return new ObjectResponseResult(typedBody, responseText);
+ }
+ catch (Newtonsoft.Json.JsonException exception)
+ {
+ var message = "Could not deserialize the response body string as " + typeof(T).FullName + ".";
+ throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception);
+ }
+ }
+ else
+ {
+ try
+ {
+ using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
+ using (var streamReader = new System.IO.StreamReader(responseStream))
+ using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader))
+ {
+ var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings);
+ var typedBody = serializer.Deserialize(jsonTextReader);
+ return new ObjectResponseResult(typedBody, string.Empty);
+ }
+ }
+ catch (Newtonsoft.Json.JsonException exception)
+ {
+ var message = "Could not deserialize the response body stream as " + typeof(T).FullName + ".";
+ throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception);
+ }
+ }
+ }
+
+ private string ConvertToString( object value, System.Globalization.CultureInfo cultureInfo)
+ {
+ if (value is System.Enum)
+ {
+ string name = System.Enum.GetName(value.GetType(), value);
+ if (name != null)
+ {
+ var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
+ if (field != null)
+ {
+ var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute))
+ as System.Runtime.Serialization.EnumMemberAttribute;
+ if (attribute != null)
+ {
+ return attribute.Value != null ? attribute.Value : name;
+ }
+ }
+ }
+ }
+ else if (value is bool) {
+ return System.Convert.ToString(value, cultureInfo).ToLowerInvariant();
+ }
+ else if (value is byte[])
+ {
+ return System.Convert.ToBase64String((byte[]) value);
+ }
+ else if (value != null && value.GetType().IsArray)
+ {
+ var array = System.Linq.Enumerable.OfType((System.Array) value);
+ return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString( o, cultureInfo)));
+ }
+
+ return System.Convert.ToString(value, cultureInfo);
+ }
+
+
/// Returns an agent blueprint according to the provided filter and output parameters
/// Returns a single agent blueprint associated with the provided id
/// Desired version of the api, if not provided defaults to v1
@@ -842,7 +827,7 @@ public System.Threading.Tasks.Task GetAgentBlueprintAsyn
{
return GetAgentBlueprintAsync(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns an agent blueprint according to the provided filter and output parameters
/// Returns a single agent blueprint associated with the provided id
@@ -854,29 +839,29 @@ public async System.Threading.Tasks.Task GetAgentBluepri
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentBluePrint/{id}");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -886,11 +871,11 @@ public async System.Threading.Tasks.Task GetAgentBluepri
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -898,10 +883,10 @@ public async System.Threading.Tasks.Task GetAgentBluepri
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(AgentBlueprintResponse);
}
finally
@@ -915,7 +900,7 @@ public async System.Threading.Tasks.Task GetAgentBluepri
{
}
}
-
+
/// Deletes an agent blueprint by its Keyfactor identifier
/// Keyfactor agent blueprint identifier (GUID)
/// Desired version of the api, if not provided defaults to v1
@@ -926,7 +911,7 @@ public System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id)
{
return DeleteBlueprintAsync(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Deletes an agent blueprint by its Keyfactor identifier
/// Keyfactor agent blueprint identifier (GUID)
@@ -938,28 +923,28 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentBluePrint/{id}");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("DELETE");
-
+
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);
try
{
@@ -969,18 +954,18 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -995,7 +980,7 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
{
}
}
-
+
/// Returns all agent blueprints according to the provided filter and output parameters
/// Desired version of the api, if not provided defaults to v1
/// The current page within the result set to be returned
@@ -1007,9 +992,9 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
/// A server side error occurred.
public System.Threading.Tasks.Task> GetAgentBlueprintsAsync(int? pq_pageReturned, int? pq_returnLimit, string pq_sortField, SortAscending2? pq_sortAscending)
{
- return GetAgentBlueprintsAsync(pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
+ return GetAgentBlueprintsAsync( pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns all agent blueprints according to the provided filter and output parameters
/// Desired version of the api, if not provided defaults to v1
@@ -1024,42 +1009,42 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentBluePrint?");
- if (pq_pageReturned != null)
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -1069,11 +1054,11 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -1081,10 +1066,10 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -1098,7 +1083,7 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
{
}
}
-
+
/// Gets the agent blueprint scheduled jobs
/// Desired version of the api, if not provided defaults to v1
/// The current page within the result set to be returned
@@ -1112,7 +1097,7 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
{
return GetBlueprintJobsAsync(id, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Gets the agent blueprint scheduled jobs
/// Desired version of the api, if not provided defaults to v1
@@ -1127,46 +1112,46 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentBluePrint/{id}/Jobs?");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
- if (pq_pageReturned != null)
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -1176,11 +1161,11 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -1188,10 +1173,10 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -1205,7 +1190,7 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
{
}
}
-
+
/// Gets the agent blueprint certificate stores
/// Desired version of the api, if not provided defaults to v1
/// The current page within the result set to be returned
@@ -1219,7 +1204,7 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
{
return GetBlueprintStoresAsync(id, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Gets the agent blueprint certificate stores
/// Desired version of the api, if not provided defaults to v1
@@ -1234,46 +1219,46 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentBluePrint/{id}/Stores?");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
- if (pq_pageReturned != null)
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -1283,11 +1268,11 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -1295,10 +1280,10 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -1312,7 +1297,7 @@ public async System.Threading.Tasks.Task DeleteBlueprintAsync(System.Guid id, Sy
{
}
}
-
+
/// Applies the selected agent blueprint to the provided agents
/// Agent blueprint to apply to the agents
/// Desired version of the api, if not provided defaults to v1
@@ -1324,7 +1309,7 @@ public System.Threading.Tasks.Task ApplyBlueprintAsync(System.Guid templateId, S
{
return ApplyBlueprintAsync(templateId, body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Applies the selected agent blueprint to the provided agents
/// Agent blueprint to apply to the agents
@@ -1337,32 +1322,32 @@ public async System.Threading.Tasks.Task ApplyBlueprintAsync(System.Guid templat
{
if (templateId == null)
throw new System.ArgumentNullException("templateId");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentBluePrint/ApplyBlueprint?");
- urlBuilder_.Append(System.Uri.EscapeDataString("templateId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(templateId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("templateId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( templateId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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");
-
+
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);
try
{
@@ -1372,18 +1357,18 @@ public async System.Threading.Tasks.Task ApplyBlueprintAsync(System.Guid templat
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -1398,7 +1383,7 @@ public async System.Threading.Tasks.Task ApplyBlueprintAsync(System.Guid templat
{
}
}
-
+
/// Generates an agent blueprint from the provided agents
/// Agent to generate a blueprint from
/// Name of the new agent blueprint
@@ -1410,7 +1395,7 @@ public System.Threading.Tasks.Task GenerateBlueprintAsyn
{
return GenerateBlueprintAsync(agentId, name, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Generates an agent blueprint from the provided agents
/// Agent to generate a blueprint from
@@ -1423,35 +1408,35 @@ public async System.Threading.Tasks.Task GenerateBluepri
{
if (agentId == null)
throw new System.ArgumentNullException("agentId");
-
+
if (name == null)
throw new System.ArgumentNullException("name");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentBluePrint/GenerateBluePrint?");
- urlBuilder_.Append(System.Uri.EscapeDataString("agentId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(agentId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
- urlBuilder_.Append(System.Uri.EscapeDataString("name") + "=").Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("agentId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( agentId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("name") + "=").Append(System.Uri.EscapeDataString(ConvertToString( name, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json");
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -1461,11 +1446,11 @@ public async System.Threading.Tasks.Task GenerateBluepri
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -1473,10 +1458,10 @@ public async System.Threading.Tasks.Task GenerateBluepri
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(AgentBlueprintResponse);
}
finally
@@ -1490,14 +1475,14 @@ public async System.Threading.Tasks.Task GenerateBluepri
{
}
}
+
+
+
+
+
+
-
-
-
-
-
-
-
+
/// Returns a single agent pool associated with the provided id
/// Keyfactor (GUID) identifier of the agent pool
/// Desired version of the api, if not provided defaults to v1
@@ -1508,7 +1493,7 @@ public System.Threading.Tasks.Task GetAgentPoolByIdAsync(System.Guid
{
return GetAgentPoolByIdAsync(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns a single agent pool associated with the provided id
/// Keyfactor (GUID) identifier of the agent pool
@@ -1520,29 +1505,29 @@ public async System.Threading.Tasks.Task GetAgentPoolByIdAsync(System
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentPools/{id}");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -1552,11 +1537,11 @@ public async System.Threading.Tasks.Task GetAgentPoolByIdAsync(System
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -1564,10 +1549,10 @@ public async System.Threading.Tasks.Task GetAgentPoolByIdAsync(System
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(AgentPool);
}
finally
@@ -1581,7 +1566,7 @@ public async System.Threading.Tasks.Task GetAgentPoolByIdAsync(System
{
}
}
-
+
/// Deletes the agent pool associated with the provided id
/// Keyfactor identifier (GUID) of the agent pool
/// Desired version of the api, if not provided defaults to v1
@@ -1592,7 +1577,7 @@ public System.Threading.Tasks.Task DeleteAgentPoolAsync(System.Guid id)
{
return DeleteAgentPoolAsync(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Deletes the agent pool associated with the provided id
/// Keyfactor identifier (GUID) of the agent pool
@@ -1604,28 +1589,28 @@ public async System.Threading.Tasks.Task DeleteAgentPoolAsync(System.Guid id, Sy
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentPools/{id}");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("DELETE");
-
+
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);
try
{
@@ -1635,18 +1620,18 @@ public async System.Threading.Tasks.Task DeleteAgentPoolAsync(System.Guid id, Sy
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -1661,7 +1646,7 @@ public async System.Threading.Tasks.Task DeleteAgentPoolAsync(System.Guid id, Sy
{
}
}
-
+
/// Returns all agent pools according to the provided filter and output parameters
/// Desired version of the api, if not provided defaults to v1
/// Contents of the query (ex: field1 -eq value1 AND field2 -gt value2)
@@ -1674,9 +1659,9 @@ public async System.Threading.Tasks.Task DeleteAgentPoolAsync(System.Guid id, Sy
/// A server side error occurred.
public System.Threading.Tasks.Task> GetAgentPoolsAsync(string pq_queryString, int? pq_pageReturned, int? pq_returnLimit, string pq_sortField, SortAscending5? pq_sortAscending)
{
- return GetAgentPoolsAsync(pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
+ return GetAgentPoolsAsync( pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns all agent pools according to the provided filter and output parameters
/// Desired version of the api, if not provided defaults to v1
@@ -1692,46 +1677,46 @@ public async System.Threading.Tasks.Task DeleteAgentPoolAsync(System.Guid id, Sy
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentPools?");
- if (pq_queryString != null)
+ if (pq_queryString != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_pageReturned != null)
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -1741,11 +1726,11 @@ public async System.Threading.Tasks.Task DeleteAgentPoolAsync(System.Guid id, Sy
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -1753,10 +1738,10 @@ public async System.Threading.Tasks.Task DeleteAgentPoolAsync(System.Guid id, Sy
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -1770,7 +1755,7 @@ public async System.Threading.Tasks.Task DeleteAgentPoolAsync(System.Guid id, Sy
{
}
}
-
+
/// Updates an existing agent pool with the provided properties
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -1779,9 +1764,9 @@ public async System.Threading.Tasks.Task DeleteAgentPoolAsync(System.Guid id, Sy
/// A server side error occurred.
public System.Threading.Tasks.Task UpdateAgentPoolAsync(AgentPool body)
{
- return UpdateAgentPoolAsync(body, System.Threading.CancellationToken.None);
+ return UpdateAgentPoolAsync( 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 agent pool with the provided properties
/// Desired version of the api, if not provided defaults to v1
@@ -1793,28 +1778,28 @@ public async System.Threading.Tasks.Task UpdateAgentPoolAsync(AgentPo
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentPools");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -1824,11 +1809,11 @@ public async System.Threading.Tasks.Task UpdateAgentPoolAsync(AgentPo
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -1836,10 +1821,10 @@ public async System.Threading.Tasks.Task UpdateAgentPoolAsync(AgentPo
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(AgentPool);
}
finally
@@ -1853,7 +1838,7 @@ public async System.Threading.Tasks.Task UpdateAgentPoolAsync(AgentPo
{
}
}
-
+
/// Creates an agent pool with the provided properties
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -1862,9 +1847,9 @@ public async System.Threading.Tasks.Task UpdateAgentPoolAsync(AgentPo
/// A server side error occurred.
public System.Threading.Tasks.Task CreateAgentPoolAsync(AgentPool body)
{
- return CreateAgentPoolAsync(body, System.Threading.CancellationToken.None);
+ return CreateAgentPoolAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Creates an agent pool with the provided properties
/// Desired version of the api, if not provided defaults to v1
@@ -1876,28 +1861,28 @@ public async System.Threading.Tasks.Task CreateAgentPoolAsync(AgentPo
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentPools");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -1907,11 +1892,11 @@ public async System.Threading.Tasks.Task CreateAgentPoolAsync(AgentPo
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -1919,10 +1904,10 @@ public async System.Threading.Tasks.Task CreateAgentPoolAsync(AgentPo
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(AgentPool);
}
finally
@@ -1936,7 +1921,7 @@ public async System.Threading.Tasks.Task CreateAgentPoolAsync(AgentPo
{
}
}
-
+
/// Returns all agents for the default agent pool
/// Desired version of the api, if not provided defaults to v1
/// Contents of the query (ex: field1 -eq value1 AND field2 -gt value2)
@@ -1949,9 +1934,9 @@ public async System.Threading.Tasks.Task CreateAgentPoolAsync(AgentPo
/// A server side error occurred.
public System.Threading.Tasks.Task> GetDefaultAgentPoolAgentsAsync(string pq_queryString, int? pq_pageReturned, int? pq_returnLimit, string pq_sortField, SortAscending6? pq_sortAscending)
{
- return GetDefaultAgentPoolAgentsAsync(pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
+ return GetDefaultAgentPoolAgentsAsync( pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns all agents for the default agent pool
/// Desired version of the api, if not provided defaults to v1
@@ -1967,46 +1952,46 @@ public async System.Threading.Tasks.Task CreateAgentPoolAsync(AgentPo
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/AgentPools/Agents?");
- if (pq_queryString != null)
+ if (pq_queryString != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_pageReturned != null)
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2016,11 +2001,11 @@ public async System.Threading.Tasks.Task CreateAgentPoolAsync(AgentPo
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -2028,10 +2013,10 @@ public async System.Threading.Tasks.Task CreateAgentPoolAsync(AgentPo
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -2045,14 +2030,14 @@ public async System.Threading.Tasks.Task CreateAgentPoolAsync(AgentPo
{
}
}
+
+
+
+
+
+
-
-
-
-
-
-
-
+
/// Returns the audit log entry associated with the provided identifier
/// Keyfactor identifer of the audit entry to be returned
/// Desired version of the api, if not provided defaults to v1
@@ -2063,7 +2048,7 @@ public System.Threading.Tasks.Task GetAuditLogAsync(int id)
{
return GetAuditLogAsync(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns the audit log entry associated with the provided identifier
/// Keyfactor identifer of the audit entry to be returned
@@ -2075,29 +2060,29 @@ public async System.Threading.Tasks.Task GetAuditLogAsync(int id, System
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Audit/{id}");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2107,11 +2092,11 @@ public async System.Threading.Tasks.Task GetAuditLogAsync(int id, System
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -2119,10 +2104,10 @@ public async System.Threading.Tasks.Task GetAuditLogAsync(int id, System
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(object);
}
finally
@@ -2136,7 +2121,7 @@ public async System.Threading.Tasks.Task GetAuditLogAsync(int id, System
{
}
}
-
+
/// Validates the audit log entry associated with the provided keyfactor id
/// Keyfactor identifier of the audit log entry
/// Desired version of the api, if not provided defaults to v1
@@ -2147,7 +2132,7 @@ public System.Threading.Tasks.Task ValidateAuditLogAsync(int id)
{
return ValidateAuditLogAsync(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Validates the audit log entry associated with the provided keyfactor id
/// Keyfactor identifier of the audit log entry
@@ -2159,29 +2144,29 @@ public async System.Threading.Tasks.Task ValidateAuditLogAsync(int id, Sys
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Audit/{id}/Validate");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2191,11 +2176,11 @@ public async System.Threading.Tasks.Task ValidateAuditLogAsync(int id, Sys
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -2203,10 +2188,10 @@ public async System.Threading.Tasks.Task ValidateAuditLogAsync(int id, Sys
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(bool);
}
finally
@@ -2220,7 +2205,7 @@ public async System.Threading.Tasks.Task ValidateAuditLogAsync(int id, Sys
{
}
}
-
+
/// Returns all audit log entries according to the provided filter and output parameters
/// Desired version of the api, if not provided defaults to v1
/// Contents of the query (ex: field1 -eq value1 AND field2 -gt value2)
@@ -2233,9 +2218,9 @@ public async System.Threading.Tasks.Task ValidateAuditLogAsync(int id, Sys
/// A server side error occurred.
public System.Threading.Tasks.Task> GetAuditLogsAsync(string pq_queryString, int? pq_pageReturned, int? pq_returnLimit, string pq_sortField, SortAscending7? pq_sortAscending)
{
- return GetAuditLogsAsync(pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
+ return GetAuditLogsAsync( pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns all audit log entries according to the provided filter and output parameters
/// Desired version of the api, if not provided defaults to v1
@@ -2251,46 +2236,46 @@ public async System.Threading.Tasks.Task ValidateAuditLogAsync(int id, Sys
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Audit?");
- if (pq_queryString != null)
+ if (pq_queryString != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_pageReturned != null)
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2300,11 +2285,11 @@ public async System.Threading.Tasks.Task ValidateAuditLogAsync(int id, Sys
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -2312,10 +2297,10 @@ public async System.Threading.Tasks.Task ValidateAuditLogAsync(int id, Sys
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -2329,7 +2314,7 @@ public async System.Threading.Tasks.Task ValidateAuditLogAsync(int id, Sys
{
}
}
-
+
/// Returns a Comma Separated file containing the audit log entries according to the provided filter
/// Desired version of the api, if not provided defaults to v1
/// Contents of the query (ex: field1 -eq value1 AND field2 -gt value2)
@@ -2342,9 +2327,9 @@ public async System.Threading.Tasks.Task ValidateAuditLogAsync(int id, Sys
/// A server side error occurred.
public System.Threading.Tasks.Task DownloadCSVAsync(string pq_queryString, int? pq_pageReturned, int? pq_returnLimit, string pq_sortField, SortAscending8? pq_sortAscending)
{
- return DownloadCSVAsync(pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
+ return DownloadCSVAsync( pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns a Comma Separated file containing the audit log entries according to the provided filter
/// Desired version of the api, if not provided defaults to v1
@@ -2360,46 +2345,46 @@ public async System.Threading.Tasks.Task DownloadCSVAsync(string pq_quer
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Audit/Download?");
- if (pq_queryString != null)
+ if (pq_queryString != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_pageReturned != null)
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2409,11 +2394,11 @@ public async System.Threading.Tasks.Task DownloadCSVAsync(string pq_quer
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -2421,10 +2406,10 @@ public async System.Threading.Tasks.Task DownloadCSVAsync(string pq_quer
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(string);
}
finally
@@ -2438,7 +2423,7 @@ public async System.Threading.Tasks.Task DownloadCSVAsync(string pq_quer
{
}
}
-
+
/// Returns the audit log entry associated with the provided keyfactor id
/// Desired version of the api, if not provided defaults to v1
/// Contents of the query (ex: field1 -eq value1 AND field2 -gt value2)
@@ -2451,9 +2436,9 @@ public async System.Threading.Tasks.Task DownloadCSVAsync(string pq_quer
/// A server side error occurred.
public System.Threading.Tasks.Task> GetRelatedEntitiesAsync(string pq_queryString, int? pq_pageReturned, int? pq_returnLimit, string pq_sortField, SortAscending9? pq_sortAscending)
{
- return GetRelatedEntitiesAsync(pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
+ return GetRelatedEntitiesAsync( pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns the audit log entry associated with the provided keyfactor id
/// Desired version of the api, if not provided defaults to v1
@@ -2469,46 +2454,46 @@ public async System.Threading.Tasks.Task DownloadCSVAsync(string pq_quer
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Audit/RelatedEntities?");
- if (pq_queryString != null)
+ if (pq_queryString != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_pageReturned != null)
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2518,11 +2503,11 @@ public async System.Threading.Tasks.Task DownloadCSVAsync(string pq_quer
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -2530,10 +2515,10 @@ public async System.Threading.Tasks.Task DownloadCSVAsync(string pq_quer
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -2547,14 +2532,14 @@ public async System.Threading.Tasks.Task DownloadCSVAsync(string pq_quer
{
}
}
+
+
+
+
+
+
-
-
-
-
-
-
-
+
/// Gets the list of Security Identities and which permissions they have on the given certificate.
/// The Id of the certificate permissions are being checked on
/// The Id of the collection the certificate belongs in. Defaults to no collection
@@ -2566,7 +2551,7 @@ public System.Threading.Tasks.Task GetCertificateSecurit
{
return GetCertificateSecurityAsync(id, collectionId, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Gets the list of Security Identities and which permissions they have on the given certificate.
/// The Id of the certificate permissions are being checked on
@@ -2579,34 +2564,34 @@ public async System.Threading.Tasks.Task GetCertificateS
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/{id}/Security?");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
- if (collectionId != null)
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2616,11 +2601,11 @@ public async System.Threading.Tasks.Task GetCertificateS
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -2628,10 +2613,10 @@ public async System.Threading.Tasks.Task GetCertificateS
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificatePermissions);
}
finally
@@ -2645,7 +2630,7 @@ public async System.Threading.Tasks.Task GetCertificateS
{
}
}
-
+
/// Validates the certificate chain can be built.
/// The Id of the certificate being checked
/// An optional parameter for the collectin Id the certificate is in. Defaults to no collection
@@ -2657,7 +2642,7 @@ public System.Threading.Tasks.Task ValidateCertif
{
return ValidateCertificateAsync(id, collectionId, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Validates the certificate chain can be built.
/// The Id of the certificate being checked
@@ -2670,34 +2655,34 @@ public async System.Threading.Tasks.Task Validate
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/{id}/Validate?");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
- if (collectionId != null)
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2707,11 +2692,11 @@ public async System.Threading.Tasks.Task Validate
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -2719,10 +2704,10 @@ public async System.Threading.Tasks.Task Validate
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificateValidationResponse);
}
finally
@@ -2736,7 +2721,7 @@ public async System.Threading.Tasks.Task Validate
{
}
}
-
+
/// Returns a list of locations the certificate is in
/// Keyfactor certificate identifier
/// Optional certificate collection identifier used to ensure user access to the certificate
@@ -2748,7 +2733,7 @@ public System.Threading.Tasks.Task GetCertificateL
{
return GetCertificateLocationsAsync(id, collectionId, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns a list of locations the certificate is in
/// Keyfactor certificate identifier
@@ -2761,34 +2746,34 @@ public async System.Threading.Tasks.Task GetCertif
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/Locations/{id}?");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
- if (collectionId != null)
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2798,11 +2783,11 @@ public async System.Threading.Tasks.Task GetCertif
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -2810,10 +2795,10 @@ public async System.Threading.Tasks.Task GetCertif
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificateLocationsResponse);
}
finally
@@ -2827,7 +2812,7 @@ public async System.Threading.Tasks.Task GetCertif
{
}
}
-
+
/// Audit identity permissions for certificate
/// The Id of the certificate being checked
/// An optional parameter for the collectin Id the certificate is in. Defaults to no collection
@@ -2839,7 +2824,7 @@ public async System.Threading.Tasks.Task GetCertif
{
return IdentityAuditAsync(id, collectionId, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Audit identity permissions for certificate
/// The Id of the certificate being checked
@@ -2852,34 +2837,34 @@ public async System.Threading.Tasks.Task GetCertif
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/IdentityAudit/{id}?");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
- if (collectionId != null)
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2889,11 +2874,11 @@ public async System.Threading.Tasks.Task GetCertif
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -2901,10 +2886,10 @@ public async System.Threading.Tasks.Task GetCertif
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -2918,7 +2903,7 @@ public async System.Threading.Tasks.Task GetCertif
{
}
}
-
+
/// Returns a single certificate that matches the id
/// Keyfactor certificate identifier
/// Include locations data for the certificate to be returned
@@ -2932,7 +2917,7 @@ public System.Threading.Tasks.Task GetCertificateA
{
return GetCertificateAsync(id, includeLocations, includeMetadata, collectionId, verbose, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns a single certificate that matches the id
/// Keyfactor certificate identifier
@@ -2947,46 +2932,46 @@ public async System.Threading.Tasks.Task GetCertif
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/{id}?");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
- if (includeLocations != null)
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (includeLocations != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("includeLocations") + "=").Append(System.Uri.EscapeDataString(ConvertToString(includeLocations, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("includeLocations") + "=").Append(System.Uri.EscapeDataString(ConvertToString( includeLocations, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (includeMetadata != null)
+ if (includeMetadata != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("includeMetadata") + "=").Append(System.Uri.EscapeDataString(ConvertToString(includeMetadata, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("includeMetadata") + "=").Append(System.Uri.EscapeDataString(ConvertToString( includeMetadata, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (collectionId != null)
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (verbose != null)
+ if (verbose != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("verbose") + "=").Append(System.Uri.EscapeDataString(ConvertToString(verbose, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("verbose") + "=").Append(System.Uri.EscapeDataString(ConvertToString( verbose, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -2996,11 +2981,11 @@ public async System.Threading.Tasks.Task GetCertif
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -3008,10 +2993,10 @@ public async System.Threading.Tasks.Task GetCertif
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificateRetrievalResponse);
}
finally
@@ -3025,7 +3010,7 @@ public async System.Threading.Tasks.Task GetCertif
{
}
}
-
+
/// Deletes a persisted certificate by its unique id as well as the stored private key (if present) associated with it
/// Keyfactor identifier of the certificate record
/// Optional certificate collection identifier used to ensure user access to the certificate
@@ -3037,7 +3022,7 @@ public System.Threading.Tasks.Task DeleteCertificateAsync(int id, int? collectio
{
return DeleteCertificateAsync(id, collectionId, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Deletes a persisted certificate by its unique id as well as the stored private key (if present) associated with it
/// Keyfactor identifier of the certificate record
@@ -3050,33 +3035,33 @@ public async System.Threading.Tasks.Task DeleteCertificateAsync(int id, int? col
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/{id}?");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
- if (collectionId != null)
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("DELETE");
-
+
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);
try
{
@@ -3086,18 +3071,18 @@ public async System.Threading.Tasks.Task DeleteCertificateAsync(int id, int? col
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -3112,7 +3097,7 @@ public async System.Threading.Tasks.Task DeleteCertificateAsync(int id, int? col
{
}
}
-
+
/// Compares the metadata value provided with the metadata value associated with the specified certificate
/// Certificate identifier
/// Metadata field being compared
@@ -3126,7 +3111,7 @@ public System.Threading.Tasks.Task CompareMetadataAsync(int certificateId,
{
return CompareMetadataAsync(certificateId, metadataFieldName, value, collectionId, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Compares the metadata value provided with the metadata value associated with the specified certificate
/// Certificate identifier
@@ -3141,42 +3126,42 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
{
if (certificateId == null)
throw new System.ArgumentNullException("certificateId");
-
+
if (metadataFieldName == null)
throw new System.ArgumentNullException("metadataFieldName");
-
+
if (value == null)
throw new System.ArgumentNullException("value");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/Metadata/Compare?");
- urlBuilder_.Append(System.Uri.EscapeDataString("certificateId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(certificateId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
- urlBuilder_.Append(System.Uri.EscapeDataString("metadataFieldName") + "=").Append(System.Uri.EscapeDataString(ConvertToString(metadataFieldName, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
- urlBuilder_.Append(System.Uri.EscapeDataString("value") + "=").Append(System.Uri.EscapeDataString(ConvertToString(value, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
- if (collectionId != null)
+ urlBuilder_.Append(System.Uri.EscapeDataString("certificateId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( certificateId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("metadataFieldName") + "=").Append(System.Uri.EscapeDataString(ConvertToString( metadataFieldName, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("value") + "=").Append(System.Uri.EscapeDataString(ConvertToString( value, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -3186,11 +3171,11 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -3198,10 +3183,10 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(bool);
}
finally
@@ -3215,7 +3200,7 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
{
}
}
-
+
/// Gets the history of operations on a certificate
/// The Id of the certificate
/// The collection the certificate could be in. Defaults to no collection.
@@ -3231,7 +3216,7 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
{
return CertificateHistoryAsync(id, collectionId, query_pageReturned, query_returnLimit, query_sortField, query_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Gets the history of operations on a certificate
/// The Id of the certificate
@@ -3248,50 +3233,50 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/{id}/History?");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
- if (collectionId != null)
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (query_pageReturned != null)
+ if (query_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("query.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(query_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("query.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( query_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (query_returnLimit != null)
+ if (query_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("query.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(query_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("query.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( query_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (query_sortField != null)
+ if (query_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("query.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(query_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("query.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( query_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (query_sortAscending != null)
+ if (query_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("query.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(query_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("query.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( query_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -3301,11 +3286,11 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -3313,10 +3298,10 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -3330,7 +3315,7 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
{
}
}
-
+
/// Returns all certificates according to the provided filter and output parameters
/// Optional certificate collection identifier used to ensure user access to the certificate
/// Include locations data for the certificates to be returned
@@ -3351,7 +3336,7 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
{
return QueryCertificatesAsync(collectionId, includeLocations, includeMetadata, includeHasPrivateKey, verbose, pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, pq_includeRevoked, pq_includeExpired, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns all certificates according to the provided filter and output parameters
/// Optional certificate collection identifier used to ensure user access to the certificate
@@ -3373,74 +3358,74 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates?");
- if (collectionId != null)
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (includeLocations != null)
+ if (includeLocations != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("includeLocations") + "=").Append(System.Uri.EscapeDataString(ConvertToString(includeLocations, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("includeLocations") + "=").Append(System.Uri.EscapeDataString(ConvertToString( includeLocations, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (includeMetadata != null)
+ if (includeMetadata != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("includeMetadata") + "=").Append(System.Uri.EscapeDataString(ConvertToString(includeMetadata, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("includeMetadata") + "=").Append(System.Uri.EscapeDataString(ConvertToString( includeMetadata, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (includeHasPrivateKey != null)
+ if (includeHasPrivateKey != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("includeHasPrivateKey") + "=").Append(System.Uri.EscapeDataString(ConvertToString(includeHasPrivateKey, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("includeHasPrivateKey") + "=").Append(System.Uri.EscapeDataString(ConvertToString( includeHasPrivateKey, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (verbose != null)
+ if (verbose != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("verbose") + "=").Append(System.Uri.EscapeDataString(ConvertToString(verbose, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("verbose") + "=").Append(System.Uri.EscapeDataString(ConvertToString( verbose, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_queryString != null)
+ if (pq_queryString != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_pageReturned != null)
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_includeRevoked != null)
+ if (pq_includeRevoked != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.includeRevoked") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_includeRevoked, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.includeRevoked") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_includeRevoked, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_includeExpired != null)
+ if (pq_includeExpired != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.includeExpired") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_includeExpired, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.includeExpired") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_includeExpired, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -3450,11 +3435,11 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -3462,10 +3447,10 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -3479,7 +3464,7 @@ public async System.Threading.Tasks.Task CompareMetadataAsync(int certific
{
}
}
-
+
/// Deletes multiple persisted certificates by their unique ids
/// Optional certificate collection identifier used to ensure user access to the certificate
/// Desired version of the api, if not provided defaults to v1
@@ -3491,7 +3476,7 @@ public System.Threading.Tasks.Task DeleteCertificatesAsync(int? collectionId, Sy
{
return DeleteCertificatesAsync(collectionId, body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Deletes multiple persisted certificates by their unique ids
/// Optional certificate collection identifier used to ensure user access to the certificate
@@ -3504,32 +3489,32 @@ public async System.Threading.Tasks.Task DeleteCertificatesAsync(int? collection
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates?");
- if (collectionId != null)
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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("DELETE");
-
+
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);
try
{
@@ -3539,18 +3524,18 @@ public async System.Threading.Tasks.Task DeleteCertificatesAsync(int? collection
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -3565,7 +3550,7 @@ public async System.Threading.Tasks.Task DeleteCertificatesAsync(int? collection
{
}
}
-
+
/// Updates the metadata for the certificate associated with the identifier provided
/// Optional certificate collection identifier used to ensure user access to the certificate
/// Desired version of the api, if not provided defaults to v1
@@ -3577,7 +3562,7 @@ public System.Threading.Tasks.Task UpdateMetadataAsync(int? collectionId, Metada
{
return UpdateMetadataAsync(collectionId, body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Updates the metadata for the certificate associated with the identifier provided
/// Optional certificate collection identifier used to ensure user access to the certificate
@@ -3590,32 +3575,32 @@ public async System.Threading.Tasks.Task UpdateMetadataAsync(int? collectionId,
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/Metadata?");
- if (collectionId != null)
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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");
-
+
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);
try
{
@@ -3625,18 +3610,18 @@ public async System.Threading.Tasks.Task UpdateMetadataAsync(int? collectionId,
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -3651,7 +3636,7 @@ public async System.Threading.Tasks.Task UpdateMetadataAsync(int? collectionId,
{
}
}
-
+
/// Updates the metadata for certificates associated with the certificate identifiers or query provided
/// Optional certificate collection identifier used to ensure user access to the certificate
/// Desired version of the api, if not provided defaults to v1
@@ -3663,7 +3648,7 @@ public System.Threading.Tasks.Task UpdateAllMetadataAsync(int? collectionId, Met
{
return UpdateAllMetadataAsync(collectionId, body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Updates the metadata for certificates associated with the certificate identifiers or query provided
/// Optional certificate collection identifier used to ensure user access to the certificate
@@ -3676,32 +3661,32 @@ public async System.Threading.Tasks.Task UpdateAllMetadataAsync(int? collectionI
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/Metadata/All?");
- if (collectionId != null)
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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");
-
+
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);
try
{
@@ -3711,18 +3696,18 @@ public async System.Threading.Tasks.Task UpdateAllMetadataAsync(int? collectionI
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -3737,7 +3722,7 @@ public async System.Threading.Tasks.Task UpdateAllMetadataAsync(int? collectionI
{
}
}
-
+
/// Imports the provided certificate into the Keyfactor instance, including any provided associated data
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -3746,9 +3731,9 @@ public async System.Threading.Tasks.Task UpdateAllMetadataAsync(int? collectionI
/// A server side error occurred.
public System.Threading.Tasks.Task PostImportCertificateAsync(CertificateImportRequestModel body)
{
- return PostImportCertificateAsync(body, System.Threading.CancellationToken.None);
+ return PostImportCertificateAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Imports the provided certificate into the Keyfactor instance, including any provided associated data
/// Desired version of the api, if not provided defaults to v1
@@ -3760,28 +3745,28 @@ public async System.Threading.Tasks.Task PostImp
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/Import");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -3791,11 +3776,11 @@ public async System.Threading.Tasks.Task PostImp
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -3803,10 +3788,10 @@ public async System.Threading.Tasks.Task PostImp
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificateImportResponseModel);
}
finally
@@ -3820,7 +3805,7 @@ public async System.Threading.Tasks.Task PostImp
{
}
}
-
+
/// Revokes the certificates associated with the provided identifiers and associates the provided data with the revocation
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -3829,9 +3814,9 @@ public async System.Threading.Tasks.Task PostImp
/// A server side error occurred.
public System.Threading.Tasks.Task RevokeAsync(RevokeCertificateRequest body)
{
- return RevokeAsync(body, System.Threading.CancellationToken.None);
+ return RevokeAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Revokes the certificates associated with the provided identifiers and associates the provided data with the revocation
/// Desired version of the api, if not provided defaults to v1
@@ -3843,28 +3828,28 @@ public async System.Threading.Tasks.Task RevokeAsync(RevokeC
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/Revoke");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -3874,11 +3859,11 @@ public async System.Threading.Tasks.Task RevokeAsync(RevokeC
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -3886,10 +3871,10 @@ public async System.Threading.Tasks.Task RevokeAsync(RevokeC
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(RevocationResponse);
}
finally
@@ -3903,7 +3888,7 @@ public async System.Threading.Tasks.Task RevokeAsync(RevokeC
{
}
}
-
+
/// Returns the public information of the certificate
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -3912,9 +3897,9 @@ public async System.Threading.Tasks.Task RevokeAsync(RevokeC
/// A server side error occurred.
public System.Threading.Tasks.Task> AnalyzeCertAsync(AnalyzeCertificateRequest body)
{
- return AnalyzeCertAsync(body, System.Threading.CancellationToken.None);
+ return AnalyzeCertAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns the public information of the certificate
/// Desired version of the api, if not provided defaults to v1
@@ -3926,28 +3911,28 @@ public async System.Threading.Tasks.Task RevokeAsync(RevokeC
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/Analyze");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -3957,11 +3942,11 @@ public async System.Threading.Tasks.Task RevokeAsync(RevokeC
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -3969,10 +3954,10 @@ public async System.Threading.Tasks.Task RevokeAsync(RevokeC
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -3986,7 +3971,7 @@ public async System.Threading.Tasks.Task RevokeAsync(RevokeC
{
}
}
-
+
/// Recovers the persisted certificate associated with the provided query
/// Optional certificate collection identifier used to ensure user access to the certificate
/// Desired version of the api, if not provided defaults to v1
@@ -3998,7 +3983,7 @@ public System.Threading.Tasks.Task RecoverCertificateAsync(int
{
return RecoverCertificateAsync(collectionId, body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Recovers the persisted certificate associated with the provided query
/// Optional certificate collection identifier used to ensure user access to the certificate
@@ -4011,33 +3996,33 @@ public async System.Threading.Tasks.Task RecoverCertificateAsy
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/Recover?");
- if (collectionId != null)
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -4047,11 +4032,11 @@ public async System.Threading.Tasks.Task RecoverCertificateAsy
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -4059,10 +4044,10 @@ public async System.Threading.Tasks.Task RecoverCertificateAsy
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(RecoveryResponse);
}
finally
@@ -4076,58 +4061,63 @@ public async System.Threading.Tasks.Task RecoverCertificateAsy
{
}
}
-
+
/// Downloads the persisted certificate associated with the provided query
/// Optional certificate collection identifier used to ensure user access to the certificate
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
+ /// Desired format [DER, PEM, P7B]
/// Query to filter the certificate to be recovered
/// OK
/// A server side error occurred.
- public System.Threading.Tasks.Task DownloadCertificateAsync(int? collectionId, CertificateDownloadRequest body)
+ public System.Threading.Tasks.Task DownloadCertificateAsync(int? collectionId, string x_certificateformat, CertificateDownloadRequest body)
{
- return DownloadCertificateAsync(collectionId, body, System.Threading.CancellationToken.None);
+ return DownloadCertificateAsync(collectionId, x_certificateformat, body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Downloads the persisted certificate associated with the provided query
/// Optional certificate collection identifier used to ensure user access to the certificate
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
+ /// Desired format [DER, PEM, P7B]
/// Query to filter the certificate to be recovered
/// OK
/// A server side error occurred.
- public async System.Threading.Tasks.Task DownloadCertificateAsync(int? collectionId, CertificateDownloadRequest body, System.Threading.CancellationToken cancellationToken)
+ public async System.Threading.Tasks.Task DownloadCertificateAsync(int? collectionId, string x_certificateformat, CertificateDownloadRequest body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/Download?");
- if (collectionId != null)
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ if (x_certificateformat == null)
+ throw new System.ArgumentNullException("x_certificateformat");
+ request_.Headers.TryAddWithoutValidation("x-certificateformat", ConvertToString( x_certificateformat, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -4137,11 +4127,11 @@ public async System.Threading.Tasks.Task DownloadCe
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -4149,10 +4139,10 @@ public async System.Threading.Tasks.Task DownloadCe
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificateDownloadResponse);
}
finally
@@ -4166,7 +4156,7 @@ public async System.Threading.Tasks.Task DownloadCe
{
}
}
-
+
/// Revokes the certificates associated with the provided query and Collection Id and associates the provided data with the revocation
/// A collection Id to be used for permissions and part of the query to revoke certificates
/// Desired version of the api, if not provided defaults to v1
@@ -4178,7 +4168,7 @@ public System.Threading.Tasks.Task RevokeAllAsync(int? colle
{
return RevokeAllAsync(collectionId, body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Revokes the certificates associated with the provided query and Collection Id and associates the provided data with the revocation
/// A collection Id to be used for permissions and part of the query to revoke certificates
@@ -4191,33 +4181,33 @@ public async System.Threading.Tasks.Task RevokeAllAsync(int?
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/RevokeAll?");
- if (collectionId != null)
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -4227,11 +4217,11 @@ public async System.Threading.Tasks.Task RevokeAllAsync(int?
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -4239,10 +4229,10 @@ public async System.Threading.Tasks.Task RevokeAllAsync(int?
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(RevocationResponse);
}
finally
@@ -4256,7 +4246,7 @@ public async System.Threading.Tasks.Task RevokeAllAsync(int?
{
}
}
-
+
/// Deletes multiple persisted certificate entities selected by a given query
/// Optional certificate collection identifier used to ensure user access to the certificate
/// Desired version of the api, if not provided defaults to v1
@@ -4268,7 +4258,7 @@ public System.Threading.Tasks.Task DeleteByQueryAsync(int? collectionId, string
{
return DeleteByQueryAsync(collectionId, body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Deletes multiple persisted certificate entities selected by a given query
/// Optional certificate collection identifier used to ensure user access to the certificate
@@ -4281,32 +4271,32 @@ public async System.Threading.Tasks.Task DeleteByQueryAsync(int? collectionId, s
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/Query?");
- if (collectionId != null)
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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("DELETE");
-
+
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);
try
{
@@ -4316,18 +4306,18 @@ public async System.Threading.Tasks.Task DeleteByQueryAsync(int? collectionId, s
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -4342,7 +4332,7 @@ public async System.Threading.Tasks.Task DeleteByQueryAsync(int? collectionId, s
{
}
}
-
+
/// Deletes the persisted private keys of multiple certificates by the unique ids of the Certificates
/// Optional certificate collection identifier used to ensure user access to the certificate
/// Desired version of the api, if not provided defaults to v1
@@ -4354,7 +4344,7 @@ public System.Threading.Tasks.Task DeletePrivateKeys0Async(int? collectionId, Sy
{
return DeletePrivateKeys0Async(collectionId, body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Deletes the persisted private keys of multiple certificates by the unique ids of the Certificates
/// Optional certificate collection identifier used to ensure user access to the certificate
@@ -4367,32 +4357,32 @@ public async System.Threading.Tasks.Task DeletePrivateKeys0Async(int? collection
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/PrivateKey?");
- if (collectionId != null)
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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("DELETE");
-
+
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);
try
{
@@ -4402,18 +4392,18 @@ public async System.Threading.Tasks.Task DeletePrivateKeys0Async(int? collection
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -4428,7 +4418,7 @@ public async System.Threading.Tasks.Task DeletePrivateKeys0Async(int? collection
{
}
}
-
+
/// Deletes the persisted private key of the certificate associated with the provided identifier
/// Keyfactor identifier of the certificate for which the associated private key should be deleted
/// Optional certificate collection identifier used to ensure user access to the certificate
@@ -4440,7 +4430,7 @@ public System.Threading.Tasks.Task DeletePrivateKeys1Async(int id, int? collecti
{
return DeletePrivateKeys1Async(id, collectionId, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Deletes the persisted private key of the certificate associated with the provided identifier
/// Keyfactor identifier of the certificate for which the associated private key should be deleted
@@ -4453,33 +4443,33 @@ public async System.Threading.Tasks.Task DeletePrivateKeys1Async(int id, int? co
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Certificates/PrivateKey/{id}?");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
- if (collectionId != null)
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (collectionId != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("collectionId") + "=").Append(System.Uri.EscapeDataString(ConvertToString( collectionId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("DELETE");
-
+
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);
try
{
@@ -4489,18 +4479,18 @@ public async System.Threading.Tasks.Task DeletePrivateKeys1Async(int id, int? co
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -4515,14 +4505,14 @@ public async System.Threading.Tasks.Task DeletePrivateKeys1Async(int id, int? co
{
}
}
+
+
+
+
+
+
-
-
-
-
-
-
-
+
/// Returns details for a single CA, specified by ID
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -4532,7 +4522,7 @@ public System.Threading.Tasks.Task GetCaAsync(int
{
return GetCaAsync(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns details for a single CA, specified by ID
/// Desired version of the api, if not provided defaults to v1
@@ -4543,29 +4533,29 @@ public async System.Threading.Tasks.Task GetCaAsyn
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/CertificateAuthority/{id}");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -4575,11 +4565,11 @@ public async System.Threading.Tasks.Task GetCaAsyn
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -4587,10 +4577,10 @@ public async System.Threading.Tasks.Task GetCaAsyn
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificateAuthorityResponse);
}
finally
@@ -4604,7 +4594,7 @@ public async System.Threading.Tasks.Task GetCaAsyn
{
}
}
-
+
/// Deletes a CertificateAuthority from the system, specified by ID
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -4614,7 +4604,7 @@ public System.Threading.Tasks.Task DeleteCAAsync(int id)
{
return DeleteCAAsync(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Deletes a CertificateAuthority from the system, specified by ID
/// Desired version of the api, if not provided defaults to v1
@@ -4625,28 +4615,28 @@ public async System.Threading.Tasks.Task DeleteCAAsync(int id, System.Threading.
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/CertificateAuthority/{id}");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("DELETE");
-
+
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);
try
{
@@ -4656,18 +4646,18 @@ public async System.Threading.Tasks.Task DeleteCAAsync(int id, System.Threading.
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -4682,7 +4672,7 @@ public async System.Threading.Tasks.Task DeleteCAAsync(int id, System.Threading.
{
}
}
-
+
/// Returns all certificate authorities
/// Desired version of the api, if not provided defaults to v1
/// Contents of the query (ex: field1 -eq value1 AND field2 -gt value2)
@@ -4695,9 +4685,9 @@ public async System.Threading.Tasks.Task DeleteCAAsync(int id, System.Threading.
/// A server side error occurred.
public System.Threading.Tasks.Task> GetCasAsync(string pq_queryString, int? pq_pageReturned, int? pq_returnLimit, string pq_sortField, SortAscending12? pq_sortAscending)
{
- return GetCasAsync(pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
+ return GetCasAsync( pq_queryString, pq_pageReturned, pq_returnLimit, pq_sortField, pq_sortAscending, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns all certificate authorities
/// Desired version of the api, if not provided defaults to v1
@@ -4713,46 +4703,46 @@ public async System.Threading.Tasks.Task DeleteCAAsync(int id, System.Threading.
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/CertificateAuthority?");
- if (pq_queryString != null)
+ if (pq_queryString != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.queryString") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_queryString, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_pageReturned != null)
+ if (pq_pageReturned != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.pageReturned") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_pageReturned, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_returnLimit != null)
+ if (pq_returnLimit != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.returnLimit") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_returnLimit, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortField != null)
+ if (pq_sortField != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortField") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortField, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
- if (pq_sortAscending != null)
+ if (pq_sortAscending != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
+ urlBuilder_.Append(System.Uri.EscapeDataString("pq.sortAscending") + "=").Append(System.Uri.EscapeDataString(ConvertToString( pq_sortAscending, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -4762,11 +4752,11 @@ public async System.Threading.Tasks.Task DeleteCAAsync(int id, System.Threading.
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -4774,10 +4764,10 @@ public async System.Threading.Tasks.Task DeleteCAAsync(int id, System.Threading.
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(System.Collections.Generic.ICollection);
}
finally
@@ -4791,7 +4781,7 @@ public async System.Threading.Tasks.Task DeleteCAAsync(int id, System.Threading.
{
}
}
-
+
/// Updates a CertificateAuthority object
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -4799,9 +4789,9 @@ public async System.Threading.Tasks.Task DeleteCAAsync(int id, System.Threading.
/// A server side error occurred.
public System.Threading.Tasks.Task UpdateCAAsync(CertificateAuthorityRequest body)
{
- return UpdateCAAsync(body, System.Threading.CancellationToken.None);
+ return UpdateCAAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Updates a CertificateAuthority object
/// Desired version of the api, if not provided defaults to v1
@@ -4812,28 +4802,28 @@ public async System.Threading.Tasks.Task UpdateCAA
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/CertificateAuthority");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -4843,11 +4833,11 @@ public async System.Threading.Tasks.Task UpdateCAA
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -4855,10 +4845,10 @@ public async System.Threading.Tasks.Task UpdateCAA
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificateAuthorityResponse);
}
finally
@@ -4872,7 +4862,7 @@ public async System.Threading.Tasks.Task UpdateCAA
{
}
}
-
+
/// Creates a new CertificateAuthority object
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -4880,9 +4870,9 @@ public async System.Threading.Tasks.Task UpdateCAA
/// A server side error occurred.
public System.Threading.Tasks.Task CreateCAAsync(CertificateAuthorityRequest body)
{
- return CreateCAAsync(body, System.Threading.CancellationToken.None);
+ return CreateCAAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Creates a new CertificateAuthority object
/// Desired version of the api, if not provided defaults to v1
@@ -4893,28 +4883,28 @@ public async System.Threading.Tasks.Task CreateCAA
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/CertificateAuthority");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -4924,11 +4914,11 @@ public async System.Threading.Tasks.Task CreateCAA
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -4936,10 +4926,10 @@ public async System.Threading.Tasks.Task CreateCAA
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificateAuthorityResponse);
}
finally
@@ -4953,7 +4943,7 @@ public async System.Threading.Tasks.Task CreateCAA
{
}
}
-
+
/// Validates the connection info for the CA provided by the model.
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -4962,9 +4952,9 @@ public async System.Threading.Tasks.Task CreateCAA
/// A server side error occurred.
public System.Threading.Tasks.Task TestCertificateAuthorityAsync(CertificateAuthorityRequest body)
{
- return TestCertificateAuthorityAsync(body, System.Threading.CancellationToken.None);
+ return TestCertificateAuthorityAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Validates the connection info for the CA provided by the model.
/// Desired version of the api, if not provided defaults to v1
@@ -4976,28 +4966,28 @@ public async System.Threading.Tasks.Task TestC
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/CertificateAuthority/Test");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -5007,11 +4997,11 @@ public async System.Threading.Tasks.Task TestC
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -5019,10 +5009,10 @@ public async System.Threading.Tasks.Task TestC
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificateAuthorityTestResponse);
}
finally
@@ -5036,7 +5026,7 @@ public async System.Threading.Tasks.Task TestC
{
}
}
-
+
/// Publishes a CRL according to the provided request
/// Desired version of the api, if not provided defaults to v1
/// Type of the request [XMLHttpRequest, APIClient]
@@ -5045,9 +5035,9 @@ public async System.Threading.Tasks.Task TestC
/// A server side error occurred.
public System.Threading.Tasks.Task PublishCRLAsync(CRLRequestModel body)
{
- return PublishCRLAsync(body, System.Threading.CancellationToken.None);
+ return PublishCRLAsync( body, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Publishes a CRL according to the provided request
/// Desired version of the api, if not provided defaults to v1
@@ -5059,27 +5049,27 @@ public async System.Threading.Tasks.Task PublishCRLAsync(CRLRequestModel body, S
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/CertificateAuthority/PublishCRL");
-
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
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");
-
+
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);
try
{
@@ -5089,18 +5079,18 @@ public async System.Threading.Tasks.Task PublishCRLAsync(CRLRequestModel body, S
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "204")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "204")
{
return;
}
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
@@ -5115,14 +5105,14 @@ public async System.Threading.Tasks.Task PublishCRLAsync(CRLRequestModel body, S
{
}
}
+
+
+
+
+
+
-
-
-
-
-
-
-
+
/// Returns the certificate collection definition associated with the provided Keyfactor identifier
/// Identifier of the certificate collection
/// Desired version of the api, if not provided defaults to v1
@@ -5133,7 +5123,7 @@ public System.Threading.Tasks.Task GetCollection0Async(int id)
{
return GetCollection0Async(id, System.Threading.CancellationToken.None);
}
-
+
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Returns the certificate collection definition associated with the provided Keyfactor identifier
/// Identifier of the certificate collection
@@ -5145,29 +5135,29 @@ public async System.Threading.Tasks.Task GetCollection0Async(i
{
if (id == null)
throw new System.ArgumentNullException("id");
-
+
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/CertificateCollections/{id}");
- urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
-
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString( id, System.Globalization.CultureInfo.InvariantCulture)));
+
var client_ = _httpClient;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
if (x_keyfactor_api_version != null)
- request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString(x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-api-version", ConvertToString( x_keyfactor_api_version, System.Globalization.CultureInfo.InvariantCulture));
if (x_keyfactor_requested_with == null)
throw new System.ArgumentNullException("x_keyfactor_requested_with");
- request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString(x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Headers.TryAddWithoutValidation("x-keyfactor-requested-with", ConvertToString( x_keyfactor_requested_with, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
-
+
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);
try
{
@@ -5177,11 +5167,11 @@ public async System.Threading.Tasks.Task GetCollection0Async(i
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
-
+
ProcessResponse(client_, response_);
-
- var status_ = ( (int)response_.StatusCode ).ToString();
- if (status_ == "200")
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
{
var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false);
return objectResponse_.Object;
@@ -5189,10 +5179,10 @@ public async System.Threading.Tasks.Task GetCollection0Async(i
else
if (status_ != "200" && status_ != "204")
{
- 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 (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
-
+
return default(CertificateQuery);
}
finally
@@ -5206,7 +5196,7 @@ public async System.Threading.Tasks.Task