/*
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
using RestSharp;
using InfluxDB.Client.Api.Client;
using InfluxDB.Client.Api.Domain;
namespace InfluxDB.Client.Api.Service
{
///
/// Represents a collection of functions to interact with the API endpoints
///
public interface ILegacyAuthorizationsService : IApiAccessor
{
#region Synchronous Operations
///
/// Delete a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
///
void DeleteLegacyAuthorizationsID(string authID, string zapTraceSpan = null);
///
/// Delete a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
ApiResponse DeleteLegacyAuthorizationsIDWithHttpInfo(string authID, string zapTraceSpan = null);
///
/// List all legacy authorizations
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// Authorizations
Authorizations GetLegacyAuthorizations(string zapTraceSpan = null, string userID = null, string user = null,
string orgID = null, string org = null, string token = null, string authID = null);
///
/// List all legacy authorizations
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// ApiResponse of Authorizations
ApiResponse GetLegacyAuthorizationsWithHttpInfo(string zapTraceSpan = null,
string userID = null, string user = null, string orgID = null, string org = null, string token = null,
string authID = null);
///
/// Retrieve a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// Authorization
Authorization GetLegacyAuthorizationsID(string authID, string zapTraceSpan = null);
///
/// Retrieve a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
ApiResponse GetLegacyAuthorizationsIDWithHttpInfo(string authID, string zapTraceSpan = null);
///
/// Update a legacy authorization to be active or inactive
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// Authorization
Authorization PatchLegacyAuthorizationsID(string authID, AuthorizationUpdateRequest authorizationUpdateRequest,
string zapTraceSpan = null);
///
/// Update a legacy authorization to be active or inactive
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
ApiResponse PatchLegacyAuthorizationsIDWithHttpInfo(string authID,
AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null);
///
/// Create a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// Authorization
Authorization PostLegacyAuthorizations(LegacyAuthorizationPostRequest legacyAuthorizationPostRequest,
string zapTraceSpan = null);
///
/// Create a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
ApiResponse PostLegacyAuthorizationsWithHttpInfo(
LegacyAuthorizationPostRequest legacyAuthorizationPostRequest, string zapTraceSpan = null);
///
/// Set a legacy authorization password
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
///
void PostLegacyAuthorizationsIDPassword(string authID, PasswordResetBody passwordResetBody,
string zapTraceSpan = null);
///
/// Set a legacy authorization password
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
ApiResponse PostLegacyAuthorizationsIDPasswordWithHttpInfo(string authID,
PasswordResetBody passwordResetBody, string zapTraceSpan = null);
#endregion Synchronous Operations
#region Asynchronous Operations
///
/// Delete a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of void
System.Threading.Tasks.Task DeleteLegacyAuthorizationsIDAsync(string authID, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Delete a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse
System.Threading.Tasks.Task> DeleteLegacyAuthorizationsIDAsyncWithHttpInfo(string authID,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// List all legacy authorizations
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// Cancellation token
/// Task of Authorizations
System.Threading.Tasks.Task GetLegacyAuthorizationsAsync(string zapTraceSpan = null,
string userID = null, string user = null, string orgID = null, string org = null, string token = null,
string authID = null, CancellationToken cancellationToken = default);
///
/// List all legacy authorizations
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// Cancellation token
/// Task of ApiResponse (Authorizations)
System.Threading.Tasks.Task> GetLegacyAuthorizationsAsyncWithHttpInfo(
string zapTraceSpan = null, string userID = null, string user = null, string orgID = null,
string org = null, string token = null, string authID = null,
CancellationToken cancellationToken = default);
///
/// Retrieve a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Authorization
System.Threading.Tasks.Task GetLegacyAuthorizationsIDAsync(string authID,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Retrieve a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Authorization)
System.Threading.Tasks.Task> GetLegacyAuthorizationsIDAsyncWithHttpInfo(
string authID, string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Update a legacy authorization to be active or inactive
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Authorization
System.Threading.Tasks.Task PatchLegacyAuthorizationsIDAsync(string authID,
AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Update a legacy authorization to be active or inactive
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Authorization)
System.Threading.Tasks.Task> PatchLegacyAuthorizationsIDAsyncWithHttpInfo(
string authID, AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Create a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Authorization
System.Threading.Tasks.Task PostLegacyAuthorizationsAsync(
LegacyAuthorizationPostRequest legacyAuthorizationPostRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Create a legacy authorization
///
///
///
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Authorization)
System.Threading.Tasks.Task> PostLegacyAuthorizationsAsyncWithHttpInfo(
LegacyAuthorizationPostRequest legacyAuthorizationPostRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Set a legacy authorization password
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of void
System.Threading.Tasks.Task PostLegacyAuthorizationsIDPasswordAsync(string authID,
PasswordResetBody passwordResetBody, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Set a legacy authorization password
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse
System.Threading.Tasks.Task> PostLegacyAuthorizationsIDPasswordAsyncWithHttpInfo(
string authID, PasswordResetBody passwordResetBody, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
#endregion Asynchronous Operations
}
///
/// Represents a collection of functions to interact with the API endpoints
///
public partial class LegacyAuthorizationsService : ILegacyAuthorizationsService
{
private ExceptionFactory _exceptionFactory = (name, response) => null;
///
/// Initializes a new instance of the class.
///
///
public LegacyAuthorizationsService(string basePath)
{
Configuration = new Configuration { BasePath = basePath };
ExceptionFactory = Configuration.DefaultExceptionFactory;
}
///
/// Initializes a new instance of the class
/// using Configuration object
///
/// An instance of Configuration
///
public LegacyAuthorizationsService(Configuration configuration = null)
{
if (configuration == null) // use the default one in Configuration
{
Configuration = Configuration.Default;
}
else
{
Configuration = configuration;
}
ExceptionFactory = Configuration.DefaultExceptionFactory;
}
///
/// Gets the base path of the API client.
///
/// The base path
public string GetBasePath()
{
return Configuration.ApiClient.RestClientOptions.BaseUrl.ToString();
}
///
/// Sets the base path of the API client.
///
/// The base path
[Obsolete(
"SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
public void SetBasePath(string basePath)
{
// do nothing
}
///
/// Gets or sets the configuration object
///
/// An instance of the Configuration
public Configuration Configuration { get; set; }
///
/// Provides a factory method hook for the creation of exceptions.
///
public ExceptionFactory ExceptionFactory
{
get
{
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
{
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
}
return _exceptionFactory;
}
set => _exceptionFactory = value;
}
///
/// Gets the default header.
///
/// Dictionary of HTTP header
[Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")]
public IDictionary DefaultHeader()
{
return new ReadOnlyDictionary(Configuration.DefaultHeader);
}
///
/// Add default header.
///
/// Header field name.
/// Header field value.
///
[Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")]
public void AddDefaultHeader(string key, string value)
{
Configuration.AddDefaultHeader(key, value);
}
///
/// Delete a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
///
public void DeleteLegacyAuthorizationsID(string authID, string zapTraceSpan = null)
{
DeleteLegacyAuthorizationsIDWithHttpInfo(authID, zapTraceSpan);
}
///
/// Delete a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public ApiResponse DeleteLegacyAuthorizationsIDWithHttpInfo(string authID, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->DeleteLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("DeleteLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Delete a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Object(void)
public async System.Threading.Tasks.Task DeleteLegacyAuthorizationsIDWithIRestResponseAsync(
string authID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->DeleteLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("DeleteLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Delete a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public RestResponse DeleteLegacyAuthorizationsIDWithIRestResponse(string authID, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->DeleteLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("DeleteLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Delete a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public RestRequest DeleteLegacyAuthorizationsIDWithRestRequest(string authID, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->DeleteLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
return Configuration.ApiClient.PrepareRequest(localVarPath,
Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
}
///
/// Delete a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of void
public System.Threading.Tasks.Task DeleteLegacyAuthorizationsIDAsync(string authID, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
return DeleteLegacyAuthorizationsIDAsyncWithHttpInfo(authID, zapTraceSpan, cancellationToken);
}
///
/// Delete a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse
public async System.Threading.Tasks.Task> DeleteLegacyAuthorizationsIDAsyncWithHttpInfo(
string authID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await DeleteLegacyAuthorizationsIDAsyncWithIRestResponse(authID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("DeleteLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Delete a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse
public async System.Threading.Tasks.Task DeleteLegacyAuthorizationsIDAsyncWithIRestResponse(
string authID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->DeleteLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("DeleteLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all legacy authorizations
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// Authorizations
public Authorizations GetLegacyAuthorizations(string zapTraceSpan = null, string userID = null,
string user = null, string orgID = null, string org = null, string token = null, string authID = null)
{
var localVarResponse =
GetLegacyAuthorizationsWithHttpInfo(zapTraceSpan, userID, user, orgID, org, token, authID);
return localVarResponse.Data;
}
///
/// List all legacy authorizations
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// ApiResponse of Authorizations
public ApiResponse GetLegacyAuthorizationsWithHttpInfo(string zapTraceSpan = null,
string userID = null, string user = null, string orgID = null, string org = null, string token = null,
string authID = null)
{
var localVarPath = "/private/legacy/authorizations";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (userID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "userID", userID)); // query parameter
}
if (user != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "user", user)); // query parameter
}
if (orgID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter
}
if (org != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter
}
if (token != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "token", token)); // query parameter
}
if (authID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "authID", authID)); // query parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetLegacyAuthorizations", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Authorizations)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Authorizations)));
}
///
/// List all legacy authorizations
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// Cancellation token
/// ApiResponse of Authorizations
public async System.Threading.Tasks.Task GetLegacyAuthorizationsWithIRestResponseAsync(
string zapTraceSpan = null, string userID = null, string user = null, string orgID = null,
string org = null, string token = null, string authID = null, CancellationToken cancellationToken = default)
{
var localVarPath = "/private/legacy/authorizations";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (userID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "userID", userID)); // query parameter
}
if (user != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "user", user)); // query parameter
}
if (orgID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter
}
if (org != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter
}
if (token != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "token", token)); // query parameter
}
if (authID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "authID", authID)); // query parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetLegacyAuthorizations", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all legacy authorizations
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// ApiResponse of Authorizations
public RestResponse GetLegacyAuthorizationsWithIRestResponse(string zapTraceSpan = null, string userID = null,
string user = null, string orgID = null, string org = null, string token = null, string authID = null)
{
var localVarPath = "/private/legacy/authorizations";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (userID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "userID", userID)); // query parameter
}
if (user != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "user", user)); // query parameter
}
if (orgID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter
}
if (org != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter
}
if (token != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "token", token)); // query parameter
}
if (authID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "authID", authID)); // query parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetLegacyAuthorizations", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all legacy authorizations
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// ApiResponse of Authorizations
public RestRequest GetLegacyAuthorizationsWithRestRequest(string zapTraceSpan = null, string userID = null,
string user = null, string orgID = null, string org = null, string token = null, string authID = null)
{
var localVarPath = "/private/legacy/authorizations";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (userID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "userID", userID)); // query parameter
}
if (user != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "user", user)); // query parameter
}
if (orgID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter
}
if (org != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter
}
if (token != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "token", token)); // query parameter
}
if (authID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "authID", authID)); // query parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
return Configuration.ApiClient.PrepareRequest(localVarPath,
Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
}
///
/// List all legacy authorizations
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// Cancellation token
/// Task of Authorizations
public async System.Threading.Tasks.Task GetLegacyAuthorizationsAsync(
string zapTraceSpan = null, string userID = null, string user = null, string orgID = null,
string org = null, string token = null, string authID = null, CancellationToken cancellationToken = default)
{
var localVarResponse =
await GetLegacyAuthorizationsAsyncWithHttpInfo(zapTraceSpan, userID, user, orgID, org, token, authID,
cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// List all legacy authorizations
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// Cancellation token
/// Task of ApiResponse (Authorizations)
public async System.Threading.Tasks.Task> GetLegacyAuthorizationsAsyncWithHttpInfo(
string zapTraceSpan = null, string userID = null, string user = null, string orgID = null,
string org = null, string token = null, string authID = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await GetLegacyAuthorizationsAsyncWithIRestResponse(zapTraceSpan, userID, user, orgID, org, token,
authID, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetLegacyAuthorizations", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Authorizations)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Authorizations)));
}
///
/// List all legacy authorizations
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Only show legacy authorizations that belong to a user ID. (optional)
/// Only show legacy authorizations that belong to a user name. (optional)
/// Only show legacy authorizations that belong to an organization ID. (optional)
/// Only show legacy authorizations that belong to a organization name. (optional)
/// Only show legacy authorizations with a specified token (auth name). (optional)
/// Only show legacy authorizations with a specified auth ID. (optional)
/// Cancellation token
/// Task of RestResponse (Authorizations)
public async System.Threading.Tasks.Task GetLegacyAuthorizationsAsyncWithIRestResponse(
string zapTraceSpan = null, string userID = null, string user = null, string orgID = null,
string org = null, string token = null, string authID = null, CancellationToken cancellationToken = default)
{
var localVarPath = "/private/legacy/authorizations";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (userID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "userID", userID)); // query parameter
}
if (user != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "user", user)); // query parameter
}
if (orgID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter
}
if (org != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter
}
if (token != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "token", token)); // query parameter
}
if (authID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "authID", authID)); // query parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetLegacyAuthorizations", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// Authorization
public Authorization GetLegacyAuthorizationsID(string authID, string zapTraceSpan = null)
{
var localVarResponse = GetLegacyAuthorizationsIDWithHttpInfo(authID, zapTraceSpan);
return localVarResponse.Data;
}
///
/// Retrieve a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
public ApiResponse GetLegacyAuthorizationsIDWithHttpInfo(string authID,
string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->GetLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Authorization)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Authorization)));
}
///
/// Retrieve a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Authorization
public async System.Threading.Tasks.Task GetLegacyAuthorizationsIDWithIRestResponseAsync(
string authID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->GetLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
public RestResponse GetLegacyAuthorizationsIDWithIRestResponse(string authID, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->GetLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
public RestRequest GetLegacyAuthorizationsIDWithRestRequest(string authID, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->GetLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
return Configuration.ApiClient.PrepareRequest(localVarPath,
Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
}
///
/// Retrieve a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Authorization
public async System.Threading.Tasks.Task GetLegacyAuthorizationsIDAsync(string authID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
var localVarResponse =
await GetLegacyAuthorizationsIDAsyncWithHttpInfo(authID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Retrieve a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Authorization)
public async System.Threading.Tasks.Task> GetLegacyAuthorizationsIDAsyncWithHttpInfo(
string authID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await GetLegacyAuthorizationsIDAsyncWithIRestResponse(authID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Authorization)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Authorization)));
}
///
/// Retrieve a legacy authorization
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to get.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (Authorization)
public async System.Threading.Tasks.Task GetLegacyAuthorizationsIDAsyncWithIRestResponse(
string authID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->GetLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Update a legacy authorization to be active or inactive
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// Authorization
public Authorization PatchLegacyAuthorizationsID(string authID,
AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null)
{
var localVarResponse =
PatchLegacyAuthorizationsIDWithHttpInfo(authID, authorizationUpdateRequest, zapTraceSpan);
return localVarResponse.Data;
}
///
/// Update a legacy authorization to be active or inactive
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
public ApiResponse PatchLegacyAuthorizationsIDWithHttpInfo(string authID,
AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->PatchLegacyAuthorizationsID");
}
// verify the required parameter 'authorizationUpdateRequest' is set
if (authorizationUpdateRequest == null)
{
throw new ApiException(400,
"Missing required parameter 'authorizationUpdateRequest' when calling LegacyAuthorizationsService->PatchLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (authorizationUpdateRequest != null && authorizationUpdateRequest.GetType() != typeof(byte[]))
{
localVarPostBody =
Configuration.ApiClient.Serialize(authorizationUpdateRequest); // http body (model) parameter
}
else
{
localVarPostBody = authorizationUpdateRequest; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PatchLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Authorization)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Authorization)));
}
///
/// Update a legacy authorization to be active or inactive
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Authorization
public async System.Threading.Tasks.Task PatchLegacyAuthorizationsIDWithIRestResponseAsync(
string authID, AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->PatchLegacyAuthorizationsID");
}
// verify the required parameter 'authorizationUpdateRequest' is set
if (authorizationUpdateRequest == null)
{
throw new ApiException(400,
"Missing required parameter 'authorizationUpdateRequest' when calling LegacyAuthorizationsService->PatchLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (authorizationUpdateRequest != null && authorizationUpdateRequest.GetType() != typeof(byte[]))
{
localVarPostBody =
Configuration.ApiClient.Serialize(authorizationUpdateRequest); // http body (model) parameter
}
else
{
localVarPostBody = authorizationUpdateRequest; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PatchLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Update a legacy authorization to be active or inactive
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
public RestResponse PatchLegacyAuthorizationsIDWithIRestResponse(string authID,
AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->PatchLegacyAuthorizationsID");
}
// verify the required parameter 'authorizationUpdateRequest' is set
if (authorizationUpdateRequest == null)
{
throw new ApiException(400,
"Missing required parameter 'authorizationUpdateRequest' when calling LegacyAuthorizationsService->PatchLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (authorizationUpdateRequest != null && authorizationUpdateRequest.GetType() != typeof(byte[]))
{
localVarPostBody =
Configuration.ApiClient.Serialize(authorizationUpdateRequest); // http body (model) parameter
}
else
{
localVarPostBody = authorizationUpdateRequest; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PatchLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Update a legacy authorization to be active or inactive
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
public RestRequest PatchLegacyAuthorizationsIDWithRestRequest(string authID,
AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->PatchLegacyAuthorizationsID");
}
// verify the required parameter 'authorizationUpdateRequest' is set
if (authorizationUpdateRequest == null)
{
throw new ApiException(400,
"Missing required parameter 'authorizationUpdateRequest' when calling LegacyAuthorizationsService->PatchLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (authorizationUpdateRequest != null && authorizationUpdateRequest.GetType() != typeof(byte[]))
{
localVarPostBody =
Configuration.ApiClient.Serialize(authorizationUpdateRequest); // http body (model) parameter
}
else
{
localVarPostBody = authorizationUpdateRequest; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
return Configuration.ApiClient.PrepareRequest(localVarPath,
Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
}
///
/// Update a legacy authorization to be active or inactive
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Authorization
public async System.Threading.Tasks.Task PatchLegacyAuthorizationsIDAsync(string authID,
AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
var localVarResponse =
await PatchLegacyAuthorizationsIDAsyncWithHttpInfo(authID, authorizationUpdateRequest, zapTraceSpan,
cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Update a legacy authorization to be active or inactive
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Authorization)
public async System.Threading.Tasks.Task>
PatchLegacyAuthorizationsIDAsyncWithHttpInfo(string authID,
AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await PatchLegacyAuthorizationsIDAsyncWithIRestResponse(authID, authorizationUpdateRequest,
zapTraceSpan, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PatchLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Authorization)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Authorization)));
}
///
/// Update a legacy authorization to be active or inactive
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// Legacy authorization to update
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (Authorization)
public async System.Threading.Tasks.Task PatchLegacyAuthorizationsIDAsyncWithIRestResponse(
string authID, AuthorizationUpdateRequest authorizationUpdateRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->PatchLegacyAuthorizationsID");
}
// verify the required parameter 'authorizationUpdateRequest' is set
if (authorizationUpdateRequest == null)
{
throw new ApiException(400,
"Missing required parameter 'authorizationUpdateRequest' when calling LegacyAuthorizationsService->PatchLegacyAuthorizationsID");
}
var localVarPath = "/private/legacy/authorizations/{authID}";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (authorizationUpdateRequest != null && authorizationUpdateRequest.GetType() != typeof(byte[]))
{
localVarPostBody =
Configuration.ApiClient.Serialize(authorizationUpdateRequest); // http body (model) parameter
}
else
{
localVarPostBody = authorizationUpdateRequest; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PatchLegacyAuthorizationsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Create a legacy authorization
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// Authorization
public Authorization PostLegacyAuthorizations(LegacyAuthorizationPostRequest legacyAuthorizationPostRequest,
string zapTraceSpan = null)
{
var localVarResponse = PostLegacyAuthorizationsWithHttpInfo(legacyAuthorizationPostRequest, zapTraceSpan);
return localVarResponse.Data;
}
///
/// Create a legacy authorization
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
public ApiResponse PostLegacyAuthorizationsWithHttpInfo(
LegacyAuthorizationPostRequest legacyAuthorizationPostRequest, string zapTraceSpan = null)
{
// verify the required parameter 'legacyAuthorizationPostRequest' is set
if (legacyAuthorizationPostRequest == null)
{
throw new ApiException(400,
"Missing required parameter 'legacyAuthorizationPostRequest' when calling LegacyAuthorizationsService->PostLegacyAuthorizations");
}
var localVarPath = "/private/legacy/authorizations";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (legacyAuthorizationPostRequest != null && legacyAuthorizationPostRequest.GetType() != typeof(byte[]))
{
localVarPostBody =
Configuration.ApiClient.Serialize(legacyAuthorizationPostRequest); // http body (model) parameter
}
else
{
localVarPostBody = legacyAuthorizationPostRequest; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostLegacyAuthorizations", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Authorization)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Authorization)));
}
///
/// Create a legacy authorization
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Authorization
public async System.Threading.Tasks.Task PostLegacyAuthorizationsWithIRestResponseAsync(
LegacyAuthorizationPostRequest legacyAuthorizationPostRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// verify the required parameter 'legacyAuthorizationPostRequest' is set
if (legacyAuthorizationPostRequest == null)
{
throw new ApiException(400,
"Missing required parameter 'legacyAuthorizationPostRequest' when calling LegacyAuthorizationsService->PostLegacyAuthorizations");
}
var localVarPath = "/private/legacy/authorizations";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (legacyAuthorizationPostRequest != null && legacyAuthorizationPostRequest.GetType() != typeof(byte[]))
{
localVarPostBody =
Configuration.ApiClient.Serialize(legacyAuthorizationPostRequest); // http body (model) parameter
}
else
{
localVarPostBody = legacyAuthorizationPostRequest; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostLegacyAuthorizations", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Create a legacy authorization
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
public RestResponse PostLegacyAuthorizationsWithIRestResponse(
LegacyAuthorizationPostRequest legacyAuthorizationPostRequest, string zapTraceSpan = null)
{
// verify the required parameter 'legacyAuthorizationPostRequest' is set
if (legacyAuthorizationPostRequest == null)
{
throw new ApiException(400,
"Missing required parameter 'legacyAuthorizationPostRequest' when calling LegacyAuthorizationsService->PostLegacyAuthorizations");
}
var localVarPath = "/private/legacy/authorizations";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (legacyAuthorizationPostRequest != null && legacyAuthorizationPostRequest.GetType() != typeof(byte[]))
{
localVarPostBody =
Configuration.ApiClient.Serialize(legacyAuthorizationPostRequest); // http body (model) parameter
}
else
{
localVarPostBody = legacyAuthorizationPostRequest; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostLegacyAuthorizations", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Create a legacy authorization
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// ApiResponse of Authorization
public RestRequest PostLegacyAuthorizationsWithRestRequest(
LegacyAuthorizationPostRequest legacyAuthorizationPostRequest, string zapTraceSpan = null)
{
// verify the required parameter 'legacyAuthorizationPostRequest' is set
if (legacyAuthorizationPostRequest == null)
{
throw new ApiException(400,
"Missing required parameter 'legacyAuthorizationPostRequest' when calling LegacyAuthorizationsService->PostLegacyAuthorizations");
}
var localVarPath = "/private/legacy/authorizations";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (legacyAuthorizationPostRequest != null && legacyAuthorizationPostRequest.GetType() != typeof(byte[]))
{
localVarPostBody =
Configuration.ApiClient.Serialize(legacyAuthorizationPostRequest); // http body (model) parameter
}
else
{
localVarPostBody = legacyAuthorizationPostRequest; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
return Configuration.ApiClient.PrepareRequest(localVarPath,
Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
}
///
/// Create a legacy authorization
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Authorization
public async System.Threading.Tasks.Task PostLegacyAuthorizationsAsync(
LegacyAuthorizationPostRequest legacyAuthorizationPostRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
var localVarResponse =
await PostLegacyAuthorizationsAsyncWithHttpInfo(legacyAuthorizationPostRequest, zapTraceSpan,
cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Create a legacy authorization
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Authorization)
public async System.Threading.Tasks.Task> PostLegacyAuthorizationsAsyncWithHttpInfo(
LegacyAuthorizationPostRequest legacyAuthorizationPostRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await PostLegacyAuthorizationsAsyncWithIRestResponse(legacyAuthorizationPostRequest, zapTraceSpan,
cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostLegacyAuthorizations", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Authorization)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Authorization)));
}
///
/// Create a legacy authorization
///
/// Thrown when fails to make API call
/// Legacy authorization to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (Authorization)
public async System.Threading.Tasks.Task PostLegacyAuthorizationsAsyncWithIRestResponse(
LegacyAuthorizationPostRequest legacyAuthorizationPostRequest, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// verify the required parameter 'legacyAuthorizationPostRequest' is set
if (legacyAuthorizationPostRequest == null)
{
throw new ApiException(400,
"Missing required parameter 'legacyAuthorizationPostRequest' when calling LegacyAuthorizationsService->PostLegacyAuthorizations");
}
var localVarPath = "/private/legacy/authorizations";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (legacyAuthorizationPostRequest != null && legacyAuthorizationPostRequest.GetType() != typeof(byte[]))
{
localVarPostBody =
Configuration.ApiClient.Serialize(legacyAuthorizationPostRequest); // http body (model) parameter
}
else
{
localVarPostBody = legacyAuthorizationPostRequest; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostLegacyAuthorizations", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Set a legacy authorization password
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
///
public void PostLegacyAuthorizationsIDPassword(string authID, PasswordResetBody passwordResetBody,
string zapTraceSpan = null)
{
PostLegacyAuthorizationsIDPasswordWithHttpInfo(authID, passwordResetBody, zapTraceSpan);
}
///
/// Set a legacy authorization password
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public ApiResponse PostLegacyAuthorizationsIDPasswordWithHttpInfo(string authID,
PasswordResetBody passwordResetBody, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->PostLegacyAuthorizationsIDPassword");
}
// verify the required parameter 'passwordResetBody' is set
if (passwordResetBody == null)
{
throw new ApiException(400,
"Missing required parameter 'passwordResetBody' when calling LegacyAuthorizationsService->PostLegacyAuthorizationsIDPassword");
}
var localVarPath = "/private/legacy/authorizations/{authID}/password";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (passwordResetBody != null && passwordResetBody.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(passwordResetBody); // http body (model) parameter
}
else
{
localVarPostBody = passwordResetBody; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostLegacyAuthorizationsIDPassword", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Set a legacy authorization password
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Object(void)
public async System.Threading.Tasks.Task PostLegacyAuthorizationsIDPasswordWithIRestResponseAsync(
string authID, PasswordResetBody passwordResetBody, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->PostLegacyAuthorizationsIDPassword");
}
// verify the required parameter 'passwordResetBody' is set
if (passwordResetBody == null)
{
throw new ApiException(400,
"Missing required parameter 'passwordResetBody' when calling LegacyAuthorizationsService->PostLegacyAuthorizationsIDPassword");
}
var localVarPath = "/private/legacy/authorizations/{authID}/password";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (passwordResetBody != null && passwordResetBody.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(passwordResetBody); // http body (model) parameter
}
else
{
localVarPostBody = passwordResetBody; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostLegacyAuthorizationsIDPassword", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Set a legacy authorization password
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public RestResponse PostLegacyAuthorizationsIDPasswordWithIRestResponse(string authID,
PasswordResetBody passwordResetBody, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->PostLegacyAuthorizationsIDPassword");
}
// verify the required parameter 'passwordResetBody' is set
if (passwordResetBody == null)
{
throw new ApiException(400,
"Missing required parameter 'passwordResetBody' when calling LegacyAuthorizationsService->PostLegacyAuthorizationsIDPassword");
}
var localVarPath = "/private/legacy/authorizations/{authID}/password";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (passwordResetBody != null && passwordResetBody.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(passwordResetBody); // http body (model) parameter
}
else
{
localVarPostBody = passwordResetBody; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath,
Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostLegacyAuthorizationsIDPassword", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Set a legacy authorization password
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public RestRequest PostLegacyAuthorizationsIDPasswordWithRestRequest(string authID,
PasswordResetBody passwordResetBody, string zapTraceSpan = null)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->PostLegacyAuthorizationsIDPassword");
}
// verify the required parameter 'passwordResetBody' is set
if (passwordResetBody == null)
{
throw new ApiException(400,
"Missing required parameter 'passwordResetBody' when calling LegacyAuthorizationsService->PostLegacyAuthorizationsIDPassword");
}
var localVarPath = "/private/legacy/authorizations/{authID}/password";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (passwordResetBody != null && passwordResetBody.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(passwordResetBody); // http body (model) parameter
}
else
{
localVarPostBody = passwordResetBody; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
return Configuration.ApiClient.PrepareRequest(localVarPath,
Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
}
///
/// Set a legacy authorization password
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of void
public System.Threading.Tasks.Task PostLegacyAuthorizationsIDPasswordAsync(string authID,
PasswordResetBody passwordResetBody, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
return PostLegacyAuthorizationsIDPasswordAsyncWithHttpInfo(authID, passwordResetBody, zapTraceSpan,
cancellationToken);
}
///
/// Set a legacy authorization password
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse
public async System.Threading.Tasks.Task>
PostLegacyAuthorizationsIDPasswordAsyncWithHttpInfo(string authID, PasswordResetBody passwordResetBody,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await PostLegacyAuthorizationsIDPasswordAsyncWithIRestResponse(authID, passwordResetBody, zapTraceSpan,
cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostLegacyAuthorizationsIDPassword", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Set a legacy authorization password
///
/// Thrown when fails to make API call
/// The ID of the legacy authorization to update.
/// New password
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse
public async System.Threading.Tasks.Task PostLegacyAuthorizationsIDPasswordAsyncWithIRestResponse(
string authID, PasswordResetBody passwordResetBody, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// verify the required parameter 'authID' is set
if (authID == null)
{
throw new ApiException(400,
"Missing required parameter 'authID' when calling LegacyAuthorizationsService->PostLegacyAuthorizationsIDPassword");
}
// verify the required parameter 'passwordResetBody' is set
if (passwordResetBody == null)
{
throw new ApiException(400,
"Missing required parameter 'passwordResetBody' when calling LegacyAuthorizationsService->PostLegacyAuthorizationsIDPassword");
}
var localVarPath = "/private/legacy/authorizations/{authID}/password";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary();
object localVarPostBody = null;
// to determine the Content-Type header
var localVarHttpContentTypes = new string[]
{
"application/json"
};
var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
if (authID != null)
{
localVarPathParams.Add("authID", Configuration.ApiClient.ParameterToString(authID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (passwordResetBody != null && passwordResetBody.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(passwordResetBody); // http body (model) parameter
}
else
{
localVarPostBody = passwordResetBody; // byte array
}
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
"application/json"
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
// make the HTTP request
var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostLegacyAuthorizationsIDPassword", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
}
}