/*
* 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 Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using Swashbuckle.AspNetCore.SwaggerGen;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
using IO.Swagger.Attributes;
using Microsoft.AspNetCore.Authorization;
using IO.Swagger.Models;
namespace IO.Swagger.Controllers
{
///
///
///
[ApiController]
public class BusinessUnitApiController : ControllerBase
{
///
/// ajout d'une nouvelle business-unit
///
///
/// Opération terminée avec succès
/// Mauvais paramètre
[HttpPost]
[Route("/bus")]
[ValidateModelState]
[SwaggerOperation("AjoutBU")]
public virtual IActionResult AjoutBU([FromBody]NouvelleBU body)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200);
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);
throw new NotImplementedException();
}
///
/// rechercher une business-unit
///
/// rechercher une business-unit à l'aide de son identifiant
/// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée
/// résultat de la recherche
/// Mauvais paramètre
/// il n'y a pas de d'objet recherché possédant cet id
[HttpGet]
[Route("/bus/{buId}")]
[ValidateModelState]
[SwaggerOperation("ChercherBU")]
[SwaggerResponse(statusCode: 200, type: typeof(BU), description: "résultat de la recherche")]
public virtual IActionResult ChercherBU([FromRoute][Required]long? buId)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(BU));
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(404);
string exampleJson = null;
exampleJson = "{\n \"agence\" : {\n \"bus\" : [ null, null ],\n \"id\" : 5,\n \"nom\" : \"nom\"\n },\n \"id\" : 1,\n \"nom\" : \"nom\"\n}";
var example = exampleJson != null
? JsonConvert.DeserializeObject(exampleJson)
: default(BU); //TODO: Change the data returned
return new ObjectResult(example);
}
///
/// rechercher toutes les business-units
///
/// Cette requette demande de récupérer toutes les business-units existantes
/// résultats de la recherche
/// Mauvais paramètre
/// il n'y a pas de business-unit
[HttpGet]
[Route("/bus")]
[ValidateModelState]
[SwaggerOperation("ChercherBUs")]
[SwaggerResponse(statusCode: 200, type: typeof(List), description: "résultats de la recherche")]
public virtual IActionResult ChercherBUs()
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(List));
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(404);
string exampleJson = null;
exampleJson = "[ {\n \"agence\" : {\n \"bus\" : [ null, null ],\n \"id\" : 5,\n \"nom\" : \"nom\"\n },\n \"id\" : 1,\n \"nom\" : \"nom\"\n}, {\n \"agence\" : {\n \"bus\" : [ null, null ],\n \"id\" : 5,\n \"nom\" : \"nom\"\n },\n \"id\" : 1,\n \"nom\" : \"nom\"\n} ]";
var example = exampleJson != null
? JsonConvert.DeserializeObject>(exampleJson)
: default(List); //TODO: Change the data returned
return new ObjectResult(example);
}
///
/// mettre à jour une business-unit
///
/// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée
///
/// Opération terminée avec succès
/// Mauvais paramètre
[HttpPut]
[Route("/bus/{buId}")]
[ValidateModelState]
[SwaggerOperation("MajBU")]
public virtual IActionResult MajBU([FromRoute][Required]long? buId, [FromBody]NouvelleBU body)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200);
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);
throw new NotImplementedException();
}
///
/// mettre à jour une business-unit
///
/// Ce paramêtre permet de renseigner l'identifiant de la business-unit recherchée
///
/// Opération terminée avec succès
/// Mauvais paramètre
[HttpPatch]
[Route("/bus/{buId}")]
[ValidateModelState]
[SwaggerOperation("MajBUpatch")]
public virtual IActionResult MajBUpatch([FromRoute][Required]long? buId, [FromBody]NouvelleBU body)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200);
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(400);
throw new NotImplementedException();
}
}
}