mistral_rouille/models/error.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 Error {
18 #[serde(rename = "type")]
19 pub r#type: String,
20 #[serde(rename = "message")]
21 pub message: String,
22 #[serde(rename = "param")]
23 pub param: String,
24 #[serde(rename = "code")]
25 pub code: String,
26}
27
28impl Error {
29 /// Creates a new `Error` instance.
30 ///
31 /// # Arguments
32 /// * `r#type`
33 /// * `message`
34 /// * `param`
35 /// * `code`
36 ///
37 /// # Returns
38 ///
39 /// A new `Error` instance.
40 pub fn new(r#type: String, message: String, param: String, code: String) -> Error {
41 Error {
42 r#type,
43 message,
44 param,
45 code,
46 }
47 }
48}