/*
 * Hetzner Cloud API
 *
 * Copied from the official API documentation for the Public Hetzner Cloud.
 *
 * The version of the OpenAPI document: 4b3f595
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// EnableSnapshotPlanRequest : Request for POST https://api.hetzner.com/v1/storage_boxes/{id}/actions/enable_snapshot_plan
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EnableSnapshotPlanRequest {
    /// Day of the month when the Snapshot Plan is executed.  Null means every day.
    #[serde(
        rename = "day_of_month",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub day_of_month: Option<Option<i32>>,
    /// Day of the week when the Snapshot Plan is executed.  Starts at 1 for Monday til 7 for Sunday. Null means every day.
    #[serde(
        rename = "day_of_week",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub day_of_week: Option<Option<i32>>,
    /// Hour when the Snapshot Plan is executed (UTC).
    #[serde(rename = "hour")]
    pub hour: i32,
    /// Maximum amount of Snapshots that will be created by this Snapshot Plan.  Older Snapshots will be deleted.
    #[serde(rename = "max_snapshots")]
    pub max_snapshots: i32,
    /// Minute when the Snapshot Plan is executed (UTC).
    #[serde(rename = "minute")]
    pub minute: i32,
}

impl EnableSnapshotPlanRequest {
    /// Request for POST https://api.hetzner.com/v1/storage_boxes/{id}/actions/enable_snapshot_plan
    pub fn new(hour: i32, max_snapshots: i32, minute: i32) -> EnableSnapshotPlanRequest {
        EnableSnapshotPlanRequest {
            day_of_month: None,
            day_of_week: None,
            hour,
            max_snapshots,
            minute,
        }
    }
}
