{
    "openapi": "3.0.0",
    "info": {
        "title": "Impressão de Proposta Endosso",
        "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"
        }
    ],
    "tags": [
        {
            "name": "Impressão",
            "description": "Imprimir demonstrativo"
        }
    ],
    "paths": {
        "/endosso/impressao/proposta": {
            "post": {
                "tags": [
                    "Impressão"
                ],
                "summary": "Impressão de proposta",
                "operationId": "demonstrativo2",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Request"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful Operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ImpressaoPropostaResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Service Unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PropostaErroResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Service Unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PropostaErroResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Service Unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PropostaErroResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Service Unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PropostaErroResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Service Unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PropostaErroResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "JWT"
            }
        },
        "schemas": {
            "ImpressaoPropostaResponse": {
                "type": "object",
                "properties": {
                    "proposta": {
                        "$ref": "#/components/schemas/PropostaResponse",
                        "description": "Proposal details"
                    },
                    "mensagemErro": {
                        "type": "array",
                        "description": "List of error messages",
                        "items": {
                            "$ref": "#/components/schemas/PropostaErroResponse"
                        }
                    }
                }
            },
            "Autenticacao": {
                "type": "object",
                "properties": {
                    "provedor": {
                        "type": "integer",
                        "example": 3004894000186
                    },
                    "usuario": {
                        "type": "string",
                        "example": "02519440000185"
                    }
                },
                "required": [
                    "provedor",
                    "usuario"
                ]
            },
            "PropostaResponse": {
                "type": "object",
                "properties": {
                    "bytesPDF": {
                        "type": "string",
                        "format": "binary",
                        "description": "PDF file in binary format",
                        "example": null
                    }
                }
            },
            "PropostaErroResponse": {
                "type": "object",
                "properties": {
                    "cdErro": {
                        "type": "integer",
                        "description": "Error code",
                        "example": 101
                    },
                    "dsErro": {
                        "type": "string",
                        "description": "Error description",
                        "example": "Invalid input data"
                    },
                    "cdSQLCode": {
                        "type": "integer",
                        "description": "SQL error code",
                        "example": 500
                    },
                    "dsPrograma": {
                        "type": "string",
                        "description": "Program name",
                        "example": "ErrorHandlerService"
                    }
                }
            },
            "ChaveApolice": {
                "type": "object",
                "properties": {
                    "numero": {
                        "type": "integer",
                        "example": 49456
                    },
                    "item": {
                        "type": "integer",
                        "example": 1
                    }
                },
                "required": [
                    "numero",
                    "item"
                ]
            },
            "Proposta": {
                "type": "object",
                "properties": {
                    "numero": {
                        "type": "integer",
                        "format": "int64",
                        "example": 123456789
                    }
                },
                "required": [
                    "numero"
                ]
            },
            "Request": {
                "type": "object",
                "properties": {
                    "autenticacao": {
                        "$ref": "#/components/schemas/Autenticacao"
                    },
                    "chaveApolice": {
                        "$ref": "#/components/schemas/ChaveApolice"
                    },
                    "proposta": {
                        "$ref": "#/components/schemas/Proposta"
                    },
                    "codigoSucursal": {
                        "type": "integer",
                        "example": 251
                    }
                },
                "required": [
                    "autenticacao",
                    "chaveApolice",
                    "endosso",
                    "codigoSucursal"
                ]
            }
        }
    }
}