gcloud-sdk 0.30.0

Async Google gRPC/REST APIs and the client implementation hiding complexity of GCP authentication based on Tonic middleware and Reqwest.
Documentation
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;

/// Reservation : Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Reservation {
    #[serde(
        rename = "aggregateReservation",
        skip_serializing_if = "Option::is_none"
    )]
    pub aggregate_reservation: Option<Box<models::AllocationAggregateReservation>>,
    /// [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
    #[serde(rename = "commitment", skip_serializing_if = "Option::is_none")]
    pub commitment: Option<String>,
    /// [Output Only] Creation timestamp in RFC3339 text format.
    #[serde(rename = "creationTimestamp", skip_serializing_if = "Option::is_none")]
    pub creation_timestamp: Option<String>,
    /// An optional description of this resource. Provide this property when you create the resource.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// [Output Only] The unique identifier for the resource. This identifier is defined by the server.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// [Output Only] Type of the resource. Always compute#reservations for reservations.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Resource policies to be added to this reservation. The key is defined by user, and the value is resource policy url. This is to define placement policy with reservation.
    #[serde(rename = "resourcePolicies", skip_serializing_if = "Option::is_none")]
    pub resource_policies: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "resourceStatus", skip_serializing_if = "Option::is_none")]
    pub resource_status: Option<Box<models::AllocationResourceStatus>>,
    /// [Output Only] Reserved for future use.
    #[serde(rename = "satisfiesPzs", skip_serializing_if = "Option::is_none")]
    pub satisfies_pzs: Option<bool>,
    /// [Output Only] Server-defined fully-qualified URL for this resource.
    #[serde(rename = "selfLink", skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[serde(rename = "shareSettings", skip_serializing_if = "Option::is_none")]
    pub share_settings: Option<Box<models::ShareSettings>>,
    #[serde(
        rename = "specificReservation",
        skip_serializing_if = "Option::is_none"
    )]
    pub specific_reservation: Option<Box<models::AllocationSpecificSkuReservation>>,
    /// Indicates whether the reservation can be consumed by VMs with affinity for \"any\" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
    #[serde(
        rename = "specificReservationRequired",
        skip_serializing_if = "Option::is_none"
    )]
    pub specific_reservation_required: Option<bool>,
    /// [Output Only] The status of the reservation.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
    #[serde(rename = "zone", skip_serializing_if = "Option::is_none")]
    pub zone: Option<String>,
}

impl Reservation {
    /// Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources.
    pub fn new() -> Reservation {
        Reservation {
            aggregate_reservation: None,
            commitment: None,
            creation_timestamp: None,
            description: None,
            id: None,
            kind: None,
            name: None,
            resource_policies: None,
            resource_status: None,
            satisfies_pzs: None,
            self_link: None,
            share_settings: None,
            specific_reservation: None,
            specific_reservation_required: None,
            status: None,
            zone: None,
        }
    }
}
/// [Output Only] The status of the reservation.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "CREATING")]
    Creating,
    #[serde(rename = "DELETING")]
    Deleting,
    #[serde(rename = "INVALID")]
    Invalid,
    #[serde(rename = "READY")]
    Ready,
    #[serde(rename = "UPDATING")]
    Updating,
}

impl Default for Status {
    fn default() -> Status {
        Self::Creating
    }
}