/*
* 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};
/// WebDetail : One port of the address that answered as a web server, from our Web IP database.
#[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 {
/// One port of the address that answered as a web server, from our Web IP database.
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,
}
}
}