use serde::{Deserialize, Serialize}; /*
                                      * Compute Engine API
                                      *
                                      * Creates and runs virtual machines on Google Cloud Platform.
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

use crate::google_rest_apis::compute_v1::models;

/// AutoscalingPolicyScalingSchedule : Scaling based on user-defined schedule. The message describes a single scaling schedule. A scaling schedule changes the minimum number of VM instances an autoscaler can recommend, which can trigger scaling out.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutoscalingPolicyScalingSchedule {
    /// A description of a scaling schedule.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// A boolean value that specifies whether a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional, and its value is false by default.
    #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")]
    pub disabled: Option<bool>,
    /// The duration of time intervals, in seconds, for which this scaling schedule is to run. The minimum allowed value is 300. This field is required.
    #[serde(rename = "durationSec", skip_serializing_if = "Option::is_none")]
    pub duration_sec: Option<i32>,
    /// The minimum number of VM instances that the autoscaler will recommend in time intervals starting according to schedule. This field is required.
    #[serde(
        rename = "minRequiredReplicas",
        skip_serializing_if = "Option::is_none"
    )]
    pub min_required_replicas: Option<i32>,
    /// The start timestamps of time intervals when this scaling schedule is to provide a scaling signal. This field uses the extended cron format (with an optional year field). The expression can describe a single timestamp if the optional year is set, in which case the scaling schedule runs once. The schedule is interpreted with respect to time_zone. This field is required. Note: These timestamps only describe when autoscaler starts providing the scaling signal. The VMs need additional time to become serving.
    #[serde(rename = "schedule", skip_serializing_if = "Option::is_none")]
    pub schedule: Option<String>,
    /// The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: https://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of \"UTC\" if left empty.
    #[serde(rename = "timeZone", skip_serializing_if = "Option::is_none")]
    pub time_zone: Option<String>,
}

impl AutoscalingPolicyScalingSchedule {
    /// Scaling based on user-defined schedule. The message describes a single scaling schedule. A scaling schedule changes the minimum number of VM instances an autoscaler can recommend, which can trigger scaling out.
    pub fn new() -> AutoscalingPolicyScalingSchedule {
        AutoscalingPolicyScalingSchedule {
            description: None,
            disabled: None,
            duration_sec: None,
            min_required_replicas: None,
            schedule: None,
            time_zone: None,
        }
    }
}
