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

/// InstanceGroupManager : Represents a Managed Instance Group resource. An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups. For zonal Managed Instance Group, use the instanceGroupManagers resource. For regional Managed Instance Group, use the regionInstanceGroupManagers resource.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct InstanceGroupManager {
    /// The autohealing policy for this managed instance group. You can specify only one value.
    #[serde(rename = "autoHealingPolicies", skip_serializing_if = "Option::is_none")]
    pub auto_healing_policies: Option<Vec<crate::google_rest_apis::compute_v1::models::InstanceGroupManagerAutoHealingPolicy>>,
    /// The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.
    #[serde(rename = "baseInstanceName", skip_serializing_if = "Option::is_none")]
    pub base_instance_name: Option<String>,
    /// [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
    #[serde(rename = "creationTimestamp", skip_serializing_if = "Option::is_none")]
    pub creation_timestamp: Option<String>,
    #[serde(rename = "currentActions", skip_serializing_if = "Option::is_none")]
    pub current_actions: Option<Box<crate::google_rest_apis::compute_v1::models::InstanceGroupManagerActionsSummary>>,
    /// An optional description of this resource.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "distributionPolicy", skip_serializing_if = "Option::is_none")]
    pub distribution_policy: Option<Box<crate::google_rest_apis::compute_v1::models::DistributionPolicy>>,
    /// Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
    #[serde(rename = "fingerprint", skip_serializing_if = "Option::is_none")]
    pub fingerprint: Option<String>,
    /// [Output Only] A unique identifier for this resource type. The server generates this identifier.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// [Output Only] The URL of the Instance Group resource.
    #[serde(rename = "instanceGroup", skip_serializing_if = "Option::is_none")]
    pub instance_group: Option<String>,
    #[serde(rename = "instanceLifecyclePolicy", skip_serializing_if = "Option::is_none")]
    pub instance_lifecycle_policy: Option<Box<crate::google_rest_apis::compute_v1::models::InstanceGroupManagerInstanceLifecyclePolicy>>,
    /// The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.
    #[serde(rename = "instanceTemplate", skip_serializing_if = "Option::is_none")]
    pub instance_template: Option<String>,
    /// [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// Pagination behavior of the listManagedInstances API method for this managed instance group.
    #[serde(rename = "listManagedInstancesResults", skip_serializing_if = "Option::is_none")]
    pub list_managed_instances_results: Option<ListManagedInstancesResults>,
    /// The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Named ports configured for the Instance Groups complementary to this Instance Group Manager.
    #[serde(rename = "namedPorts", skip_serializing_if = "Option::is_none")]
    pub named_ports: Option<Vec<crate::google_rest_apis::compute_v1::models::NamedPort>>,
    /// [Output Only] The URL of the region where the managed instance group resides (for regional resources).
    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
    pub region: Option<String>,
    /// [Output Only] The URL for this managed instance group. The server defines this URL.
    #[serde(rename = "selfLink", skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[serde(rename = "statefulPolicy", skip_serializing_if = "Option::is_none")]
    pub stateful_policy: Option<Box<crate::google_rest_apis::compute_v1::models::StatefulPolicy>>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Box<crate::google_rest_apis::compute_v1::models::InstanceGroupManagerStatus>>,
    /// The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.
    #[serde(rename = "targetPools", skip_serializing_if = "Option::is_none")]
    pub target_pools: Option<Vec<String>>,
    /// The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.
    #[serde(rename = "targetSize", skip_serializing_if = "Option::is_none")]
    pub target_size: Option<i32>,
    #[serde(rename = "updatePolicy", skip_serializing_if = "Option::is_none")]
    pub update_policy: Option<Box<crate::google_rest_apis::compute_v1::models::InstanceGroupManagerUpdatePolicy>>,
    /// Specifies the instance templates used by this managed instance group to create instances. Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.
    #[serde(rename = "versions", skip_serializing_if = "Option::is_none")]
    pub versions: Option<Vec<crate::google_rest_apis::compute_v1::models::InstanceGroupManagerVersion>>,
    /// [Output Only] The URL of a zone where the managed instance group is located (for zonal resources).
    #[serde(rename = "zone", skip_serializing_if = "Option::is_none")]
    pub zone: Option<String>,
}

impl InstanceGroupManager {
    /// Represents a Managed Instance Group resource. An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups. For zonal Managed Instance Group, use the instanceGroupManagers resource. For regional Managed Instance Group, use the regionInstanceGroupManagers resource.
    pub fn new() -> InstanceGroupManager {
        InstanceGroupManager {
            auto_healing_policies: None,
            base_instance_name: None,
            creation_timestamp: None,
            current_actions: None,
            description: None,
            distribution_policy: None,
            fingerprint: None,
            id: None,
            instance_group: None,
            instance_lifecycle_policy: None,
            instance_template: None,
            kind: None,
            list_managed_instances_results: None,
            name: None,
            named_ports: None,
            region: None,
            self_link: None,
            stateful_policy: None,
            status: None,
            target_pools: None,
            target_size: None,
            update_policy: None,
            versions: None,
            zone: None,
        }
    }
}

/// Pagination behavior of the listManagedInstances API method for this managed instance group.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ListManagedInstancesResults {
    #[serde(rename = "PAGELESS")]
    Pageless,
    #[serde(rename = "PAGINATED")]
    Paginated,
}

impl Default for ListManagedInstancesResults {
    fn default() -> ListManagedInstancesResults {
        Self::Pageless
    }
}
