Skip to main content

fastly_api/models/
script_update.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
9
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct ScriptUpdate {
13    /// Script authorization status
14    #[serde(rename = "authorization_status", skip_serializing_if = "Option::is_none")]
15    pub authorization_status: Option<AuthorizationStatus>,
16    /// Reason for authorization decision
17    #[serde(rename = "justification", skip_serializing_if = "Option::is_none")]
18    pub justification: Option<String>,
19    /// Hash of authorized script content
20    #[serde(rename = "authorized_hash", skip_serializing_if = "Option::is_none")]
21    pub authorized_hash: Option<String>,
22}
23
24impl ScriptUpdate {
25    pub fn new() -> ScriptUpdate {
26        ScriptUpdate {
27            authorization_status: None,
28            justification: None,
29            authorized_hash: None,
30        }
31    }
32}
33
34/// Script authorization status
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum AuthorizationStatus {
37    #[serde(rename = "authorized")]
38    Authorized,
39    #[serde(rename = "unauthorized")]
40    Unauthorized,
41}
42
43impl Default for AuthorizationStatus {
44    fn default() -> AuthorizationStatus {
45        Self::Authorized
46    }
47}
48