/* * 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 { /// /// Represents a collection of functions to interact with the API endpoints /// public interface IBusinessUnitApi : IApiAccessor { #region Synchronous Operations /// /// ajout d'une nouvelle business-unit /// /// /// /// /// Thrown when fails to make API call /// (optional) /// void AjoutBU (NouvelleBU body = null); /// /// ajout d'une nouvelle business-unit /// /// /// /// /// Thrown when fails to make API call /// (optional) /// ApiResponse of Object(void) ApiResponse AjoutBUWithHttpInfo (NouvelleBU body = null); /// /// rechercher une business-unit /// /// /// rechercher une business-unit à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// BU BU ChercherBU (long? buId); /// /// rechercher une business-unit /// /// /// rechercher une business-unit à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// ApiResponse of BU ApiResponse ChercherBUWithHttpInfo (long? buId); /// /// rechercher toutes les business-units /// /// /// Cette requette demande de récupérer toutes les business-units existantes /// /// Thrown when fails to make API call /// List<BU> List ChercherBUs (); /// /// rechercher toutes les business-units /// /// /// Cette requette demande de récupérer toutes les business-units existantes /// /// Thrown when fails to make API call /// ApiResponse of List<BU> ApiResponse> ChercherBUsWithHttpInfo (); /// /// mettre à jour une business-unit /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// void MajBU (long? buId, NouvelleBU body = null); /// /// mettre à jour une business-unit /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// ApiResponse of Object(void) ApiResponse MajBUWithHttpInfo (long? buId, NouvelleBU body = null); /// /// mettre à jour une business-unit /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// void MajBUpatch (long? buId, NouvelleBU body = null); /// /// mettre à jour une business-unit /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// ApiResponse of Object(void) ApiResponse MajBUpatchWithHttpInfo (long? buId, NouvelleBU body = null); #endregion Synchronous Operations #region Asynchronous Operations /// /// ajout d'une nouvelle business-unit /// /// /// /// /// Thrown when fails to make API call /// (optional) /// Task of void System.Threading.Tasks.Task AjoutBUAsync (NouvelleBU body = null); /// /// ajout d'une nouvelle business-unit /// /// /// /// /// Thrown when fails to make API call /// (optional) /// Task of ApiResponse System.Threading.Tasks.Task> AjoutBUAsyncWithHttpInfo (NouvelleBU body = null); /// /// rechercher une business-unit /// /// /// rechercher une business-unit à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// Task of BU System.Threading.Tasks.Task ChercherBUAsync (long? buId); /// /// rechercher une business-unit /// /// /// rechercher une business-unit à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// Task of ApiResponse (BU) System.Threading.Tasks.Task> ChercherBUAsyncWithHttpInfo (long? buId); /// /// rechercher toutes les business-units /// /// /// Cette requette demande de récupérer toutes les business-units existantes /// /// Thrown when fails to make API call /// Task of List<BU> System.Threading.Tasks.Task> ChercherBUsAsync (); /// /// rechercher toutes les business-units /// /// /// Cette requette demande de récupérer toutes les business-units existantes /// /// Thrown when fails to make API call /// Task of ApiResponse (List<BU>) System.Threading.Tasks.Task>> ChercherBUsAsyncWithHttpInfo (); /// /// mettre à jour une business-unit /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// Task of void System.Threading.Tasks.Task MajBUAsync (long? buId, NouvelleBU body = null); /// /// mettre à jour une business-unit /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// Task of ApiResponse System.Threading.Tasks.Task> MajBUAsyncWithHttpInfo (long? buId, NouvelleBU body = null); /// /// mettre à jour une business-unit /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// Task of void System.Threading.Tasks.Task MajBUpatchAsync (long? buId, NouvelleBU body = null); /// /// mettre à jour une business-unit /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// Task of ApiResponse System.Threading.Tasks.Task> MajBUpatchAsyncWithHttpInfo (long? buId, NouvelleBU body = null); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class BusinessUnitApi : IBusinessUnitApi { private IO.Swagger.ClientCollaborateur.ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public BusinessUnitApi(String basePath) { this.Configuration = new IO.Swagger.ClientCollaborateur.Configuration { BasePath = basePath }; ExceptionFactory = IO.Swagger.ClientCollaborateur.Configuration.DefaultExceptionFactory; } /// /// Initializes a new instance of the class /// /// public BusinessUnitApi() { this.Configuration = IO.Swagger.ClientCollaborateur.Configuration.Default; ExceptionFactory = IO.Swagger.ClientCollaborateur.Configuration.DefaultExceptionFactory; } /// /// Initializes a new instance of the class /// using Configuration object /// /// An instance of Configuration /// 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; } /// /// Gets the base path of the API client. /// /// The base path public String GetBasePath() { return this.Configuration.ApiClient.RestClient.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 IO.Swagger.ClientCollaborateur.Configuration Configuration {get; set;} /// /// Provides a factory method hook for the creation of exceptions. /// 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; } } /// /// Gets the default header. /// /// Dictionary of HTTP header [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] public IDictionary DefaultHeader() { return new ReadOnlyDictionary(this.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) { this.Configuration.AddDefaultHeader(key, value); } /// /// ajout d'une nouvelle business-unit /// /// Thrown when fails to make API call /// (optional) /// public void AjoutBU (NouvelleBU body = null) { AjoutBUWithHttpInfo(body); } /// /// ajout d'une nouvelle business-unit /// /// Thrown when fails to make API call /// (optional) /// ApiResponse of Object(void) public ApiResponse AjoutBUWithHttpInfo (NouvelleBU body = null) { var localVarPath = "/bus"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); 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(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// /// ajout d'une nouvelle business-unit /// /// Thrown when fails to make API call /// (optional) /// Task of void public async System.Threading.Tasks.Task AjoutBUAsync (NouvelleBU body = null) { await AjoutBUAsyncWithHttpInfo(body); } /// /// ajout d'une nouvelle business-unit /// /// Thrown when fails to make API call /// (optional) /// Task of ApiResponse public async System.Threading.Tasks.Task> AjoutBUAsyncWithHttpInfo (NouvelleBU body = null) { var localVarPath = "/bus"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); 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(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// /// rechercher une business-unit rechercher une business-unit à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// BU public BU ChercherBU (long? buId) { ApiResponse localVarResponse = ChercherBUWithHttpInfo(buId); return localVarResponse.Data; } /// /// rechercher une business-unit rechercher une business-unit à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// ApiResponse of BU 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(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); 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(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), (BU) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BU))); } /// /// rechercher une business-unit rechercher une business-unit à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// Task of BU public async System.Threading.Tasks.Task ChercherBUAsync (long? buId) { ApiResponse localVarResponse = await ChercherBUAsyncWithHttpInfo(buId); return localVarResponse.Data; } /// /// rechercher une business-unit rechercher une business-unit à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// Task of ApiResponse (BU) public async System.Threading.Tasks.Task> 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(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); 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(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), (BU) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BU))); } /// /// rechercher toutes les business-units Cette requette demande de récupérer toutes les business-units existantes /// /// Thrown when fails to make API call /// List<BU> public List ChercherBUs () { ApiResponse> localVarResponse = ChercherBUsWithHttpInfo(); return localVarResponse.Data; } /// /// rechercher toutes les business-units Cette requette demande de récupérer toutes les business-units existantes /// /// Thrown when fails to make API call /// ApiResponse of List<BU> public ApiResponse< List > ChercherBUsWithHttpInfo () { var localVarPath = "/bus"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); 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>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// /// rechercher toutes les business-units Cette requette demande de récupérer toutes les business-units existantes /// /// Thrown when fails to make API call /// Task of List<BU> public async System.Threading.Tasks.Task> ChercherBUsAsync () { ApiResponse> localVarResponse = await ChercherBUsAsyncWithHttpInfo(); return localVarResponse.Data; } /// /// rechercher toutes les business-units Cette requette demande de récupérer toutes les business-units existantes /// /// Thrown when fails to make API call /// Task of ApiResponse (List<BU>) public async System.Threading.Tasks.Task>> ChercherBUsAsyncWithHttpInfo () { var localVarPath = "/bus"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); 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>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// /// mettre à jour une business-unit /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// public void MajBU (long? buId, NouvelleBU body = null) { MajBUWithHttpInfo(buId, body); } /// /// mettre à jour une business-unit /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// ApiResponse of Object(void) public ApiResponse 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(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); 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(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// /// mettre à jour une business-unit /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// Task of void public async System.Threading.Tasks.Task MajBUAsync (long? buId, NouvelleBU body = null) { await MajBUAsyncWithHttpInfo(buId, body); } /// /// mettre à jour une business-unit /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// Task of ApiResponse public async System.Threading.Tasks.Task> 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(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); 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(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// /// mettre à jour une business-unit /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// public void MajBUpatch (long? buId, NouvelleBU body = null) { MajBUpatchWithHttpInfo(buId, body); } /// /// mettre à jour une business-unit /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// ApiResponse of Object(void) public ApiResponse 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(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); 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(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// /// mettre à jour une business-unit /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// Task of void public async System.Threading.Tasks.Task MajBUpatchAsync (long? buId, NouvelleBU body = null) { await MajBUpatchAsyncWithHttpInfo(buId, body); } /// /// mettre à jour une business-unit /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée /// (optional) /// Task of ApiResponse public async System.Threading.Tasks.Task> 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(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); 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(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } } }