/*
* 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 IUsersService : IApiAccessor
{
#region Synchronous Operations
///
/// Delete a user
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
///
void DeleteUsersID(string userID, string zapTraceSpan = null);
///
/// Delete a user
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
ApiResponse DeleteUsersIDWithHttpInfo(string userID, string zapTraceSpan = null);
///
/// Return the feature flags for the currently authenticated user
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Dictionary<string, Object>
Dictionary GetFlags(string zapTraceSpan = null);
///
/// Return the feature flags for the currently authenticated user
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// ApiResponse of Dictionary<string, Object>
ApiResponse> GetFlagsWithHttpInfo(string zapTraceSpan = null);
///
/// Retrieve the currently authenticated user
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// User
User GetMe(string zapTraceSpan = null);
///
/// Retrieve the currently authenticated user
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// ApiResponse of User
ApiResponse GetMeWithHttpInfo(string zapTraceSpan = null);
///
/// List all users
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// Users
Users GetUsers(string zapTraceSpan = null, int? offset = null, int? limit = null, string after = null,
string name = null, string id = null);
///
/// List all users
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// ApiResponse of Users
ApiResponse GetUsersWithHttpInfo(string zapTraceSpan = null, int? offset = null, int? limit = null,
string after = null, string name = null, string id = null);
///
/// Retrieve a user
///
///
///
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// User
User GetUsersID(string userID, string zapTraceSpan = null);
///
/// Retrieve a user
///
///
///
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// ApiResponse of User
ApiResponse GetUsersIDWithHttpInfo(string userID, string zapTraceSpan = null);
///
/// Update a user
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// User
User PatchUsersID(string userID, PostUser postUser, string zapTraceSpan = null);
///
/// Update a user
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// ApiResponse of User
ApiResponse PatchUsersIDWithHttpInfo(string userID, PostUser postUser, string zapTraceSpan = null);
///
/// Create a user
///
///
///
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// User
User PostUsers(PostUser postUser, string zapTraceSpan = null);
///
/// Create a user
///
///
///
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// ApiResponse of User
ApiResponse PostUsersWithHttpInfo(PostUser postUser, string zapTraceSpan = null);
///
/// Update a password
///
///
///
///
/// Thrown when fails to make API call
/// The user ID.
/// New password
/// OpenTracing span context (optional)
/// An auth credential for the Basic scheme (optional)
///
void PostUsersIDPassword(string userID, PasswordResetBody passwordResetBody, string zapTraceSpan = null,
string authorization = null);
///
/// Update a password
///
///
///
///
/// Thrown when fails to make API call
/// The user ID.
/// New password
/// OpenTracing span context (optional)
/// An auth credential for the Basic scheme (optional)
/// ApiResponse of Object(void)
ApiResponse PostUsersIDPasswordWithHttpInfo(string userID, PasswordResetBody passwordResetBody,
string zapTraceSpan = null, string authorization = null);
///
/// Update a password
///
///
///
///
/// Thrown when fails to make API call
/// New password
/// OpenTracing span context (optional)
/// An auth credential for the Basic scheme (optional)
///
void PutMePassword(PasswordResetBody passwordResetBody, string zapTraceSpan = null,
string authorization = null);
///
/// Update a password
///
///
///
///
/// Thrown when fails to make API call
/// New password
/// OpenTracing span context (optional)
/// An auth credential for the Basic scheme (optional)
/// ApiResponse of Object(void)
ApiResponse PutMePasswordWithHttpInfo(PasswordResetBody passwordResetBody, string zapTraceSpan = null,
string authorization = null);
#endregion Synchronous Operations
#region Asynchronous Operations
///
/// Delete a user
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of void
System.Threading.Tasks.Task DeleteUsersIDAsync(string userID, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Delete a user
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse
System.Threading.Tasks.Task> DeleteUsersIDAsyncWithHttpInfo(string userID,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Return the feature flags for the currently authenticated user
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Dictionary<string, Object>
System.Threading.Tasks.Task> GetFlagsAsync(string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Return the feature flags for the currently authenticated user
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Dictionary<string, Object>)
System.Threading.Tasks.Task>> GetFlagsAsyncWithHttpInfo(
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Retrieve the currently authenticated user
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of User
System.Threading.Tasks.Task GetMeAsync(string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Retrieve the currently authenticated user
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (User)
System.Threading.Tasks.Task> GetMeAsyncWithHttpInfo(string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// List all users
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// Cancellation token
/// Task of Users
System.Threading.Tasks.Task GetUsersAsync(string zapTraceSpan = null, int? offset = null,
int? limit = null, string after = null, string name = null, string id = null,
CancellationToken cancellationToken = default);
///
/// List all users
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// Cancellation token
/// Task of ApiResponse (Users)
System.Threading.Tasks.Task> GetUsersAsyncWithHttpInfo(string zapTraceSpan = null,
int? offset = null, int? limit = null, string after = null, string name = null, string id = null,
CancellationToken cancellationToken = default);
///
/// Retrieve a user
///
///
///
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of User
System.Threading.Tasks.Task GetUsersIDAsync(string userID, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Retrieve a user
///
///
///
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (User)
System.Threading.Tasks.Task> GetUsersIDAsyncWithHttpInfo(string userID,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Update a user
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of User
System.Threading.Tasks.Task PatchUsersIDAsync(string userID, PostUser postUser,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Update a user
///
///
///
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (User)
System.Threading.Tasks.Task> PatchUsersIDAsyncWithHttpInfo(string userID, PostUser postUser,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Create a user
///
///
///
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of User
System.Threading.Tasks.Task PostUsersAsync(PostUser postUser, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Create a user
///
///
///
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (User)
System.Threading.Tasks.Task> PostUsersAsyncWithHttpInfo(PostUser postUser,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Update a password
///
///
///
///
/// Thrown when fails to make API call
/// The user ID.
/// New password
/// OpenTracing span context (optional)
/// An auth credential for the Basic scheme (optional)
/// Cancellation token
/// Task of void
System.Threading.Tasks.Task PostUsersIDPasswordAsync(string userID, PasswordResetBody passwordResetBody,
string zapTraceSpan = null, string authorization = null, CancellationToken cancellationToken = default);
///
/// Update a password
///
///
///
///
/// Thrown when fails to make API call
/// The user ID.
/// New password
/// OpenTracing span context (optional)
/// An auth credential for the Basic scheme (optional)
/// Cancellation token
/// Task of ApiResponse
System.Threading.Tasks.Task> PostUsersIDPasswordAsyncWithHttpInfo(string userID,
PasswordResetBody passwordResetBody, string zapTraceSpan = null, string authorization = null,
CancellationToken cancellationToken = default);
///
/// Update a password
///
///
///
///
/// Thrown when fails to make API call
/// New password
/// OpenTracing span context (optional)
/// An auth credential for the Basic scheme (optional)
/// Cancellation token
/// Task of void
System.Threading.Tasks.Task PutMePasswordAsync(PasswordResetBody passwordResetBody, string zapTraceSpan = null,
string authorization = null, CancellationToken cancellationToken = default);
///
/// Update a password
///
///
///
///
/// Thrown when fails to make API call
/// New password
/// OpenTracing span context (optional)
/// An auth credential for the Basic scheme (optional)
/// Cancellation token
/// Task of ApiResponse
System.Threading.Tasks.Task> PutMePasswordAsyncWithHttpInfo(
PasswordResetBody passwordResetBody, string zapTraceSpan = null, string authorization = null,
CancellationToken cancellationToken = default);
#endregion Asynchronous Operations
}
///
/// Represents a collection of functions to interact with the API endpoints
///
public partial class UsersService : IUsersService
{
private ExceptionFactory _exceptionFactory = (name, response) => null;
///
/// Initializes a new instance of the class.
///
///
public UsersService(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 UsersService(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 user
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
///
public void DeleteUsersID(string userID, string zapTraceSpan = null)
{
DeleteUsersIDWithHttpInfo(userID, zapTraceSpan);
}
///
/// Delete a user
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public ApiResponse DeleteUsersIDWithHttpInfo(string userID, string zapTraceSpan = null)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->DeleteUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // 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("DeleteUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Delete a user
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Object(void)
public async System.Threading.Tasks.Task DeleteUsersIDWithIRestResponseAsync(string userID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->DeleteUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // 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("DeleteUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Delete a user
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public RestResponse DeleteUsersIDWithIRestResponse(string userID, string zapTraceSpan = null)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->DeleteUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // 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("DeleteUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Delete a user
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public RestRequest DeleteUsersIDWithRestRequest(string userID, string zapTraceSpan = null)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->DeleteUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // 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 user
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of void
public System.Threading.Tasks.Task DeleteUsersIDAsync(string userID, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
return DeleteUsersIDAsyncWithHttpInfo(userID, zapTraceSpan, cancellationToken);
}
///
/// Delete a user
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse
public async System.Threading.Tasks.Task> DeleteUsersIDAsyncWithHttpInfo(string userID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse = await DeleteUsersIDAsyncWithIRestResponse(userID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("DeleteUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Delete a user
///
/// Thrown when fails to make API call
/// The ID of the user to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse
public async System.Threading.Tasks.Task DeleteUsersIDAsyncWithIRestResponse(string userID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->DeleteUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // 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("DeleteUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Return the feature flags for the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Dictionary<string, Object>
public Dictionary GetFlags(string zapTraceSpan = null)
{
var localVarResponse = GetFlagsWithHttpInfo(zapTraceSpan);
return localVarResponse.Data;
}
///
/// Return the feature flags for the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// ApiResponse of Dictionary<string, Object>
public ApiResponse> GetFlagsWithHttpInfo(string zapTraceSpan = null)
{
var localVarPath = "/api/v2/flags";
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 (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("GetFlags", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse>(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Dictionary)Configuration.ApiClient.Deserialize(localVarResponse,
typeof(Dictionary)));
}
///
/// Return the feature flags for the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Dictionary<string, Object>
public async System.Threading.Tasks.Task GetFlagsWithIRestResponseAsync(
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
var localVarPath = "/api/v2/flags";
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 (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("GetFlags", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Return the feature flags for the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// ApiResponse of Dictionary<string, Object>
public RestResponse GetFlagsWithIRestResponse(string zapTraceSpan = null)
{
var localVarPath = "/api/v2/flags";
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 (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("GetFlags", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Return the feature flags for the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// ApiResponse of Dictionary<string, Object>
public RestRequest GetFlagsWithRestRequest(string zapTraceSpan = null)
{
var localVarPath = "/api/v2/flags";
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 (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);
}
///
/// Return the feature flags for the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Dictionary<string, Object>
public async System.Threading.Tasks.Task> GetFlagsAsync(string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
var localVarResponse =
await GetFlagsAsyncWithHttpInfo(zapTraceSpan, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Return the feature flags for the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Dictionary<string, Object>)
public async System.Threading.Tasks.Task>> GetFlagsAsyncWithHttpInfo(
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await GetFlagsAsyncWithIRestResponse(zapTraceSpan, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetFlags", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse>(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Dictionary)Configuration.ApiClient.Deserialize(localVarResponse,
typeof(Dictionary)));
}
///
/// Return the feature flags for the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (Dictionary<string, Object>)
public async System.Threading.Tasks.Task GetFlagsAsyncWithIRestResponse(
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
var localVarPath = "/api/v2/flags";
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 (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("GetFlags", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// User
public User GetMe(string zapTraceSpan = null)
{
var localVarResponse = GetMeWithHttpInfo(zapTraceSpan);
return localVarResponse.Data;
}
///
/// Retrieve the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// ApiResponse of User
public ApiResponse GetMeWithHttpInfo(string zapTraceSpan = null)
{
var localVarPath = "/api/v2/me";
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 (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("GetMe", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(User)Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
///
/// Retrieve the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of User
public async System.Threading.Tasks.Task GetMeWithIRestResponseAsync(string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
var localVarPath = "/api/v2/me";
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 (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("GetMe", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// ApiResponse of User
public RestResponse GetMeWithIRestResponse(string zapTraceSpan = null)
{
var localVarPath = "/api/v2/me";
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 (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("GetMe", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// ApiResponse of User
public RestRequest GetMeWithRestRequest(string zapTraceSpan = null)
{
var localVarPath = "/api/v2/me";
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 (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 the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of User
public async System.Threading.Tasks.Task GetMeAsync(string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
var localVarResponse = await GetMeAsyncWithHttpInfo(zapTraceSpan, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Retrieve the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (User)
public async System.Threading.Tasks.Task> GetMeAsyncWithHttpInfo(string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await GetMeAsyncWithIRestResponse(zapTraceSpan, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetMe", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(User)Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
///
/// Retrieve the currently authenticated user
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (User)
public async System.Threading.Tasks.Task GetMeAsyncWithIRestResponse(string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
var localVarPath = "/api/v2/me";
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 (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("GetMe", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all users
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// Users
public Users GetUsers(string zapTraceSpan = null, int? offset = null, int? limit = null, string after = null,
string name = null, string id = null)
{
var localVarResponse = GetUsersWithHttpInfo(zapTraceSpan, offset, limit, after, name, id);
return localVarResponse.Data;
}
///
/// List all users
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// ApiResponse of Users
public ApiResponse GetUsersWithHttpInfo(string zapTraceSpan = null, int? offset = null,
int? limit = null, string after = null, string name = null, string id = null)
{
var localVarPath = "/api/v2/users";
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 (offset != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter
}
if (limit != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter
}
if (after != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "after", after)); // query parameter
}
if (name != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "name", name)); // query parameter
}
if (id != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "id", id)); // 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("GetUsers", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Users)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Users)));
}
///
/// List all users
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// Cancellation token
/// ApiResponse of Users
public async System.Threading.Tasks.Task GetUsersWithIRestResponseAsync(
string zapTraceSpan = null, int? offset = null, int? limit = null, string after = null, string name = null,
string id = null, CancellationToken cancellationToken = default)
{
var localVarPath = "/api/v2/users";
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 (offset != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter
}
if (limit != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter
}
if (after != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "after", after)); // query parameter
}
if (name != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "name", name)); // query parameter
}
if (id != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "id", id)); // 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("GetUsers", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all users
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// ApiResponse of Users
public RestResponse GetUsersWithIRestResponse(string zapTraceSpan = null, int? offset = null, int? limit = null,
string after = null, string name = null, string id = null)
{
var localVarPath = "/api/v2/users";
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 (offset != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter
}
if (limit != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter
}
if (after != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "after", after)); // query parameter
}
if (name != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "name", name)); // query parameter
}
if (id != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "id", id)); // 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("GetUsers", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all users
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// ApiResponse of Users
public RestRequest GetUsersWithRestRequest(string zapTraceSpan = null, int? offset = null, int? limit = null,
string after = null, string name = null, string id = null)
{
var localVarPath = "/api/v2/users";
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 (offset != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter
}
if (limit != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter
}
if (after != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "after", after)); // query parameter
}
if (name != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "name", name)); // query parameter
}
if (id != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "id", id)); // 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 users
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// Cancellation token
/// Task of Users
public async System.Threading.Tasks.Task GetUsersAsync(string zapTraceSpan = null, int? offset = null,
int? limit = null, string after = null, string name = null, string id = null,
CancellationToken cancellationToken = default)
{
var localVarResponse =
await GetUsersAsyncWithHttpInfo(zapTraceSpan, offset, limit, after, name, id, cancellationToken)
.ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// List all users
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// Cancellation token
/// Task of ApiResponse (Users)
public async System.Threading.Tasks.Task> GetUsersAsyncWithHttpInfo(
string zapTraceSpan = null, int? offset = null, int? limit = null, string after = null, string name = null,
string id = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await GetUsersAsyncWithIRestResponse(zapTraceSpan, offset, limit, after, name, id, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetUsers", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Users)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Users)));
}
///
/// List all users
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// (optional)
/// (optional, default to 20)
/// Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. (optional)
/// (optional)
/// (optional)
/// Cancellation token
/// Task of RestResponse (Users)
public async System.Threading.Tasks.Task GetUsersAsyncWithIRestResponse(
string zapTraceSpan = null, int? offset = null, int? limit = null, string after = null, string name = null,
string id = null, CancellationToken cancellationToken = default)
{
var localVarPath = "/api/v2/users";
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 (offset != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter
}
if (limit != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter
}
if (after != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "after", after)); // query parameter
}
if (name != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "name", name)); // query parameter
}
if (id != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "id", id)); // 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("GetUsers", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve a user
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// User
public User GetUsersID(string userID, string zapTraceSpan = null)
{
var localVarResponse = GetUsersIDWithHttpInfo(userID, zapTraceSpan);
return localVarResponse.Data;
}
///
/// Retrieve a user
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// ApiResponse of User
public ApiResponse GetUsersIDWithHttpInfo(string userID, string zapTraceSpan = null)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->GetUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // 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("GetUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(User)Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
///
/// Retrieve a user
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of User
public async System.Threading.Tasks.Task GetUsersIDWithIRestResponseAsync(string userID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->GetUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // 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("GetUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve a user
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// ApiResponse of User
public RestResponse GetUsersIDWithIRestResponse(string userID, string zapTraceSpan = null)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->GetUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // 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("GetUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve a user
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// ApiResponse of User
public RestRequest GetUsersIDWithRestRequest(string userID, string zapTraceSpan = null)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->GetUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // 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 user
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of User
public async System.Threading.Tasks.Task GetUsersIDAsync(string userID, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
var localVarResponse = await GetUsersIDAsyncWithHttpInfo(userID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Retrieve a user
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (User)
public async System.Threading.Tasks.Task> GetUsersIDAsyncWithHttpInfo(string userID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse = await GetUsersIDAsyncWithIRestResponse(userID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(User)Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
///
/// Retrieve a user
///
/// Thrown when fails to make API call
/// The user ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (User)
public async System.Threading.Tasks.Task GetUsersIDAsyncWithIRestResponse(string userID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->GetUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // 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("GetUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Update a user
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// User
public User PatchUsersID(string userID, PostUser postUser, string zapTraceSpan = null)
{
var localVarResponse = PatchUsersIDWithHttpInfo(userID, postUser, zapTraceSpan);
return localVarResponse.Data;
}
///
/// Update a user
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// ApiResponse of User
public ApiResponse PatchUsersIDWithHttpInfo(string userID, PostUser postUser, string zapTraceSpan = null)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->PatchUsersID");
}
// verify the required parameter 'postUser' is set
if (postUser == null)
{
throw new ApiException(400,
"Missing required parameter 'postUser' when calling UsersService->PatchUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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 (userID != null)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (postUser != null && postUser.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(postUser); // http body (model) parameter
}
else
{
localVarPostBody = postUser; // 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("PatchUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(User)Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
///
/// Update a user
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of User
public async System.Threading.Tasks.Task PatchUsersIDWithIRestResponseAsync(string userID,
PostUser postUser, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->PatchUsersID");
}
// verify the required parameter 'postUser' is set
if (postUser == null)
{
throw new ApiException(400,
"Missing required parameter 'postUser' when calling UsersService->PatchUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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 (userID != null)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (postUser != null && postUser.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(postUser); // http body (model) parameter
}
else
{
localVarPostBody = postUser; // 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("PatchUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Update a user
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// ApiResponse of User
public RestResponse PatchUsersIDWithIRestResponse(string userID, PostUser postUser, string zapTraceSpan = null)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->PatchUsersID");
}
// verify the required parameter 'postUser' is set
if (postUser == null)
{
throw new ApiException(400,
"Missing required parameter 'postUser' when calling UsersService->PatchUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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 (userID != null)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (postUser != null && postUser.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(postUser); // http body (model) parameter
}
else
{
localVarPostBody = postUser; // 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("PatchUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Update a user
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// ApiResponse of User
public RestRequest PatchUsersIDWithRestRequest(string userID, PostUser postUser, string zapTraceSpan = null)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->PatchUsersID");
}
// verify the required parameter 'postUser' is set
if (postUser == null)
{
throw new ApiException(400,
"Missing required parameter 'postUser' when calling UsersService->PatchUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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 (userID != null)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (postUser != null && postUser.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(postUser); // http body (model) parameter
}
else
{
localVarPostBody = postUser; // 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 user
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of User
public async System.Threading.Tasks.Task PatchUsersIDAsync(string userID, PostUser postUser,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
var localVarResponse =
await PatchUsersIDAsyncWithHttpInfo(userID, postUser, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Update a user
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (User)
public async System.Threading.Tasks.Task> PatchUsersIDAsyncWithHttpInfo(string userID,
PostUser postUser, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await PatchUsersIDAsyncWithIRestResponse(userID, postUser, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PatchUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(User)Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
///
/// Update a user
///
/// Thrown when fails to make API call
/// The ID of the user to update.
/// User update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (User)
public async System.Threading.Tasks.Task PatchUsersIDAsyncWithIRestResponse(string userID,
PostUser postUser, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'userID' is set
if (userID == null)
{
throw new ApiException(400,
"Missing required parameter 'userID' when calling UsersService->PatchUsersID");
}
// verify the required parameter 'postUser' is set
if (postUser == null)
{
throw new ApiException(400,
"Missing required parameter 'postUser' when calling UsersService->PatchUsersID");
}
var localVarPath = "/api/v2/users/{userID}";
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 (userID != null)
{
localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (postUser != null && postUser.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(postUser); // http body (model) parameter
}
else
{
localVarPostBody = postUser; // 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("PatchUsersID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Create a user
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// User
public User PostUsers(PostUser postUser, string zapTraceSpan = null)
{
var localVarResponse = PostUsersWithHttpInfo(postUser, zapTraceSpan);
return localVarResponse.Data;
}
///
/// Create a user
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// ApiResponse of User
public ApiResponse PostUsersWithHttpInfo(PostUser postUser, string zapTraceSpan = null)
{
// verify the required parameter 'postUser' is set
if (postUser == null)
{
throw new ApiException(400,
"Missing required parameter 'postUser' when calling UsersService->PostUsers");
}
var localVarPath = "/api/v2/users";
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 (postUser != null && postUser.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(postUser); // http body (model) parameter
}
else
{
localVarPostBody = postUser; // 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("PostUsers", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(User)Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
///
/// Create a user
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of User
public async System.Threading.Tasks.Task PostUsersWithIRestResponseAsync(PostUser postUser,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'postUser' is set
if (postUser == null)
{
throw new ApiException(400,
"Missing required parameter 'postUser' when calling UsersService->PostUsers");
}
var localVarPath = "/api/v2/users";
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 (postUser != null && postUser.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(postUser); // http body (model) parameter
}
else
{
localVarPostBody = postUser; // 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("PostUsers", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Create a user
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// ApiResponse of User
public RestResponse PostUsersWithIRestResponse(PostUser postUser, string zapTraceSpan = null)
{
// verify the required parameter 'postUser' is set
if (postUser == null)
{
throw new ApiException(400,
"Missing required parameter 'postUser' when calling UsersService->PostUsers");
}
var localVarPath = "/api/v2/users";
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 (postUser != null && postUser.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(postUser); // http body (model) parameter
}
else
{
localVarPostBody = postUser; // 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("PostUsers", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Create a user
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// ApiResponse of User
public RestRequest PostUsersWithRestRequest(PostUser postUser, string zapTraceSpan = null)
{
// verify the required parameter 'postUser' is set
if (postUser == null)
{
throw new ApiException(400,
"Missing required parameter 'postUser' when calling UsersService->PostUsers");
}
var localVarPath = "/api/v2/users";
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 (postUser != null && postUser.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(postUser); // http body (model) parameter
}
else
{
localVarPostBody = postUser; // 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 user
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of User
public async System.Threading.Tasks.Task PostUsersAsync(PostUser postUser, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
var localVarResponse = await PostUsersAsyncWithHttpInfo(postUser, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Create a user
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (User)
public async System.Threading.Tasks.Task> PostUsersAsyncWithHttpInfo(PostUser postUser,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse = await PostUsersAsyncWithIRestResponse(postUser, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostUsers", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(User)Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
///
/// Create a user
///
/// Thrown when fails to make API call
/// User to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (User)
public async System.Threading.Tasks.Task PostUsersAsyncWithIRestResponse(PostUser postUser,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'postUser' is set
if (postUser == null)
{
throw new ApiException(400,
"Missing required parameter 'postUser' when calling UsersService->PostUsers");
}
var localVarPath = "/api/v2/users";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary