# coding: utf-8

"""
    Whisper API v1

    <h2>The Foundational Intelligence Layer for the Internet</h2> <p>The Whisper API provides comprehensive, real-time intelligence on any internet asset. By connecting billions of data points across live internet routing, historical registration records, and deep resolution data, our API moves beyond simple enrichment to deliver predictive, context-rich insights.</p> <p>This document is the single source of truth for our v1 API. It is designed for security experts, developers, and automated systems to understand and leverage the full power of our platform.</p>  <h3>🚀 Quick Start</h3> <p><b>1. Get your API key:</b> <a href=\"https://dash.whisper.security\">Sign up at dash.whisper.security</a></p> <p><b>2. Make your first request:</b></p> <pre><code>curl -H \"Authorization: Bearer YOUR_API_KEY\" https://api.whisper.security/v1/indicators/ip/8.8.8.8</code></pre> <p><b>3. Explore the API:</b> Use the \"Try it out\" button in each endpoint below to test interactively.</p>  <h3>🎯 Key Features</h3> <ul>     <li><b>Unified & Simple:</b> Small set of powerful, resource-oriented endpoints</li>     <li><b>Performant by Design:</b> Asynchronous-first with strategic caching (&lt;500ms typical response)</li>     <li><b>Workflow-Oriented:</b> Built for real-world security operations, not just data dumps</li>     <li><b>Comprehensive:</b> IP, Domain, DNS, WHOIS, Routing, Geolocation, Screenshots, Monitoring</li> </ul>  <h3>⚡ Performance Targets</h3> <table>     <tr><th>Endpoint Type</th><th>Response Time</th><th>Use Case</th></tr>     <tr><td>Geolocation</td><td>&lt;150ms</td><td>Real-time fraud detection</td></tr>     <tr><td>Single Indicator</td><td>&lt;500ms</td><td>Incident response enrichment</td></tr>     <tr><td>With Routing Data</td><td>&lt;2s (cached: 200ms)</td><td>Deep network analysis</td></tr>     <tr><td>Bulk Operations</td><td>5-30s</td><td>Batch log enrichment</td></tr>     <tr><td>Search/Discovery</td><td>10-60s</td><td>Threat hunting</td></tr> </table>  <h3>🔐 Authentication</h3> <p>All endpoints require Bearer token authentication. Click the <b>\"Authorize\"</b> button above and enter your API key.</p> <pre><code>Authorization: Bearer wsk_live_1234567890abcdef</code></pre>  <h3>📊 Rate Limits</h3> <table>     <tr><th>Category</th><th>Limit</th></tr>     <tr><td>Standard Enrichment</td><td>100 req/min</td></tr>     <tr><td>Bulk Operations</td><td>10 req/min</td></tr>     <tr><td>Search/Discovery</td><td>5 req/min</td></tr>     <tr><td>Screenshots</td><td>10 req/min</td></tr> </table> <p><i>Rate limits return HTTP 429. Retry after the time specified in the <code>Retry-After</code> header.</i></p>  <h3>📚 Resources</h3> <ul>     <li><a href=\"https://docs.whisper.security\">Full Documentation</a></li>     <li><a href=\"https://docs.whisper.security/quickstart\">Quick Start Guide</a></li>     <li><a href=\"https://docs.whisper.security/examples\">Code Examples</a></li>     <li><a href=\"https://whisper.security/support\">API Support</a></li> </ul> 

    The version of the OpenAPI document: 1.0.0
    Contact: api-support@whisper.security
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self

class SummaryInfo(BaseModel):
    """
    Executive summary with the most important facts for quick decision-making
    """ # noqa: E501
    organization: Optional[StrictStr] = Field(default=None, description="Primary organization name")
    location: Optional[StrictStr] = Field(default=None, description="Primary location")
    network: Optional[StrictStr] = Field(default=None, description="Network range or CIDR")
    registrar: Optional[StrictStr] = Field(default=None, description="Domain registrar")
    status: Optional[StrictStr] = Field(default=None, description="Domain status")
    asn_primary: Optional[StrictStr] = Field(default=None, description="Primary ASN")
    risk_score: Optional[Union[Annotated[float, Field(le=10, strict=True, ge=0)], Annotated[int, Field(le=10, strict=True, ge=0)]]] = Field(default=None, description="Composite risk score (0-10, higher is riskier)")
    ip_type: Optional[StrictStr] = Field(default=None, description="IP classification")
    total_domains: Optional[StrictInt] = Field(default=None, description="Total number of domains resolving to this IP")
    domain_name: Optional[StrictStr] = Field(default=None, description="The domain name")
    registration_date: Optional[StrictStr] = Field(default=None, description="Domain registration date")
    expiration_date: Optional[StrictStr] = Field(default=None, description="Domain expiration date")
    dns_provider: Optional[StrictStr] = Field(default=None, description="Primary DNS provider")
    total_links_in: Optional[StrictInt] = Field(default=None, description="Number of incoming links/backlinks")
    total_links_out: Optional[StrictInt] = Field(default=None, description="Number of outgoing links")
    __properties: ClassVar[List[str]] = ["organization", "location", "network", "registrar", "status", "asn_primary", "risk_score", "ip_type", "total_domains", "domain_name", "registration_date", "expiration_date", "dns_provider", "total_links_in", "total_links_out"]

    @field_validator('status')
    def status_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['active', 'expired', 'pending', 'suspended', 'deleted']):
            raise ValueError("must be one of enum values ('active', 'expired', 'pending', 'suspended', 'deleted')")
        return value

    @field_validator('ip_type')
    def ip_type_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['residential', 'business', 'datacenter', 'hosting', 'vpn', 'proxy', 'tor', 'mobile']):
            raise ValueError("must be one of enum values ('residential', 'business', 'datacenter', 'hosting', 'vpn', 'proxy', 'tor', 'mobile')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of SummaryInfo from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of SummaryInfo from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "organization": obj.get("organization"),
            "location": obj.get("location"),
            "network": obj.get("network"),
            "registrar": obj.get("registrar"),
            "status": obj.get("status"),
            "asn_primary": obj.get("asn_primary"),
            "risk_score": obj.get("risk_score"),
            "ip_type": obj.get("ip_type"),
            "total_domains": obj.get("total_domains"),
            "domain_name": obj.get("domain_name"),
            "registration_date": obj.get("registration_date"),
            "expiration_date": obj.get("expiration_date"),
            "dns_provider": obj.get("dns_provider"),
            "total_links_in": obj.get("total_links_in"),
            "total_links_out": obj.get("total_links_out")
        })
        return _obj


