# coding: utf-8

"""
    EVE Stable Infrastructure (ESI) - tranquility

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 2025-12-16
    Contact: arcyfa_github@pm.me
    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 datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self

class SovereigntyStructuresGetInner(BaseModel):
    """
    SovereigntyStructuresGetInner
    """ # noqa: E501
    alliance_id: StrictInt = Field(description="The alliance that owns the structure. ")
    solar_system_id: StrictInt = Field(description="Solar system in which the structure is located. ")
    structure_id: StrictInt = Field(description="Unique item ID for this structure.")
    structure_type_id: StrictInt = Field(description="A reference to the type of structure this is. ")
    vulnerability_occupancy_level: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The occupancy level for the next or current vulnerability window. This takes into account all development indexes and capital system bonuses. Also known as Activity Defense Multiplier from in the client. It increases the time that attackers must spend using their entosis links on the structure. ")
    vulnerable_end_time: Optional[datetime] = Field(default=None, description="The time at which the next or current vulnerability window ends. At the end of a vulnerability window the next window is recalculated and locked in along with the vulnerabilityOccupancyLevel. If the structure is not in 100% entosis control of the defender, it will go in to 'overtime' and stay vulnerable for as long as that situation persists. Only once the defenders have 100% entosis control and has the vulnerableEndTime passed does the vulnerability interval expire and a new one is calculated. ")
    vulnerable_start_time: Optional[datetime] = Field(default=None, description="The next time at which the structure will become vulnerable. Or the start time of the current window if current time is between this and vulnerableEndTime. ")
    __properties: ClassVar[List[str]] = ["alliance_id", "solar_system_id", "structure_id", "structure_type_id", "vulnerability_occupancy_level", "vulnerable_end_time", "vulnerable_start_time"]

    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 SovereigntyStructuresGetInner 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 SovereigntyStructuresGetInner from a dict"""
        if obj is None:
            return None

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

        _obj = cls.model_validate({
            "alliance_id": obj.get("alliance_id"),
            "solar_system_id": obj.get("solar_system_id"),
            "structure_id": obj.get("structure_id"),
            "structure_type_id": obj.get("structure_type_id"),
            "vulnerability_occupancy_level": obj.get("vulnerability_occupancy_level"),
            "vulnerable_end_time": obj.get("vulnerable_end_time"),
            "vulnerable_start_time": obj.get("vulnerable_start_time")
        })
        return _obj


