{
  "openapi": "3.0.0",
  "info": {
    "title": "API Download 2ª via Boleto",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://sauto.dsv.bradescoseguros.com.br:443/V2/WSBL-CotacaoCSP/service/",
      "description": "Desenvolvimento"
    },
    {
      "url": "https://sauto.hml.bradescoseguros.com.br:443/V2/WSBL-CotacaoCSP/service/",
      "description": "Homologação"
    },
    {
      "url": "https://sauto.bradescoseguros.com.br:443/V2/WSBL-CotacaoCSP/service/",
      "description": "Produção"
    }
  ],
  "paths": {
    "/downloadParcela": {
      "post": {
        "tags": [
          "Download de 2ª via de boleto"
        ],
        "summary": "Imprimir Segunda Via do Boleto",
        "operationId": "imprimirSegundaViaBoleto",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImprimirSegundaViaBoletoDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operação bem-sucedida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadVo"
                }
              }
            }
          },
          "404": {
            "description": "Dados não encontrados",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MensagemErroVo"
                }
              }
            }
          },
          "500": {
            "description": "Erro interno do servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MensagemErroVo"
                }
              }
            }
          },
          "503": {
            "description": "Serviço indisponível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MensagemErroVo"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "ImprimirSegundaViaBoletoDto": {
        "type": "object",
        "properties": {
          "autenticacao": {
            "$ref": "#/components/schemas/Autenticacao",
            "description": "Informações de autenticação"
          },
          "parcela": {
            "$ref": "#/components/schemas/DadosGeraBoletoSegundaViaAutoDto",
            "description": "Dados da parcela para geração da segunda via do boleto"
          }
        },
        "required": [
          "autenticacao",
          "parcela"
        ]
      },
      "Autenticacao": {
        "type": "object",
        "properties": {
          "provedor": {
            "type": "integer",
            "format": "int64",
            "description": "Provedor de autenticação",
            "example": 1
          },
          "usuario": {
            "type": "string",
            "description": "Nome de usuário",
            "example": "usuario123"
          },
          "senha": {
            "type": "string",
            "description": "Senha do usuário",
            "example": "senhaSegura123"
          }
        },
        "required": [
          "provedor",
          "usuario",
          "senha"
        ]
      },
      "DadosGeraBoletoSegundaViaAutoDto": {
        "type": "object",
        "properties": {
          "dgRef": {
            "type": "string",
            "description": "Dígito de referência",
            "example": "ABC123"
          }
        },
        "required": [
          "dgRef"
        ]
      },
      "DownloadVo": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "description": "Nome do arquivo",
            "example": "documento.pdf"
          },
          "content": {
            "type": "string",
            "format": "byte",
            "description": "Conteúdo do arquivo em formato de bytes",
            "example": "SGVsbG8gV29ybGQh"
          }
        }
      },
      "MensagemErroVo": {
        "type": "object",
        "properties": {
          "cdErro": {
            "type": "integer"
          },
          "dsErro": {
            "type": "string"
          }
        }
      }
    }
  }
}