jrujano

Untitled

Mar 2nd, 2021 (edited)
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.99 KB | None | 0 0
  1. class TramitesSearchApi(APIView):
  2.     @swagger_auto_schema(
  3.         operation_description="Busca los tramites de los Ciudadanos",
  4.         request_body=openapi.Schema(
  5.             type=openapi.TYPE_OBJECT,
  6.             required=["rut,"],
  7.             properties={
  8.                 "rut": openapi.Schema(type=openapi.TYPE_STRING),
  9.             },
  10.         ),
  11.         security=[],
  12.         tags=["Buscar Tramite"],
  13.         responses={
  14.             "200": openapi.Response(
  15.                 description="Devuelve listado de tramites del ciudadano",
  16.                 examples={
  17.                     "application/json": {
  18.                         "results": [
  19.                             {
  20.                                 "dato1": "xxxxxxxxx",
  21.                                 "dato2": "Mediación",
  22.                            
  23.                             }
  24.                             },
  25.                         ],
  26.                         "maps": [
  27.                             {
  28.                                 "name": "ux",
  29.                                 "options": {"filter": False, "display": "excluded"},
  30.                             },
  31.                             {
  32.                                 "options": {"display": "excluded"},
  33.                                 "label": "Tipo",
  34.                                 "name": "tipo_reclamo",
  35.                             },
  36.                             {"label": "Folio", "name": "folio"},
  37.                             {
  38.                                 "options": {"display": "excluded", "filter": False},
  39.                                 "label": "RUT",
  40.                                 "name": "run_rec",
  41.                             },
  42.                             {
  43.                                 "label": "Reclamante/Solicitante",
  44.                                 "name": "nombre_solicitante",
  45.                             },
  46.                             {"label": "Fecha Ingreso", "name": "fecha_ingreso"},
  47.                             {"label": "Tipo de tramite", "name": "tramitacion"},
  48.                             {"label": "Entidad requerida", "name": "reclamado"},
  49.                             {"label": "Etapa actual", "name": "fase.nombre"},
  50.                             {
  51.                                 "options": {"display": "excluded", "filter": False},
  52.                                 "label": "Estado reclamo",
  53.                                 "name": "estado_reclamo",
  54.                             },
  55.                             {
  56.                                 "options": {"display": "excluded", "filter": False},
  57.                                 "label": "Materia",
  58.                                 "name": "materia",
  59.                             },
  60.                         ],
  61.                     }
  62.                 },
  63.             )
  64.         },
  65.     )
  66.     def post(self, request, *args, **kwargs):
  67.        
  68.  
  69.         .......
  70.         return Response(
  71.             {
  72.                 ......
  73.             },
  74.             status=status.HTTP_200_OK,
  75.         )
Add Comment
Please, Sign In to add comment