internetdata 3.0.0

The official Rust client library for the InternetData API: look up IP addresses, AS numbers and domains, and download the IP intelligence databases.
Documentation
/*
 * InternetData API
 *
 * The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them.  See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
 *
 * The version of the OpenAPI document: 2026.11.15
 * Contact: support@internetdata.io
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebDetail {
    /// 80 or 443.
    #[serde(rename = "port")]
    pub port: i32,
    /// A TLS handshake completed.
    #[serde(rename = "tls_ok")]
    pub tls_ok: bool,
    /// An HTTP response came back.
    #[serde(rename = "session_ok")]
    pub session_ok: bool,
    /// Its status, 0 where none came.
    #[serde(rename = "status_code")]
    pub status_code: i32,
    /// Its `Server` header.
    #[serde(rename = "server")]
    pub server: String,
    /// Where it redirected.
    #[serde(rename = "location")]
    pub location: String,
    /// The page's title.
    #[serde(rename = "title")]
    pub title: String,
    /// The certificate's subject common name.
    #[serde(rename = "cert_subject_cn")]
    pub cert_subject_cn: String,
    /// Its subject organization.
    #[serde(rename = "cert_subject_o")]
    pub cert_subject_o: String,
    /// Its issuer.
    #[serde(rename = "cert_issuer_dn")]
    pub cert_issuer_dn: String,
    /// Browsers trust it.
    #[serde(rename = "cert_browser_trusted")]
    pub cert_browser_trusted: bool,
    /// The TLS version negotiated, empty without TLS.
    #[serde(rename = "tls_version")]
    pub tls_version: String,
    /// The first day the port was open.
    #[serde(rename = "first_seen")]
    pub first_seen: String,
    /// The last day it was.
    #[serde(rename = "last_seen")]
    pub last_seen: String,
}

impl WebDetail {
    pub fn new(
        port: i32,
        tls_ok: bool,
        session_ok: bool,
        status_code: i32,
        server: String,
        location: String,
        title: String,
        cert_subject_cn: String,
        cert_subject_o: String,
        cert_issuer_dn: String,
        cert_browser_trusted: bool,
        tls_version: String,
        first_seen: String,
        last_seen: String,
    ) -> WebDetail {
        WebDetail {
            port,
            tls_ok,
            session_ok,
            status_code,
            server,
            location,
            title,
            cert_subject_cn,
            cert_subject_o,
            cert_issuer_dn,
            cert_browser_trusted,
            tls_version,
            first_seen,
            last_seen,
        }
    }
}