Skip to main content

fastly_api/models/
network_protect_invalid_request.rs

1/*
2 * Fastly API
3 *
4 * Via the Fastly API you can perform any of the operations that are possible within the management console,  including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) 
5 *
6 */
7
8/// NetworkProtectInvalidRequest : Validation error returned for an invalid request.
9
10
11
12#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
13pub struct NetworkProtectInvalidRequest {
14    /// Short summary of the validation problem.
15    #[serde(rename = "title")]
16    pub title: String,
17    /// HTTP status code for this error.
18    #[serde(rename = "status")]
19    pub status: Status,
20    /// Corrective explanation for the invalid request.
21    #[serde(rename = "detail")]
22    pub detail: String,
23    /// Field-level validation errors, when available.
24    #[serde(rename = "errors")]
25    pub errors: Vec<crate::models::NetworkProtectErrorDetail>,
26}
27
28impl NetworkProtectInvalidRequest {
29    /// Validation error returned for an invalid request.
30    pub fn new(title: String, status: Status, detail: String, errors: Vec<crate::models::NetworkProtectErrorDetail>) -> NetworkProtectInvalidRequest {
31        NetworkProtectInvalidRequest {
32            title,
33            status,
34            detail,
35            errors,
36        }
37    }
38}
39
40/// HTTP status code for this error.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Status {
43    #[serde(rename = "400")]
44    Status400,
45}
46
47impl Default for Status {
48    fn default() -> Status {
49        Self::Status400
50    }
51}
52