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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LoadBalancerType {
    /// Point in time when the Load Balancer type is deprecated (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format).
    #[serde(rename = "deprecated", deserialize_with = "Option::deserialize")]
    pub deprecated: Option<String>,
    /// Description of the Load Balancer type.
    #[serde(rename = "description")]
    pub description: String,
    /// ID of the Load Balancer type.
    #[serde(rename = "id")]
    pub id: i64,
    /// Number of SSL Certificates that can be assigned to a single Load Balancer.
    #[serde(rename = "max_assigned_certificates")]
    pub max_assigned_certificates: i64,
    /// Number of maximum simultaneous open connections.
    #[serde(rename = "max_connections")]
    pub max_connections: i64,
    /// Number of services a Load Balancer of this type can have.
    #[serde(rename = "max_services")]
    pub max_services: i64,
    /// Number of targets a single Load Balancer can have.
    #[serde(rename = "max_targets")]
    pub max_targets: i64,
    /// Unique identifier of the Load Balancer type.
    #[serde(rename = "name")]
    pub name: String,
    /// Price per Location.
    #[serde(rename = "prices")]
    pub prices: Vec<models::PricePerTime>,
}

impl LoadBalancerType {
    pub fn new(
        deprecated: Option<String>,
        description: String,
        id: i64,
        max_assigned_certificates: i64,
        max_connections: i64,
        max_services: i64,
        max_targets: i64,
        name: String,
        prices: Vec<models::PricePerTime>,
    ) -> LoadBalancerType {
        LoadBalancerType {
            deprecated,
            description,
            id,
            max_assigned_certificates,
            max_connections,
            max_services,
            max_targets,
            name,
            prices,
        }
    }
}
