You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Digitalisation_EPA_Serveur/EPAServeur/ApiCollaborateur/BusinessUnitApi.cs

1040 lines
49 KiB

/*
* Service Collaborateur API
*
* Api du service Collaborateur, utilisée pour récupérer les données des collaborateurs d'Apside
*
* OpenAPI spec version: 1.1.3
* Contact: lilian.gayet@apside-groupe.com
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using RestSharp;
using IO.Swagger.ClientCollaborateur;
using IO.Swagger.ModelCollaborateur;
namespace IO.Swagger.ApiCollaborateur
{
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IBusinessUnitApi : IApiAccessor
{
#region Synchronous Operations
/// <summary>
/// ajout d&#x27;une nouvelle business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="body"> (optional)</param>
/// <returns></returns>
void AjoutBU (NouvelleBU body = null);
/// <summary>
/// ajout d&#x27;une nouvelle business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="body"> (optional)</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> AjoutBUWithHttpInfo (NouvelleBU body = null);
/// <summary>
/// rechercher une business-unit
/// </summary>
/// <remarks>
/// rechercher une business-unit à l&#x27;aide de son identifiant
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <returns>BU</returns>
BU ChercherBU (long? buId);
/// <summary>
/// rechercher une business-unit
/// </summary>
/// <remarks>
/// rechercher une business-unit à l&#x27;aide de son identifiant
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <returns>ApiResponse of BU</returns>
ApiResponse<BU> ChercherBUWithHttpInfo (long? buId);
/// <summary>
/// rechercher toutes les business-units
/// </summary>
/// <remarks>
/// Cette requette demande de récupérer toutes les business-units existantes
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <returns>List&lt;BU&gt;</returns>
List<BU> ChercherBUs ();
/// <summary>
/// rechercher toutes les business-units
/// </summary>
/// <remarks>
/// Cette requette demande de récupérer toutes les business-units existantes
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of List&lt;BU&gt;</returns>
ApiResponse<List<BU>> ChercherBUsWithHttpInfo ();
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns></returns>
void MajBU (long? buId, NouvelleBU body = null);
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> MajBUWithHttpInfo (long? buId, NouvelleBU body = null);
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns></returns>
void MajBUpatch (long? buId, NouvelleBU body = null);
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> MajBUpatchWithHttpInfo (long? buId, NouvelleBU body = null);
#endregion Synchronous Operations
#region Asynchronous Operations
/// <summary>
/// ajout d&#x27;une nouvelle business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="body"> (optional)</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task AjoutBUAsync (NouvelleBU body = null);
/// <summary>
/// ajout d&#x27;une nouvelle business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="body"> (optional)</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> AjoutBUAsyncWithHttpInfo (NouvelleBU body = null);
/// <summary>
/// rechercher une business-unit
/// </summary>
/// <remarks>
/// rechercher une business-unit à l&#x27;aide de son identifiant
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <returns>Task of BU</returns>
System.Threading.Tasks.Task<BU> ChercherBUAsync (long? buId);
/// <summary>
/// rechercher une business-unit
/// </summary>
/// <remarks>
/// rechercher une business-unit à l&#x27;aide de son identifiant
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <returns>Task of ApiResponse (BU)</returns>
System.Threading.Tasks.Task<ApiResponse<BU>> ChercherBUAsyncWithHttpInfo (long? buId);
/// <summary>
/// rechercher toutes les business-units
/// </summary>
/// <remarks>
/// Cette requette demande de récupérer toutes les business-units existantes
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <returns>Task of List&lt;BU&gt;</returns>
System.Threading.Tasks.Task<List<BU>> ChercherBUsAsync ();
/// <summary>
/// rechercher toutes les business-units
/// </summary>
/// <remarks>
/// Cette requette demande de récupérer toutes les business-units existantes
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <returns>Task of ApiResponse (List&lt;BU&gt;)</returns>
System.Threading.Tasks.Task<ApiResponse<List<BU>>> ChercherBUsAsyncWithHttpInfo ();
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task MajBUAsync (long? buId, NouvelleBU body = null);
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> MajBUAsyncWithHttpInfo (long? buId, NouvelleBU body = null);
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task MajBUpatchAsync (long? buId, NouvelleBU body = null);
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> MajBUpatchAsyncWithHttpInfo (long? buId, NouvelleBU body = null);
#endregion Asynchronous Operations
}
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public partial class BusinessUnitApi : IBusinessUnitApi
{
private IO.Swagger.ClientCollaborateur.ExceptionFactory _exceptionFactory = (name, response) => null;
/// <summary>
/// Initializes a new instance of the <see cref="BusinessUnitApi"/> class.
/// </summary>
/// <returns></returns>
public BusinessUnitApi(String basePath)
{
this.Configuration = new IO.Swagger.ClientCollaborateur.Configuration { BasePath = basePath };
ExceptionFactory = IO.Swagger.ClientCollaborateur.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// Initializes a new instance of the <see cref="BusinessUnitApi"/> class
/// </summary>
/// <returns></returns>
public BusinessUnitApi()
{
this.Configuration = IO.Swagger.ClientCollaborateur.Configuration.Default;
ExceptionFactory = IO.Swagger.ClientCollaborateur.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// Initializes a new instance of the <see cref="BusinessUnitApi"/> class
/// using Configuration object
/// </summary>
/// <param name="configuration">An instance of Configuration</param>
/// <returns></returns>
public BusinessUnitApi(IO.Swagger.ClientCollaborateur.Configuration configuration = null)
{
if (configuration == null) // use the default one in Configuration
this.Configuration = IO.Swagger.ClientCollaborateur.Configuration.Default;
else
this.Configuration = configuration;
ExceptionFactory = IO.Swagger.ClientCollaborateur.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// Gets the base path of the API client.
/// </summary>
/// <value>The base path</value>
public String GetBasePath()
{
return this.Configuration.ApiClient.RestClient.BaseUrl.ToString();
}
/// <summary>
/// Sets the base path of the API client.
/// </summary>
/// <value>The base path</value>
[Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
public void SetBasePath(String basePath)
{
// do nothing
}
/// <summary>
/// Gets or sets the configuration object
/// </summary>
/// <value>An instance of the Configuration</value>
public IO.Swagger.ClientCollaborateur.Configuration Configuration {get; set;}
/// <summary>
/// Provides a factory method hook for the creation of exceptions.
/// </summary>
public IO.Swagger.ClientCollaborateur.ExceptionFactory ExceptionFactory
{
get
{
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
{
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
}
return _exceptionFactory;
}
set { _exceptionFactory = value; }
}
/// <summary>
/// Gets the default header.
/// </summary>
/// <returns>Dictionary of HTTP header</returns>
[Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")]
public IDictionary<String, String> DefaultHeader()
{
return new ReadOnlyDictionary<string, string>(this.Configuration.DefaultHeader);
}
/// <summary>
/// Add default header.
/// </summary>
/// <param name="key">Header field name.</param>
/// <param name="value">Header field value.</param>
/// <returns></returns>
[Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")]
public void AddDefaultHeader(string key, string value)
{
this.Configuration.AddDefaultHeader(key, value);
}
/// <summary>
/// ajout d&#x27;une nouvelle business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="body"> (optional)</param>
/// <returns></returns>
public void AjoutBU (NouvelleBU body = null)
{
AjoutBUWithHttpInfo(body);
}
/// <summary>
/// ajout d&#x27;une nouvelle business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="body"> (optional)</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> AjoutBUWithHttpInfo (NouvelleBU body = null)
{
var localVarPath = "/bus";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json"
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("AjoutBU", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
null);
}
/// <summary>
/// ajout d&#x27;une nouvelle business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="body"> (optional)</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task AjoutBUAsync (NouvelleBU body = null)
{
await AjoutBUAsyncWithHttpInfo(body);
}
/// <summary>
/// ajout d&#x27;une nouvelle business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="body"> (optional)</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> AjoutBUAsyncWithHttpInfo (NouvelleBU body = null)
{
var localVarPath = "/bus";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json"
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath,
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("AjoutBU", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
null);
}
/// <summary>
/// rechercher une business-unit rechercher une business-unit à l&#x27;aide de son identifiant
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <returns>BU</returns>
public BU ChercherBU (long? buId)
{
ApiResponse<BU> localVarResponse = ChercherBUWithHttpInfo(buId);
return localVarResponse.Data;
}
/// <summary>
/// rechercher une business-unit rechercher une business-unit à l&#x27;aide de son identifiant
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <returns>ApiResponse of BU</returns>
public ApiResponse< BU > ChercherBUWithHttpInfo (long? buId)
{
// verify the required parameter 'buId' is set
if (buId == null)
throw new ApiException(400, "Missing required parameter 'buId' when calling BusinessUnitApi->ChercherBU");
var localVarPath = "/bus/{buId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (buId != null) localVarPathParams.Add("buId", this.Configuration.ApiClient.ParameterToString(buId)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("ChercherBU", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<BU>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
(BU) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BU)));
}
/// <summary>
/// rechercher une business-unit rechercher une business-unit à l&#x27;aide de son identifiant
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <returns>Task of BU</returns>
public async System.Threading.Tasks.Task<BU> ChercherBUAsync (long? buId)
{
ApiResponse<BU> localVarResponse = await ChercherBUAsyncWithHttpInfo(buId);
return localVarResponse.Data;
}
/// <summary>
/// rechercher une business-unit rechercher une business-unit à l&#x27;aide de son identifiant
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <returns>Task of ApiResponse (BU)</returns>
public async System.Threading.Tasks.Task<ApiResponse<BU>> ChercherBUAsyncWithHttpInfo (long? buId)
{
// verify the required parameter 'buId' is set
if (buId == null)
throw new ApiException(400, "Missing required parameter 'buId' when calling BusinessUnitApi->ChercherBU");
var localVarPath = "/bus/{buId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (buId != null) localVarPathParams.Add("buId", this.Configuration.ApiClient.ParameterToString(buId)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("ChercherBU", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<BU>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
(BU) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BU)));
}
/// <summary>
/// rechercher toutes les business-units Cette requette demande de récupérer toutes les business-units existantes
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <returns>List&lt;BU&gt;</returns>
public List<BU> ChercherBUs ()
{
ApiResponse<List<BU>> localVarResponse = ChercherBUsWithHttpInfo();
return localVarResponse.Data;
}
/// <summary>
/// rechercher toutes les business-units Cette requette demande de récupérer toutes les business-units existantes
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of List&lt;BU&gt;</returns>
public ApiResponse< List<BU> > ChercherBUsWithHttpInfo ()
{
var localVarPath = "/bus";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("ChercherBUs", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<List<BU>>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
(List<BU>) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<BU>)));
}
/// <summary>
/// rechercher toutes les business-units Cette requette demande de récupérer toutes les business-units existantes
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <returns>Task of List&lt;BU&gt;</returns>
public async System.Threading.Tasks.Task<List<BU>> ChercherBUsAsync ()
{
ApiResponse<List<BU>> localVarResponse = await ChercherBUsAsyncWithHttpInfo();
return localVarResponse.Data;
}
/// <summary>
/// rechercher toutes les business-units Cette requette demande de récupérer toutes les business-units existantes
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <returns>Task of ApiResponse (List&lt;BU&gt;)</returns>
public async System.Threading.Tasks.Task<ApiResponse<List<BU>>> ChercherBUsAsyncWithHttpInfo ()
{
var localVarPath = "/bus";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("ChercherBUs", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<List<BU>>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
(List<BU>) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<BU>)));
}
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns></returns>
public void MajBU (long? buId, NouvelleBU body = null)
{
MajBUWithHttpInfo(buId, body);
}
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> MajBUWithHttpInfo (long? buId, NouvelleBU body = null)
{
// verify the required parameter 'buId' is set
if (buId == null)
throw new ApiException(400, "Missing required parameter 'buId' when calling BusinessUnitApi->MajBU");
var localVarPath = "/bus/{buId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json"
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (buId != null) localVarPathParams.Add("buId", this.Configuration.ApiClient.ParameterToString(buId)); // path parameter
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("MajBU", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
null);
}
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task MajBUAsync (long? buId, NouvelleBU body = null)
{
await MajBUAsyncWithHttpInfo(buId, body);
}
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> MajBUAsyncWithHttpInfo (long? buId, NouvelleBU body = null)
{
// verify the required parameter 'buId' is set
if (buId == null)
throw new ApiException(400, "Missing required parameter 'buId' when calling BusinessUnitApi->MajBU");
var localVarPath = "/bus/{buId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json"
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (buId != null) localVarPathParams.Add("buId", this.Configuration.ApiClient.ParameterToString(buId)); // path parameter
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath,
Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("MajBU", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
null);
}
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns></returns>
public void MajBUpatch (long? buId, NouvelleBU body = null)
{
MajBUpatchWithHttpInfo(buId, body);
}
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> MajBUpatchWithHttpInfo (long? buId, NouvelleBU body = null)
{
// verify the required parameter 'buId' is set
if (buId == null)
throw new ApiException(400, "Missing required parameter 'buId' when calling BusinessUnitApi->MajBUpatch");
var localVarPath = "/bus/{buId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json"
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (buId != null) localVarPathParams.Add("buId", this.Configuration.ApiClient.ParameterToString(buId)); // path parameter
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("MajBUpatch", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
null);
}
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task MajBUpatchAsync (long? buId, NouvelleBU body = null)
{
await MajBUpatchAsyncWithHttpInfo(buId, body);
}
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <exception cref="IO.Swagger.ClientCollaborateur.ApiException">Thrown when fails to make API call</exception>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <param name="body"> (optional)</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> MajBUpatchAsyncWithHttpInfo (long? buId, NouvelleBU body = null)
{
// verify the required parameter 'buId' is set
if (buId == null)
throw new ApiException(400, "Missing required parameter 'buId' when calling BusinessUnitApi->MajBUpatch");
var localVarPath = "/bus/{buId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new List<KeyValuePair<String, String>>();
var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
var localVarFormParams = new Dictionary<String, String>();
var localVarFileParams = new Dictionary<String, FileParameter>();
Object localVarPostBody = null;
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json"
};
String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (buId != null) localVarPathParams.Add("buId", this.Configuration.ApiClient.ParameterToString(buId)); // path parameter
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath,
Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("MajBUpatch", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
null);
}
}
}