# This file was auto-generated by Fern from our API Definition.

from ......core.unchecked_base_model import UncheckedBaseModel
import typing
from .agent import Agent
import pydantic
from ...base.types.timestamp import Timestamp
import datetime as dt
from .group import Group
from ...base.types.hostname import Hostname
from ...base.types.ip_address import IpAddress
from .user import User
from .graph import Graph
from .resource_details_role_id import ResourceDetailsRoleId
from .key_value_object import KeyValueObject
from ...base.types.resource_uid import ResourceUid
from ......core.pydantic_utilities import IS_PYDANTIC_V2


class ResourceDetails(UncheckedBaseModel):
    """
    The Resource Details object describes details about resources that were affected by the activity/event.
    """

    agent_list: typing.Optional[typing.List[Agent]] = pydantic.Field(default=None)
    """
    A list of <code>agent</code> objects associated with a device, endpoint, or resource.
    """

    cloud_partition: typing.Optional[str] = pydantic.Field(default=None)
    """
    The logical grouping or isolated segment within a cloud provider's infrastructure where the resource is located. Examples include AWS partitions (aws, aws-cn, aws-us-gov), Azure cloud environments (AzureCloud, AzureUSGovernment, AzureChinaCloud), or similar logical divisions in other cloud providers.
    """

    created_time: typing.Optional[Timestamp] = pydantic.Field(default=None)
    """
    The time when the resource was created.
    """

    created_time_dt: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The time when the resource was created.
    """

    criticality: typing.Optional[str] = pydantic.Field(default=None)
    """
    The criticality of the resource as defined by the event source.
    """

    data: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(default=None)
    """
    Additional data describing the resource.
    """

    group: typing.Optional[Group] = pydantic.Field(default=None)
    """
    The name of the related resource group.
    """

    hostname: typing.Optional[Hostname] = pydantic.Field(default=None)
    """
    The fully qualified name of the resource.
    """

    ip: typing.Optional[IpAddress] = pydantic.Field(default=None)
    """
    The IP address of the resource, in either IPv4 or IPv6 format.
    """

    is_backed_up: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether the device or resource has a backup enabled, such as an automated snapshot or a cloud backup. For example, this is indicated by the <code>cloudBackupEnabled</code> value within JAMF Pro mobile devices or the registration of an AWS ARN with the AWS Backup service.
    """

    labels: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    The list of labels associated to the resource.
    """

    modified_time: typing.Optional[Timestamp] = pydantic.Field(default=None)
    """
    The time when the resource was last modified.
    """

    modified_time_dt: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The time when the resource was last modified.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the resource.
    """

    namespace: typing.Optional[str] = pydantic.Field(default=None)
    """
    The namespace is useful when similar entities exist that you need to keep separate.
    """

    owner: typing.Optional[User] = pydantic.Field(default=None)
    """
    The details of the entity that owns the resource. This object includes properties such as the owner's name, unique identifier, type, domain, and other relevant attributes that help identify the resource owner within the environment.
    """

    provider: typing.Optional[str] = pydantic.Field(default=None)
    """
    The cloud service provider that hosts or manages the resource. This field is typically used when the resource is managed by a different provider than the one generating the event or finding. Examples include AWS, Azure, GCP (Google Cloud Platform), Oracle Cloud, IBM Cloud, Alibaba Cloud, or other public, private, or hybrid cloud providers.
    """

    region: typing.Optional[str] = pydantic.Field(default=None)
    """
    The cloud region where the resource is hosted, as defined by the cloud provider. This represents the physical or logical geographic area containing the infrastructure supporting the resource. Examples include AWS regions (us-east-1, eu-west-1), Azure regions (East US, West Europe), GCP regions (us-central1, europe-west1), or Oracle Cloud regions (us-ashburn-1, uk-london-1).
    """

    resource_relationship: typing.Optional[Graph] = pydantic.Field(default=None)
    """
    A graph representation showing how this resource relates to and interacts with other entities in the environment. This can include parent/child relationships, dependencies, or other connections.
    """

    role: typing.Optional[str] = pydantic.Field(default=None)
    """
    The role of the resource in the context of the event or finding, normalized to the caption of the role_id value. In the case of 'Other', it is defined by the event source.
    """

    role_id: typing.Optional[ResourceDetailsRoleId] = pydantic.Field(default=None)
    """
    The normalized identifier of the resource's role in the context of the event or finding.
    """

    tags: typing.Optional[typing.List[KeyValueObject]] = pydantic.Field(default=None)
    """
    The list of tags; <code>{key:value}</code> pairs associated to the resource.
    """

    type: typing.Optional[str] = pydantic.Field(default=None)
    """
    The resource type as defined by the event source.
    """

    uid: typing.Optional[ResourceUid] = pydantic.Field(default=None)
    """
    The unique identifier of the resource.
    """

    uid_alt: typing.Optional[ResourceUid] = pydantic.Field(default=None)
    """
    The alternative unique identifier of the resource.
    """

    version: typing.Optional[str] = pydantic.Field(default=None)
    """
    The version of the resource. For example <code>1.2.3</code>.
    """

    zone: typing.Optional[str] = pydantic.Field(default=None)
    """
    The availability zone within a cloud region where the resource is located. Examples include AWS availability zones (us-east-1a, us-east-1b), Azure availability zones (1, 2, 3 within a region), GCP zones (us-central1-a, us-central1-b), or Oracle Cloud availability domains (AD-1, AD-2, AD-3).
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
            extra="allow"
        )  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow
