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
                                      */

/// Image : Represents an Image resource. You can use images to create boot disks for your VM instances. For more information, read Images.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Image {
    /// The architecture of the image. Valid values are ARM64 or X86_64.
    #[serde(rename = "architecture", skip_serializing_if = "Option::is_none")]
    pub architecture: Option<Architecture>,
    /// Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
    #[serde(rename = "archiveSizeBytes", skip_serializing_if = "Option::is_none")]
    pub archive_size_bytes: Option<String>,
    /// [Output Only] Creation timestamp in RFC3339 text format.
    #[serde(rename = "creationTimestamp", skip_serializing_if = "Option::is_none")]
    pub creation_timestamp: Option<String>,
    #[serde(rename = "deprecated", skip_serializing_if = "Option::is_none")]
    pub deprecated: Option<Box<crate::google_rest_apis::compute_v1::models::DeprecationStatus>>,
    /// 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>,
    /// Size of the image when restored onto a persistent disk (in GB).
    #[serde(rename = "diskSizeGb", skip_serializing_if = "Option::is_none")]
    pub disk_size_gb: Option<String>,
    /// The name of the image family to which this image belongs. The image family name can be from a publicly managed image family provided by Compute Engine, or from a custom image family you create. For example, centos-stream-9 is a publicly available image family. For more information, see Image family best practices. When creating disks, you can specify an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035.
    #[serde(rename = "family", skip_serializing_if = "Option::is_none")]
    pub family: Option<String>,
    /// A list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available options, see the guestOSfeatures[].type parameter.
    #[serde(rename = "guestOsFeatures", skip_serializing_if = "Option::is_none")]
    pub guest_os_features: Option<Vec<crate::google_rest_apis::compute_v1::models::GuestOsFeature>>,
    /// [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>,
    #[serde(rename = "imageEncryptionKey", skip_serializing_if = "Option::is_none")]
    pub image_encryption_key:
        Option<Box<crate::google_rest_apis::compute_v1::models::CustomerEncryptionKey>>,
    /// [Output Only] Type of the resource. Always compute#image for images.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an image.
    #[serde(rename = "labelFingerprint", skip_serializing_if = "Option::is_none")]
    pub label_fingerprint: Option<String>,
    /// Labels to apply to this image. These can be later modified by the setLabels method.
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<::std::collections::HashMap<String, String>>,
    /// Integer license codes indicating which licenses are attached to this image.
    #[serde(rename = "licenseCodes", skip_serializing_if = "Option::is_none")]
    pub license_codes: Option<Vec<String>>,
    /// Any applicable license URI.
    #[serde(rename = "licenses", skip_serializing_if = "Option::is_none")]
    pub licenses: Option<Vec<String>>,
    /// Name of the resource; provided by the client when the resource is created. The 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>,
    #[serde(rename = "rawDisk", skip_serializing_if = "Option::is_none")]
    pub raw_disk: Option<Box<crate::google_rest_apis::compute_v1::models::ImageRawDisk>>,
    /// [Output Only] Reserved for future use.
    #[serde(rename = "satisfiesPzs", skip_serializing_if = "Option::is_none")]
    pub satisfies_pzs: Option<bool>,
    /// [Output Only] Server-defined URL for the resource.
    #[serde(rename = "selfLink", skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[serde(
        rename = "shieldedInstanceInitialState",
        skip_serializing_if = "Option::is_none"
    )]
    pub shielded_instance_initial_state:
        Option<Box<crate::google_rest_apis::compute_v1::models::InitialStateConfig>>,
    /// URL of the source disk used to create this image. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL
    #[serde(rename = "sourceDisk", skip_serializing_if = "Option::is_none")]
    pub source_disk: Option<String>,
    #[serde(
        rename = "sourceDiskEncryptionKey",
        skip_serializing_if = "Option::is_none"
    )]
    pub source_disk_encryption_key:
        Option<Box<crate::google_rest_apis::compute_v1::models::CustomerEncryptionKey>>,
    /// [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name.
    #[serde(rename = "sourceDiskId", skip_serializing_if = "Option::is_none")]
    pub source_disk_id: Option<String>,
    /// URL of the source image used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/project_id/global/ images/image_name - projects/project_id/global/images/image_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL
    #[serde(rename = "sourceImage", skip_serializing_if = "Option::is_none")]
    pub source_image: Option<String>,
    #[serde(
        rename = "sourceImageEncryptionKey",
        skip_serializing_if = "Option::is_none"
    )]
    pub source_image_encryption_key:
        Option<Box<crate::google_rest_apis::compute_v1::models::CustomerEncryptionKey>>,
    /// [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name.
    #[serde(rename = "sourceImageId", skip_serializing_if = "Option::is_none")]
    pub source_image_id: Option<String>,
    /// URL of the source snapshot used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/project_id/global/ snapshots/snapshot_name - projects/project_id/global/snapshots/snapshot_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL
    #[serde(rename = "sourceSnapshot", skip_serializing_if = "Option::is_none")]
    pub source_snapshot: Option<String>,
    #[serde(
        rename = "sourceSnapshotEncryptionKey",
        skip_serializing_if = "Option::is_none"
    )]
    pub source_snapshot_encryption_key:
        Option<Box<crate::google_rest_apis::compute_v1::models::CustomerEncryptionKey>>,
    /// [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name.
    #[serde(rename = "sourceSnapshotId", skip_serializing_if = "Option::is_none")]
    pub source_snapshot_id: Option<String>,
    /// The type of the image used to create this disk. The default and only valid value is RAW.
    #[serde(rename = "sourceType", skip_serializing_if = "Option::is_none")]
    pub source_type: Option<SourceType>,
    /// [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// Cloud Storage bucket storage location of the image (regional or multi-regional).
    #[serde(rename = "storageLocations", skip_serializing_if = "Option::is_none")]
    pub storage_locations: Option<Vec<String>>,
}

impl Image {
    /// Represents an Image resource. You can use images to create boot disks for your VM instances. For more information, read Images.
    pub fn new() -> Image {
        Image {
            architecture: None,
            archive_size_bytes: None,
            creation_timestamp: None,
            deprecated: None,
            description: None,
            disk_size_gb: None,
            family: None,
            guest_os_features: None,
            id: None,
            image_encryption_key: None,
            kind: None,
            label_fingerprint: None,
            labels: None,
            license_codes: None,
            licenses: None,
            name: None,
            raw_disk: None,
            satisfies_pzs: None,
            self_link: None,
            shielded_instance_initial_state: None,
            source_disk: None,
            source_disk_encryption_key: None,
            source_disk_id: None,
            source_image: None,
            source_image_encryption_key: None,
            source_image_id: None,
            source_snapshot: None,
            source_snapshot_encryption_key: None,
            source_snapshot_id: None,
            source_type: None,
            status: None,
            storage_locations: None,
        }
    }
}

/// The architecture of the image. Valid values are ARM64 or X86_64.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Architecture {
    #[serde(rename = "ARCHITECTURE_UNSPECIFIED")]
    ArchitectureUnspecified,
    #[serde(rename = "ARM64")]
    Arm64,
    #[serde(rename = "X86_64")]
    X8664,
}

impl Default for Architecture {
    fn default() -> Architecture {
        Self::ArchitectureUnspecified
    }
}
/// The type of the image used to create this disk. The default and only valid value is RAW.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SourceType {
    #[serde(rename = "RAW")]
    Raw,
}

impl Default for SourceType {
    fn default() -> SourceType {
        Self::Raw
    }
}
/// [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "DELETING")]
    Deleting,
    #[serde(rename = "FAILED")]
    Failed,
    #[serde(rename = "PENDING")]
    Pending,
    #[serde(rename = "READY")]
    Ready,
}

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