# coding: utf-8

"""
    Identity Security Cloud V2025 API

    Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs.

    The version of the OpenAPI document: v2025
    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
import warnings

from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class FullDiscoveredApplications(BaseModel):
    """
    Discovered applications with their respective associated sources
    """ # noqa: E501
    id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the discovered application.")
    name: Optional[StrictStr] = Field(default=None, description="Name of the discovered application.")
    discovery_source: Optional[StrictStr] = Field(default=None, description="Source from which the application was discovered.", alias="discoverySource")
    discovered_vendor: Optional[StrictStr] = Field(default=None, description="The vendor associated with the discovered application.", alias="discoveredVendor")
    description: Optional[StrictStr] = Field(default=None, description="A brief description of the discovered application.")
    recommended_connectors: Optional[List[StrictStr]] = Field(default=None, description="List of recommended connectors for the application.", alias="recommendedConnectors")
    discovered_at: Optional[datetime] = Field(default=None, description="The timestamp when the application was last received via an entitlement aggregation invocation  or a manual csv upload, in ISO 8601 format.", alias="discoveredAt")
    created_at: Optional[datetime] = Field(default=None, description="The timestamp when the application was first discovered, in ISO 8601 format.", alias="createdAt")
    status: Optional[StrictStr] = Field(default=None, description="The status of an application within the discovery source.  By default this field is set to \"ACTIVE\" when the application is discovered.  If an application has been deleted from within the discovery source, the status will be set to \"INACTIVE\".")
    associated_sources: Optional[List[StrictStr]] = Field(default=None, description="List of associated sources related to this discovered application.", alias="associatedSources")
    operational_status: Optional[StrictStr] = Field(default=None, description="The operational status of the application.", alias="operationalStatus")
    discovery_source_category: Optional[StrictStr] = Field(default=None, description="The category of the discovery source.", alias="discoverySourceCategory")
    license_count: Optional[StrictInt] = Field(default=None, description="The number of licenses associated with the application.", alias="licenseCount")
    is_sanctioned: Optional[StrictBool] = Field(default=False, description="Indicates whether the application is sanctioned.", alias="isSanctioned")
    logo: Optional[StrictStr] = Field(default=None, description="URL of the application's logo.")
    app_url: Optional[StrictStr] = Field(default=None, description="The URL of the application.", alias="appUrl")
    groups: Optional[List[Dict[str, Any]]] = Field(default=None, description="List of groups associated with the application.")
    users_count: Optional[StrictStr] = Field(default=None, description="The count of users associated with the application.", alias="usersCount")
    application_owner: Optional[List[StrictStr]] = Field(default=None, description="The owners of the application.", alias="applicationOwner")
    it_application_owner: Optional[List[StrictStr]] = Field(default=None, description="The IT owners of the application.", alias="itApplicationOwner")
    business_criticality: Optional[StrictStr] = Field(default=None, description="The business criticality level of the application.", alias="businessCriticality")
    data_classification: Optional[StrictStr] = Field(default=None, description="The data classification level of the application.", alias="dataClassification")
    business_unit: Optional[StrictStr] = Field(default=None, description="The business unit associated with the application.", alias="businessUnit")
    install_type: Optional[StrictStr] = Field(default=None, description="The installation type of the application.", alias="installType")
    environment: Optional[StrictStr] = Field(default=None, description="The environment in which the application operates.")
    risk_score: Optional[StrictStr] = Field(default=None, description="The risk score of the application.", alias="riskScore")
    is_privileged: Optional[StrictBool] = Field(default=False, description="Indicates whether the application has privileged access.", alias="isPrivileged")
    warranty_expiration: Optional[StrictStr] = Field(default=None, description="The warranty expiration date of the application.", alias="warrantyExpiration")
    attributes: Optional[Dict[str, Any]] = Field(default=None, description="Additional attributes of the application useful for visibility of governance posture.")
    __properties: ClassVar[List[str]] = ["id", "name", "discoverySource", "discoveredVendor", "description", "recommendedConnectors", "discoveredAt", "createdAt", "status", "associatedSources", "operationalStatus", "discoverySourceCategory", "licenseCount", "isSanctioned", "logo", "appUrl", "groups", "usersCount", "applicationOwner", "itApplicationOwner", "businessCriticality", "dataClassification", "businessUnit", "installType", "environment", "riskScore", "isPrivileged", "warrantyExpiration", "attributes"]

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

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

        _obj = cls.model_validate({
            "id": obj.get("id"),
            "name": obj.get("name"),
            "discoverySource": obj.get("discoverySource"),
            "discoveredVendor": obj.get("discoveredVendor"),
            "description": obj.get("description"),
            "recommendedConnectors": obj.get("recommendedConnectors"),
            "discoveredAt": obj.get("discoveredAt"),
            "createdAt": obj.get("createdAt"),
            "status": obj.get("status"),
            "associatedSources": obj.get("associatedSources"),
            "operationalStatus": obj.get("operationalStatus"),
            "discoverySourceCategory": obj.get("discoverySourceCategory"),
            "licenseCount": obj.get("licenseCount"),
            "isSanctioned": obj.get("isSanctioned") if obj.get("isSanctioned") is not None else False,
            "logo": obj.get("logo"),
            "appUrl": obj.get("appUrl"),
            "groups": obj.get("groups"),
            "usersCount": obj.get("usersCount"),
            "applicationOwner": obj.get("applicationOwner"),
            "itApplicationOwner": obj.get("itApplicationOwner"),
            "businessCriticality": obj.get("businessCriticality"),
            "dataClassification": obj.get("dataClassification"),
            "businessUnit": obj.get("businessUnit"),
            "installType": obj.get("installType"),
            "environment": obj.get("environment"),
            "riskScore": obj.get("riskScore"),
            "isPrivileged": obj.get("isPrivileged") if obj.get("isPrivileged") is not None else False,
            "warrantyExpiration": obj.get("warrantyExpiration"),
            "attributes": obj.get("attributes")
        })
        return _obj


