/*
* 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 IAdresseApi : IApiAccessor
{
#region Synchronous Operations
///
/// ajout d'une nouvelle adresse
///
///
///
///
/// Thrown when fails to make API call
/// (optional)
///
void AjoutAdresse (NouvelleAdresse body = null);
///
/// ajout d'une nouvelle adresse
///
///
///
///
/// Thrown when fails to make API call
/// (optional)
/// ApiResponse of Object(void)
ApiResponse AjoutAdresseWithHttpInfo (NouvelleAdresse body = null);
///
/// rechercher une adresse
///
///
/// rechercher une adresse à l'aide de son identifiant
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// Adresse
Adresse ChercherAdresse (long? adresseId);
///
/// rechercher une adresse
///
///
/// rechercher une adresse à l'aide de son identifiant
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// ApiResponse of Adresse
ApiResponse ChercherAdresseWithHttpInfo (long? adresseId);
///
/// rechercher toutes les adresses
///
///
/// Cette requette demande de récupérer toutes les adresses existantes
///
/// Thrown when fails to make API call
/// List<Adresse>
List ChercherAdresses ();
///
/// rechercher toutes les adresses
///
///
/// Cette requette demande de récupérer toutes les adresses existantes
///
/// Thrown when fails to make API call
/// ApiResponse of List<Adresse>
ApiResponse> ChercherAdressesWithHttpInfo ();
///
/// mettre à jour une adresse
///
///
///
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
///
void MajAdresse (long? adresseId, NouvelleAdresse body = null);
///
/// mettre à jour une adresse
///
///
///
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// ApiResponse of Object(void)
ApiResponse MajAdresseWithHttpInfo (long? adresseId, NouvelleAdresse body = null);
///
/// mettre à jour une adresse
///
///
///
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
///
void MajAdressepatch (long? adresseId, NouvelleAdresse body = null);
///
/// mettre à jour une adresse
///
///
///
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// ApiResponse of Object(void)
ApiResponse MajAdressepatchWithHttpInfo (long? adresseId, NouvelleAdresse body = null);
#endregion Synchronous Operations
#region Asynchronous Operations
///
/// ajout d'une nouvelle adresse
///
///
///
///
/// Thrown when fails to make API call
/// (optional)
/// Task of void
System.Threading.Tasks.Task AjoutAdresseAsync (NouvelleAdresse body = null);
///
/// ajout d'une nouvelle adresse
///
///
///
///
/// Thrown when fails to make API call
/// (optional)
/// Task of ApiResponse
System.Threading.Tasks.Task> AjoutAdresseAsyncWithHttpInfo (NouvelleAdresse body = null);
///
/// rechercher une adresse
///
///
/// rechercher une adresse à l'aide de son identifiant
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// Task of Adresse
System.Threading.Tasks.Task ChercherAdresseAsync (long? adresseId);
///
/// rechercher une adresse
///
///
/// rechercher une adresse à l'aide de son identifiant
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// Task of ApiResponse (Adresse)
System.Threading.Tasks.Task> ChercherAdresseAsyncWithHttpInfo (long? adresseId);
///
/// rechercher toutes les adresses
///
///
/// Cette requette demande de récupérer toutes les adresses existantes
///
/// Thrown when fails to make API call
/// Task of List<Adresse>
System.Threading.Tasks.Task> ChercherAdressesAsync ();
///
/// rechercher toutes les adresses
///
///
/// Cette requette demande de récupérer toutes les adresses existantes
///
/// Thrown when fails to make API call
/// Task of ApiResponse (List<Adresse>)
System.Threading.Tasks.Task>> ChercherAdressesAsyncWithHttpInfo ();
///
/// mettre à jour une adresse
///
///
///
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// Task of void
System.Threading.Tasks.Task MajAdresseAsync (long? adresseId, NouvelleAdresse body = null);
///
/// mettre à jour une adresse
///
///
///
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// Task of ApiResponse
System.Threading.Tasks.Task> MajAdresseAsyncWithHttpInfo (long? adresseId, NouvelleAdresse body = null);
///
/// mettre à jour une adresse
///
///
///
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// Task of void
System.Threading.Tasks.Task MajAdressepatchAsync (long? adresseId, NouvelleAdresse body = null);
///
/// mettre à jour une adresse
///
///
///
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// Task of ApiResponse
System.Threading.Tasks.Task> MajAdressepatchAsyncWithHttpInfo (long? adresseId, NouvelleAdresse body = null);
#endregion Asynchronous Operations
}
///
/// Represents a collection of functions to interact with the API endpoints
///
public partial class AdresseApi : IAdresseApi
{
private IO.Swagger.ClientCollaborateur.ExceptionFactory _exceptionFactory = (name, response) => null;
///
/// Initializes a new instance of the class.
///
///
public AdresseApi(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 AdresseApi()
{
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 AdresseApi(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 adresse
///
/// Thrown when fails to make API call
/// (optional)
///
public void AjoutAdresse (NouvelleAdresse body = null)
{
AjoutAdresseWithHttpInfo(body);
}
///
/// ajout d'une nouvelle adresse
///
/// Thrown when fails to make API call
/// (optional)
/// ApiResponse of Object(void)
public ApiResponse AjoutAdresseWithHttpInfo (NouvelleAdresse body = null)
{
var localVarPath = "/adresses";
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("AjoutAdresse", 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 adresse
///
/// Thrown when fails to make API call
/// (optional)
/// Task of void
public async System.Threading.Tasks.Task AjoutAdresseAsync (NouvelleAdresse body = null)
{
await AjoutAdresseAsyncWithHttpInfo(body);
}
///
/// ajout d'une nouvelle adresse
///
/// Thrown when fails to make API call
/// (optional)
/// Task of ApiResponse
public async System.Threading.Tasks.Task> AjoutAdresseAsyncWithHttpInfo (NouvelleAdresse body = null)
{
var localVarPath = "/adresses";
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("AjoutAdresse", 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 adresse à l'aide de son identifiant
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// Adresse
public Adresse ChercherAdresse (long? adresseId)
{
ApiResponse localVarResponse = ChercherAdresseWithHttpInfo(adresseId);
return localVarResponse.Data;
}
///
/// rechercher une adresse rechercher une adresse à l'aide de son identifiant
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// ApiResponse of Adresse
public ApiResponse< Adresse > ChercherAdresseWithHttpInfo (long? adresseId)
{
// verify the required parameter 'adresseId' is set
if (adresseId == null)
throw new ApiException(400, "Missing required parameter 'adresseId' when calling AdresseApi->ChercherAdresse");
var localVarPath = "/adresses/{adresseId}";
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 (adresseId != null) localVarPathParams.Add("adresseId", this.Configuration.ApiClient.ParameterToString(adresseId)); // 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("ChercherAdresse", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
(Adresse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Adresse)));
}
///
/// rechercher une adresse rechercher une adresse à l'aide de son identifiant
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// Task of Adresse
public async System.Threading.Tasks.Task ChercherAdresseAsync (long? adresseId)
{
ApiResponse localVarResponse = await ChercherAdresseAsyncWithHttpInfo(adresseId);
return localVarResponse.Data;
}
///
/// rechercher une adresse rechercher une adresse à l'aide de son identifiant
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// Task of ApiResponse (Adresse)
public async System.Threading.Tasks.Task> ChercherAdresseAsyncWithHttpInfo (long? adresseId)
{
// verify the required parameter 'adresseId' is set
if (adresseId == null)
throw new ApiException(400, "Missing required parameter 'adresseId' when calling AdresseApi->ChercherAdresse");
var localVarPath = "/adresses/{adresseId}";
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 (adresseId != null) localVarPathParams.Add("adresseId", this.Configuration.ApiClient.ParameterToString(adresseId)); // 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("ChercherAdresse", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
(Adresse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Adresse)));
}
///
/// rechercher toutes les adresses Cette requette demande de récupérer toutes les adresses existantes
///
/// Thrown when fails to make API call
/// List<Adresse>
public List ChercherAdresses ()
{
ApiResponse> localVarResponse = ChercherAdressesWithHttpInfo();
return localVarResponse.Data;
}
///
/// rechercher toutes les adresses Cette requette demande de récupérer toutes les adresses existantes
///
/// Thrown when fails to make API call
/// ApiResponse of List<Adresse>
public ApiResponse< List > ChercherAdressesWithHttpInfo ()
{
var localVarPath = "/adresses";
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("ChercherAdresses", 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 adresses Cette requette demande de récupérer toutes les adresses existantes
///
/// Thrown when fails to make API call
/// Task of List<Adresse>
public async System.Threading.Tasks.Task> ChercherAdressesAsync ()
{
ApiResponse> localVarResponse = await ChercherAdressesAsyncWithHttpInfo();
return localVarResponse.Data;
}
///
/// rechercher toutes les adresses Cette requette demande de récupérer toutes les adresses existantes
///
/// Thrown when fails to make API call
/// Task of ApiResponse (List<Adresse>)
public async System.Threading.Tasks.Task>> ChercherAdressesAsyncWithHttpInfo ()
{
var localVarPath = "/adresses";
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("ChercherAdresses", 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 adresse
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
///
public void MajAdresse (long? adresseId, NouvelleAdresse body = null)
{
MajAdresseWithHttpInfo(adresseId, body);
}
///
/// mettre à jour une adresse
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// ApiResponse of Object(void)
public ApiResponse MajAdresseWithHttpInfo (long? adresseId, NouvelleAdresse body = null)
{
// verify the required parameter 'adresseId' is set
if (adresseId == null)
throw new ApiException(400, "Missing required parameter 'adresseId' when calling AdresseApi->MajAdresse");
var localVarPath = "/adresses/{adresseId}";
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 (adresseId != null) localVarPathParams.Add("adresseId", this.Configuration.ApiClient.ParameterToString(adresseId)); // 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("MajAdresse", 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 adresse
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// Task of void
public async System.Threading.Tasks.Task MajAdresseAsync (long? adresseId, NouvelleAdresse body = null)
{
await MajAdresseAsyncWithHttpInfo(adresseId, body);
}
///
/// mettre à jour une adresse
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// Task of ApiResponse
public async System.Threading.Tasks.Task> MajAdresseAsyncWithHttpInfo (long? adresseId, NouvelleAdresse body = null)
{
// verify the required parameter 'adresseId' is set
if (adresseId == null)
throw new ApiException(400, "Missing required parameter 'adresseId' when calling AdresseApi->MajAdresse");
var localVarPath = "/adresses/{adresseId}";
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 (adresseId != null) localVarPathParams.Add("adresseId", this.Configuration.ApiClient.ParameterToString(adresseId)); // 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("MajAdresse", 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 adresse
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
///
public void MajAdressepatch (long? adresseId, NouvelleAdresse body = null)
{
MajAdressepatchWithHttpInfo(adresseId, body);
}
///
/// mettre à jour une adresse
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// ApiResponse of Object(void)
public ApiResponse MajAdressepatchWithHttpInfo (long? adresseId, NouvelleAdresse body = null)
{
// verify the required parameter 'adresseId' is set
if (adresseId == null)
throw new ApiException(400, "Missing required parameter 'adresseId' when calling AdresseApi->MajAdressepatch");
var localVarPath = "/adresses/{adresseId}";
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 (adresseId != null) localVarPathParams.Add("adresseId", this.Configuration.ApiClient.ParameterToString(adresseId)); // 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("MajAdressepatch", 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 adresse
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// Task of void
public async System.Threading.Tasks.Task MajAdressepatchAsync (long? adresseId, NouvelleAdresse body = null)
{
await MajAdressepatchAsyncWithHttpInfo(adresseId, body);
}
///
/// mettre à jour une adresse
///
/// Thrown when fails to make API call
/// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée
/// (optional)
/// Task of ApiResponse
public async System.Threading.Tasks.Task> MajAdressepatchAsyncWithHttpInfo (long? adresseId, NouvelleAdresse body = null)
{
// verify the required parameter 'adresseId' is set
if (adresseId == null)
throw new ApiException(400, "Missing required parameter 'adresseId' when calling AdresseApi->MajAdressepatch");
var localVarPath = "/adresses/{adresseId}";
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 (adresseId != null) localVarPathParams.Add("adresseId", this.Configuration.ApiClient.ParameterToString(adresseId)); // 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("MajAdressepatch", localVarResponse);
if (exception != null) throw exception;
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
null);
}
}
}