mistral_rouille/models/
error_response.rs

1/*
2 * Mistral AI API
3 *
4 * Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
5 *
6 * Build date: 2024-06-15T23:41:00.377209-06:00[America/Mexico_City]
7 * Generated using: https://openapi-generator.tech
8 * Open API specification v0.0.2 provided by Mistral @ https://docs.mistral.ai/redocusaurus/plugin-redoc-0.yaml
9 * Custom generation templates by [GovCraft Ai](https://www.govcraft.ai)
10 * Contact: roland@govcraft.ai
11 */
12
13use crate::models;
14use serde::{Deserialize, Serialize};
15
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct ErrorResponse {
18    #[serde(rename = "error")]
19    pub error: models::Error,
20}
21
22impl ErrorResponse {
23    /// Creates a new `ErrorResponse` instance.
24    ///
25    /// # Arguments
26    /// * `error`
27    ///
28    /// # Returns
29    ///
30    /// A new `ErrorResponse` instance.
31    pub fn new(error: models::Error) -> ErrorResponse {
32        ErrorResponse { error }
33    }
34}