/* * 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.2 * 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 IAgenceApi : IApiAccessor { #region Synchronous Operations /// /// ajout d'une nouvelle agence /// /// /// /// /// Thrown when fails to make API call /// (optional) /// void AjoutAgence (NouvelleAgence body = null); /// /// ajout d'une nouvelle agence /// /// /// /// /// Thrown when fails to make API call /// (optional) /// ApiResponse of Object(void) ApiResponse AjoutAgenceWithHttpInfo (NouvelleAgence body = null); /// /// rechercher une adresse /// /// /// rechercher une agence à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// Agence Agence ChercherAgence (long? agenceId); /// /// rechercher une adresse /// /// /// rechercher une agence à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// ApiResponse of Agence ApiResponse ChercherAgenceWithHttpInfo (long? agenceId); /// /// rechercher toutes les agences /// /// /// Cette requette demande de récupérer toutes les agences existantes /// /// Thrown when fails to make API call /// List<Agence> List ChercherAgences (); /// /// rechercher toutes les agences /// /// /// Cette requette demande de récupérer toutes les agences existantes /// /// Thrown when fails to make API call /// ApiResponse of List<Agence> ApiResponse> ChercherAgencesWithHttpInfo (); /// /// mettre à jour une agence /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// void MajAgence (long? agenceId, NouvelleAgence body = null); /// /// mettre à jour une agence /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// ApiResponse of Object(void) ApiResponse MajAgenceWithHttpInfo (long? agenceId, NouvelleAgence body = null); /// /// mettre à jour une agence /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// void MajAgencepatch (long? agenceId, NouvelleAgence body = null); /// /// mettre à jour une agence /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// ApiResponse of Object(void) ApiResponse MajAgencepatchWithHttpInfo (long? agenceId, NouvelleAgence body = null); #endregion Synchronous Operations #region Asynchronous Operations /// /// ajout d'une nouvelle agence /// /// /// /// /// Thrown when fails to make API call /// (optional) /// Task of void System.Threading.Tasks.Task AjoutAgenceAsync (NouvelleAgence body = null); /// /// ajout d'une nouvelle agence /// /// /// /// /// Thrown when fails to make API call /// (optional) /// Task of ApiResponse System.Threading.Tasks.Task> AjoutAgenceAsyncWithHttpInfo (NouvelleAgence body = null); /// /// rechercher une adresse /// /// /// rechercher une agence à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// Task of Agence System.Threading.Tasks.Task ChercherAgenceAsync (long? agenceId); /// /// rechercher une adresse /// /// /// rechercher une agence à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// Task of ApiResponse (Agence) System.Threading.Tasks.Task> ChercherAgenceAsyncWithHttpInfo (long? agenceId); /// /// rechercher toutes les agences /// /// /// Cette requette demande de récupérer toutes les agences existantes /// /// Thrown when fails to make API call /// Task of List<Agence> System.Threading.Tasks.Task> ChercherAgencesAsync (); /// /// rechercher toutes les agences /// /// /// Cette requette demande de récupérer toutes les agences existantes /// /// Thrown when fails to make API call /// Task of ApiResponse (List<Agence>) System.Threading.Tasks.Task>> ChercherAgencesAsyncWithHttpInfo (); /// /// mettre à jour une agence /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// Task of void System.Threading.Tasks.Task MajAgenceAsync (long? agenceId, NouvelleAgence body = null); /// /// mettre à jour une agence /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// Task of ApiResponse System.Threading.Tasks.Task> MajAgenceAsyncWithHttpInfo (long? agenceId, NouvelleAgence body = null); /// /// mettre à jour une agence /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// Task of void System.Threading.Tasks.Task MajAgencepatchAsync (long? agenceId, NouvelleAgence body = null); /// /// mettre à jour une agence /// /// /// /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// Task of ApiResponse System.Threading.Tasks.Task> MajAgencepatchAsyncWithHttpInfo (long? agenceId, NouvelleAgence body = null); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class AgenceApi : IAgenceApi { private IO.Swagger.ClientCollaborateur.ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public AgenceApi(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 AgenceApi() { 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 AgenceApi(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 agence /// /// Thrown when fails to make API call /// (optional) /// public void AjoutAgence (NouvelleAgence body = null) { AjoutAgenceWithHttpInfo(body); } /// /// ajout d'une nouvelle agence /// /// Thrown when fails to make API call /// (optional) /// ApiResponse of Object(void) public ApiResponse AjoutAgenceWithHttpInfo (NouvelleAgence body = null) { var localVarPath = "/agences"; 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("AjoutAgence", 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 agence /// /// Thrown when fails to make API call /// (optional) /// Task of void public async System.Threading.Tasks.Task AjoutAgenceAsync (NouvelleAgence body = null) { await AjoutAgenceAsyncWithHttpInfo(body); } /// /// ajout d'une nouvelle agence /// /// Thrown when fails to make API call /// (optional) /// Task of ApiResponse public async System.Threading.Tasks.Task> AjoutAgenceAsyncWithHttpInfo (NouvelleAgence body = null) { var localVarPath = "/agences"; 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("AjoutAgence", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// /// rechercher une adresse rechercher une agence à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// Agence public Agence ChercherAgence (long? agenceId) { ApiResponse localVarResponse = ChercherAgenceWithHttpInfo(agenceId); return localVarResponse.Data; } /// /// rechercher une adresse rechercher une agence à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// ApiResponse of Agence public ApiResponse< Agence > ChercherAgenceWithHttpInfo (long? agenceId) { // verify the required parameter 'agenceId' is set if (agenceId == null) throw new ApiException(400, "Missing required parameter 'agenceId' when calling AgenceApi->ChercherAgence"); var localVarPath = "/agence/{agenceId}"; 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 (agenceId != null) localVarPathParams.Add("agenceId", this.Configuration.ApiClient.ParameterToString(agenceId)); // 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("ChercherAgence", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), (Agence) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Agence))); } /// /// rechercher une adresse rechercher une agence à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// Task of Agence public async System.Threading.Tasks.Task ChercherAgenceAsync (long? agenceId) { ApiResponse localVarResponse = await ChercherAgenceAsyncWithHttpInfo(agenceId); return localVarResponse.Data; } /// /// rechercher une adresse rechercher une agence à l'aide de son identifiant /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// Task of ApiResponse (Agence) public async System.Threading.Tasks.Task> ChercherAgenceAsyncWithHttpInfo (long? agenceId) { // verify the required parameter 'agenceId' is set if (agenceId == null) throw new ApiException(400, "Missing required parameter 'agenceId' when calling AgenceApi->ChercherAgence"); var localVarPath = "/agence/{agenceId}"; 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 (agenceId != null) localVarPathParams.Add("agenceId", this.Configuration.ApiClient.ParameterToString(agenceId)); // 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("ChercherAgence", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), (Agence) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Agence))); } /// /// rechercher toutes les agences Cette requette demande de récupérer toutes les agences existantes /// /// Thrown when fails to make API call /// List<Agence> public List ChercherAgences () { ApiResponse> localVarResponse = ChercherAgencesWithHttpInfo(); return localVarResponse.Data; } /// /// rechercher toutes les agences Cette requette demande de récupérer toutes les agences existantes /// /// Thrown when fails to make API call /// ApiResponse of List<Agence> public ApiResponse< List > ChercherAgencesWithHttpInfo () { var localVarPath = "/agences"; 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("ChercherAgences", 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 agences Cette requette demande de récupérer toutes les agences existantes /// /// Thrown when fails to make API call /// Task of List<Agence> public async System.Threading.Tasks.Task> ChercherAgencesAsync () { ApiResponse> localVarResponse = await ChercherAgencesAsyncWithHttpInfo(); return localVarResponse.Data; } /// /// rechercher toutes les agences Cette requette demande de récupérer toutes les agences existantes /// /// Thrown when fails to make API call /// Task of ApiResponse (List<Agence>) public async System.Threading.Tasks.Task>> ChercherAgencesAsyncWithHttpInfo () { var localVarPath = "/agences"; 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("ChercherAgences", 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 agence /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// public void MajAgence (long? agenceId, NouvelleAgence body = null) { MajAgenceWithHttpInfo(agenceId, body); } /// /// mettre à jour une agence /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// ApiResponse of Object(void) public ApiResponse MajAgenceWithHttpInfo (long? agenceId, NouvelleAgence body = null) { // verify the required parameter 'agenceId' is set if (agenceId == null) throw new ApiException(400, "Missing required parameter 'agenceId' when calling AgenceApi->MajAgence"); var localVarPath = "/agence/{agenceId}"; 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 (agenceId != null) localVarPathParams.Add("agenceId", this.Configuration.ApiClient.ParameterToString(agenceId)); // 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("MajAgence", 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 agence /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// Task of void public async System.Threading.Tasks.Task MajAgenceAsync (long? agenceId, NouvelleAgence body = null) { await MajAgenceAsyncWithHttpInfo(agenceId, body); } /// /// mettre à jour une agence /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// Task of ApiResponse public async System.Threading.Tasks.Task> MajAgenceAsyncWithHttpInfo (long? agenceId, NouvelleAgence body = null) { // verify the required parameter 'agenceId' is set if (agenceId == null) throw new ApiException(400, "Missing required parameter 'agenceId' when calling AgenceApi->MajAgence"); var localVarPath = "/agence/{agenceId}"; 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 (agenceId != null) localVarPathParams.Add("agenceId", this.Configuration.ApiClient.ParameterToString(agenceId)); // 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("MajAgence", 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 agence /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// public void MajAgencepatch (long? agenceId, NouvelleAgence body = null) { MajAgencepatchWithHttpInfo(agenceId, body); } /// /// mettre à jour une agence /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// ApiResponse of Object(void) public ApiResponse MajAgencepatchWithHttpInfo (long? agenceId, NouvelleAgence body = null) { // verify the required parameter 'agenceId' is set if (agenceId == null) throw new ApiException(400, "Missing required parameter 'agenceId' when calling AgenceApi->MajAgencepatch"); var localVarPath = "/agence/{agenceId}"; 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 (agenceId != null) localVarPathParams.Add("agenceId", this.Configuration.ApiClient.ParameterToString(agenceId)); // 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("MajAgencepatch", 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 agence /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// Task of void public async System.Threading.Tasks.Task MajAgencepatchAsync (long? agenceId, NouvelleAgence body = null) { await MajAgencepatchAsyncWithHttpInfo(agenceId, body); } /// /// mettre à jour une agence /// /// Thrown when fails to make API call /// Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée /// (optional) /// Task of ApiResponse public async System.Threading.Tasks.Task> MajAgencepatchAsyncWithHttpInfo (long? agenceId, NouvelleAgence body = null) { // verify the required parameter 'agenceId' is set if (agenceId == null) throw new ApiException(400, "Missing required parameter 'agenceId' when calling AgenceApi->MajAgencepatch"); var localVarPath = "/agence/{agenceId}"; 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 (agenceId != null) localVarPathParams.Add("agenceId", this.Configuration.ApiClient.ParameterToString(agenceId)); // 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("MajAgencepatch", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } } }