vpndetection 6.2.0

The official Rust client library for the VPNDetection API: anonymity detection covering VPNs, residential proxies, Tor nodes, hosting servers, CDNs and relays.
Documentation
/*
 * VPNDetection API
 *
 * The VPNDetection API: classify any IP address, and download the databases behind the answers.  Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key).  See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
 *
 * The version of the OpenAPI document: 2026.11.20
 * Contact: support@vpndetection.io
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EntitlementPlan {
    /// The plan the organization is on, as an identifier that is never renamed or reused: `free` for the free plan, or a paid plan's key. Compare against it and show `name`. On `free`, usage counts its trial, the lookups answered with every field.
    #[serde(rename = "key")]
    pub key: String,
    /// The plan's name, as the site and console show it: `Unlimited` for the free plan. Show this rather than a name built from `key`: a plan's name can change, and its key never does.
    #[serde(rename = "name")]
    pub name: String,
    /// The field tier, which decides how much of a lookup answer comes back; `free` is the free plan's. This list never gains a value: a new plan reports one of these. What each tier includes is documented on the lookup endpoint rather than repeated here, so there is one place it can be wrong.
    #[serde(rename = "tier")]
    pub tier: Tier,
}

impl EntitlementPlan {
    pub fn new(key: String, name: String, tier: Tier) -> EntitlementPlan {
        EntitlementPlan { key, name, tier }
    }
}
/// The field tier, which decides how much of a lookup answer comes back; `free` is the free plan's. This list never gains a value: a new plan reports one of these. What each tier includes is documented on the lookup endpoint rather than repeated here, so there is one place it can be wrong.
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum Tier {
    #[serde(rename = "free")]
    Free,
    #[serde(rename = "starter")]
    Starter,
    #[serde(rename = "scale")]
    Scale,
    #[serde(rename = "max")]
    Max,
    /// A value this release was not built with, as the API served it.
    #[serde(untagged)]
    Other(String),
}

impl Default for Tier {
    fn default() -> Tier {
        Self::Free
    }
}