"""
Main interface for guardduty service type definitions.

Usage::

    from mypy_boto3.guardduty.type_defs import AccountDetailTypeDef

    data: AccountDetailTypeDef = {...}
"""
import sys
from typing import Dict, List

if sys.version_info >= (3, 8):
    from typing import Literal
else:
    from typing_extensions import Literal
if sys.version_info >= (3, 8):
    from typing import TypedDict
else:
    from typing_extensions import TypedDict


__all__ = (
    "AccountDetailTypeDef",
    "CreateDetectorResponseTypeDef",
    "CreateFilterResponseTypeDef",
    "CreateIPSetResponseTypeDef",
    "UnprocessedAccountTypeDef",
    "CreateMembersResponseTypeDef",
    "CreatePublishingDestinationResponseTypeDef",
    "CreateThreatIntelSetResponseTypeDef",
    "DeclineInvitationsResponseTypeDef",
    "DeleteInvitationsResponseTypeDef",
    "DeleteMembersResponseTypeDef",
    "DestinationPropertiesTypeDef",
    "DescribePublishingDestinationResponseTypeDef",
    "DisassociateMembersResponseTypeDef",
    "ConditionTypeDef",
    "FindingCriteriaTypeDef",
    "GetDetectorResponseTypeDef",
    "GetFilterResponseTypeDef",
    "AccessKeyDetailsTypeDef",
    "IamInstanceProfileTypeDef",
    "PrivateIpAddressDetailsTypeDef",
    "SecurityGroupTypeDef",
    "NetworkInterfaceTypeDef",
    "ProductCodeTypeDef",
    "TagTypeDef",
    "InstanceDetailsTypeDef",
    "ResourceTypeDef",
    "DomainDetailsTypeDef",
    "CityTypeDef",
    "CountryTypeDef",
    "GeoLocationTypeDef",
    "OrganizationTypeDef",
    "RemoteIpDetailsTypeDef",
    "AwsApiCallActionTypeDef",
    "DnsRequestActionTypeDef",
    "LocalIpDetailsTypeDef",
    "LocalPortDetailsTypeDef",
    "RemotePortDetailsTypeDef",
    "NetworkConnectionActionTypeDef",
    "PortProbeDetailTypeDef",
    "PortProbeActionTypeDef",
    "ActionTypeDef",
    "ThreatIntelligenceDetailTypeDef",
    "EvidenceTypeDef",
    "ServiceTypeDef",
    "FindingTypeDef",
    "GetFindingsResponseTypeDef",
    "FindingStatisticsTypeDef",
    "GetFindingsStatisticsResponseTypeDef",
    "GetIPSetResponseTypeDef",
    "GetInvitationsCountResponseTypeDef",
    "MasterTypeDef",
    "GetMasterAccountResponseTypeDef",
    "MemberTypeDef",
    "GetMembersResponseTypeDef",
    "GetThreatIntelSetResponseTypeDef",
    "InviteMembersResponseTypeDef",
    "ListDetectorsResponseTypeDef",
    "ListFiltersResponseTypeDef",
    "ListFindingsResponseTypeDef",
    "ListIPSetsResponseTypeDef",
    "InvitationTypeDef",
    "ListInvitationsResponseTypeDef",
    "ListMembersResponseTypeDef",
    "DestinationTypeDef",
    "ListPublishingDestinationsResponseTypeDef",
    "ListTagsForResourceResponseTypeDef",
    "ListThreatIntelSetsResponseTypeDef",
    "PaginatorConfigTypeDef",
    "SortCriteriaTypeDef",
    "StartMonitoringMembersResponseTypeDef",
    "StopMonitoringMembersResponseTypeDef",
    "UpdateFilterResponseTypeDef",
)

AccountDetailTypeDef = TypedDict("AccountDetailTypeDef", {"AccountId": str, "Email": str})

CreateDetectorResponseTypeDef = TypedDict(
    "CreateDetectorResponseTypeDef", {"DetectorId": str}, total=False
)

CreateFilterResponseTypeDef = TypedDict("CreateFilterResponseTypeDef", {"Name": str})

CreateIPSetResponseTypeDef = TypedDict("CreateIPSetResponseTypeDef", {"IpSetId": str})

UnprocessedAccountTypeDef = TypedDict(
    "UnprocessedAccountTypeDef", {"AccountId": str, "Result": str}
)

CreateMembersResponseTypeDef = TypedDict(
    "CreateMembersResponseTypeDef", {"UnprocessedAccounts": List[UnprocessedAccountTypeDef]}
)

CreatePublishingDestinationResponseTypeDef = TypedDict(
    "CreatePublishingDestinationResponseTypeDef", {"DestinationId": str}
)

CreateThreatIntelSetResponseTypeDef = TypedDict(
    "CreateThreatIntelSetResponseTypeDef", {"ThreatIntelSetId": str}
)

DeclineInvitationsResponseTypeDef = TypedDict(
    "DeclineInvitationsResponseTypeDef", {"UnprocessedAccounts": List[UnprocessedAccountTypeDef]}
)

DeleteInvitationsResponseTypeDef = TypedDict(
    "DeleteInvitationsResponseTypeDef", {"UnprocessedAccounts": List[UnprocessedAccountTypeDef]}
)

DeleteMembersResponseTypeDef = TypedDict(
    "DeleteMembersResponseTypeDef", {"UnprocessedAccounts": List[UnprocessedAccountTypeDef]}
)

DestinationPropertiesTypeDef = TypedDict(
    "DestinationPropertiesTypeDef", {"DestinationArn": str, "KmsKeyArn": str}, total=False
)

DescribePublishingDestinationResponseTypeDef = TypedDict(
    "DescribePublishingDestinationResponseTypeDef",
    {
        "DestinationId": str,
        "DestinationType": Literal["S3"],
        "Status": Literal[
            "PENDING_VERIFICATION",
            "PUBLISHING",
            "UNABLE_TO_PUBLISH_FIX_DESTINATION_PROPERTY",
            "STOPPED",
        ],
        "PublishingFailureStartTimestamp": int,
        "DestinationProperties": DestinationPropertiesTypeDef,
    },
)

DisassociateMembersResponseTypeDef = TypedDict(
    "DisassociateMembersResponseTypeDef", {"UnprocessedAccounts": List[UnprocessedAccountTypeDef]}
)

ConditionTypeDef = TypedDict(
    "ConditionTypeDef",
    {
        "Eq": List[str],
        "Neq": List[str],
        "Gt": int,
        "Gte": int,
        "Lt": int,
        "Lte": int,
        "Equals": List[str],
        "NotEquals": List[str],
        "GreaterThan": int,
        "GreaterThanOrEqual": int,
        "LessThan": int,
        "LessThanOrEqual": int,
    },
    total=False,
)

FindingCriteriaTypeDef = TypedDict(
    "FindingCriteriaTypeDef", {"Criterion": Dict[str, ConditionTypeDef]}, total=False
)

_RequiredGetDetectorResponseTypeDef = TypedDict(
    "_RequiredGetDetectorResponseTypeDef",
    {"ServiceRole": str, "Status": Literal["ENABLED", "DISABLED"]},
)
_OptionalGetDetectorResponseTypeDef = TypedDict(
    "_OptionalGetDetectorResponseTypeDef",
    {
        "CreatedAt": str,
        "FindingPublishingFrequency": Literal["FIFTEEN_MINUTES", "ONE_HOUR", "SIX_HOURS"],
        "UpdatedAt": str,
        "Tags": Dict[str, str],
    },
    total=False,
)


class GetDetectorResponseTypeDef(
    _RequiredGetDetectorResponseTypeDef, _OptionalGetDetectorResponseTypeDef
):
    pass


_RequiredGetFilterResponseTypeDef = TypedDict(
    "_RequiredGetFilterResponseTypeDef",
    {"Name": str, "Action": Literal["NOOP", "ARCHIVE"], "FindingCriteria": FindingCriteriaTypeDef},
)
_OptionalGetFilterResponseTypeDef = TypedDict(
    "_OptionalGetFilterResponseTypeDef",
    {"Description": str, "Rank": int, "Tags": Dict[str, str]},
    total=False,
)


class GetFilterResponseTypeDef(
    _RequiredGetFilterResponseTypeDef, _OptionalGetFilterResponseTypeDef
):
    pass


AccessKeyDetailsTypeDef = TypedDict(
    "AccessKeyDetailsTypeDef",
    {"AccessKeyId": str, "PrincipalId": str, "UserName": str, "UserType": str},
    total=False,
)

IamInstanceProfileTypeDef = TypedDict(
    "IamInstanceProfileTypeDef", {"Arn": str, "Id": str}, total=False
)

PrivateIpAddressDetailsTypeDef = TypedDict(
    "PrivateIpAddressDetailsTypeDef", {"PrivateDnsName": str, "PrivateIpAddress": str}, total=False
)

SecurityGroupTypeDef = TypedDict(
    "SecurityGroupTypeDef", {"GroupId": str, "GroupName": str}, total=False
)

NetworkInterfaceTypeDef = TypedDict(
    "NetworkInterfaceTypeDef",
    {
        "Ipv6Addresses": List[str],
        "NetworkInterfaceId": str,
        "PrivateDnsName": str,
        "PrivateIpAddress": str,
        "PrivateIpAddresses": List[PrivateIpAddressDetailsTypeDef],
        "PublicDnsName": str,
        "PublicIp": str,
        "SecurityGroups": List[SecurityGroupTypeDef],
        "SubnetId": str,
        "VpcId": str,
    },
    total=False,
)

ProductCodeTypeDef = TypedDict("ProductCodeTypeDef", {"Code": str, "ProductType": str}, total=False)

TagTypeDef = TypedDict("TagTypeDef", {"Key": str, "Value": str}, total=False)

InstanceDetailsTypeDef = TypedDict(
    "InstanceDetailsTypeDef",
    {
        "AvailabilityZone": str,
        "IamInstanceProfile": IamInstanceProfileTypeDef,
        "ImageDescription": str,
        "ImageId": str,
        "InstanceId": str,
        "InstanceState": str,
        "InstanceType": str,
        "OutpostArn": str,
        "LaunchTime": str,
        "NetworkInterfaces": List[NetworkInterfaceTypeDef],
        "Platform": str,
        "ProductCodes": List[ProductCodeTypeDef],
        "Tags": List[TagTypeDef],
    },
    total=False,
)

ResourceTypeDef = TypedDict(
    "ResourceTypeDef",
    {
        "AccessKeyDetails": AccessKeyDetailsTypeDef,
        "InstanceDetails": InstanceDetailsTypeDef,
        "ResourceType": str,
    },
    total=False,
)

DomainDetailsTypeDef = TypedDict("DomainDetailsTypeDef", {"Domain": str}, total=False)

CityTypeDef = TypedDict("CityTypeDef", {"CityName": str}, total=False)

CountryTypeDef = TypedDict("CountryTypeDef", {"CountryCode": str, "CountryName": str}, total=False)

GeoLocationTypeDef = TypedDict("GeoLocationTypeDef", {"Lat": float, "Lon": float}, total=False)

OrganizationTypeDef = TypedDict(
    "OrganizationTypeDef", {"Asn": str, "AsnOrg": str, "Isp": str, "Org": str}, total=False
)

RemoteIpDetailsTypeDef = TypedDict(
    "RemoteIpDetailsTypeDef",
    {
        "City": CityTypeDef,
        "Country": CountryTypeDef,
        "GeoLocation": GeoLocationTypeDef,
        "IpAddressV4": str,
        "Organization": OrganizationTypeDef,
    },
    total=False,
)

AwsApiCallActionTypeDef = TypedDict(
    "AwsApiCallActionTypeDef",
    {
        "Api": str,
        "CallerType": str,
        "DomainDetails": DomainDetailsTypeDef,
        "RemoteIpDetails": RemoteIpDetailsTypeDef,
        "ServiceName": str,
    },
    total=False,
)

DnsRequestActionTypeDef = TypedDict("DnsRequestActionTypeDef", {"Domain": str}, total=False)

LocalIpDetailsTypeDef = TypedDict("LocalIpDetailsTypeDef", {"IpAddressV4": str}, total=False)

LocalPortDetailsTypeDef = TypedDict(
    "LocalPortDetailsTypeDef", {"Port": int, "PortName": str}, total=False
)

RemotePortDetailsTypeDef = TypedDict(
    "RemotePortDetailsTypeDef", {"Port": int, "PortName": str}, total=False
)

NetworkConnectionActionTypeDef = TypedDict(
    "NetworkConnectionActionTypeDef",
    {
        "Blocked": bool,
        "ConnectionDirection": str,
        "LocalPortDetails": LocalPortDetailsTypeDef,
        "Protocol": str,
        "LocalIpDetails": LocalIpDetailsTypeDef,
        "RemoteIpDetails": RemoteIpDetailsTypeDef,
        "RemotePortDetails": RemotePortDetailsTypeDef,
    },
    total=False,
)

PortProbeDetailTypeDef = TypedDict(
    "PortProbeDetailTypeDef",
    {
        "LocalPortDetails": LocalPortDetailsTypeDef,
        "LocalIpDetails": LocalIpDetailsTypeDef,
        "RemoteIpDetails": RemoteIpDetailsTypeDef,
    },
    total=False,
)

PortProbeActionTypeDef = TypedDict(
    "PortProbeActionTypeDef",
    {"Blocked": bool, "PortProbeDetails": List[PortProbeDetailTypeDef]},
    total=False,
)

ActionTypeDef = TypedDict(
    "ActionTypeDef",
    {
        "ActionType": str,
        "AwsApiCallAction": AwsApiCallActionTypeDef,
        "DnsRequestAction": DnsRequestActionTypeDef,
        "NetworkConnectionAction": NetworkConnectionActionTypeDef,
        "PortProbeAction": PortProbeActionTypeDef,
    },
    total=False,
)

ThreatIntelligenceDetailTypeDef = TypedDict(
    "ThreatIntelligenceDetailTypeDef",
    {"ThreatListName": str, "ThreatNames": List[str]},
    total=False,
)

EvidenceTypeDef = TypedDict(
    "EvidenceTypeDef",
    {"ThreatIntelligenceDetails": List[ThreatIntelligenceDetailTypeDef]},
    total=False,
)

ServiceTypeDef = TypedDict(
    "ServiceTypeDef",
    {
        "Action": ActionTypeDef,
        "Evidence": EvidenceTypeDef,
        "Archived": bool,
        "Count": int,
        "DetectorId": str,
        "EventFirstSeen": str,
        "EventLastSeen": str,
        "ResourceRole": str,
        "ServiceName": str,
        "UserFeedback": str,
    },
    total=False,
)

_RequiredFindingTypeDef = TypedDict(
    "_RequiredFindingTypeDef",
    {
        "AccountId": str,
        "Arn": str,
        "CreatedAt": str,
        "Id": str,
        "Region": str,
        "Resource": ResourceTypeDef,
        "SchemaVersion": str,
        "Severity": float,
        "Type": str,
        "UpdatedAt": str,
    },
)
_OptionalFindingTypeDef = TypedDict(
    "_OptionalFindingTypeDef",
    {
        "Confidence": float,
        "Description": str,
        "Partition": str,
        "Service": ServiceTypeDef,
        "Title": str,
    },
    total=False,
)


class FindingTypeDef(_RequiredFindingTypeDef, _OptionalFindingTypeDef):
    pass


GetFindingsResponseTypeDef = TypedDict(
    "GetFindingsResponseTypeDef", {"Findings": List[FindingTypeDef]}
)

FindingStatisticsTypeDef = TypedDict(
    "FindingStatisticsTypeDef", {"CountBySeverity": Dict[str, int]}, total=False
)

GetFindingsStatisticsResponseTypeDef = TypedDict(
    "GetFindingsStatisticsResponseTypeDef", {"FindingStatistics": FindingStatisticsTypeDef}
)

_RequiredGetIPSetResponseTypeDef = TypedDict(
    "_RequiredGetIPSetResponseTypeDef",
    {
        "Name": str,
        "Format": Literal["TXT", "STIX", "OTX_CSV", "ALIEN_VAULT", "PROOF_POINT", "FIRE_EYE"],
        "Location": str,
        "Status": Literal[
            "INACTIVE", "ACTIVATING", "ACTIVE", "DEACTIVATING", "ERROR", "DELETE_PENDING", "DELETED"
        ],
    },
)
_OptionalGetIPSetResponseTypeDef = TypedDict(
    "_OptionalGetIPSetResponseTypeDef", {"Tags": Dict[str, str]}, total=False
)


class GetIPSetResponseTypeDef(_RequiredGetIPSetResponseTypeDef, _OptionalGetIPSetResponseTypeDef):
    pass


GetInvitationsCountResponseTypeDef = TypedDict(
    "GetInvitationsCountResponseTypeDef", {"InvitationsCount": int}, total=False
)

MasterTypeDef = TypedDict(
    "MasterTypeDef",
    {"AccountId": str, "InvitationId": str, "RelationshipStatus": str, "InvitedAt": str},
    total=False,
)

GetMasterAccountResponseTypeDef = TypedDict(
    "GetMasterAccountResponseTypeDef", {"Master": MasterTypeDef}
)

_RequiredMemberTypeDef = TypedDict(
    "_RequiredMemberTypeDef",
    {"AccountId": str, "MasterId": str, "Email": str, "RelationshipStatus": str, "UpdatedAt": str},
)
_OptionalMemberTypeDef = TypedDict(
    "_OptionalMemberTypeDef", {"DetectorId": str, "InvitedAt": str}, total=False
)


class MemberTypeDef(_RequiredMemberTypeDef, _OptionalMemberTypeDef):
    pass


GetMembersResponseTypeDef = TypedDict(
    "GetMembersResponseTypeDef",
    {"Members": List[MemberTypeDef], "UnprocessedAccounts": List[UnprocessedAccountTypeDef]},
)

_RequiredGetThreatIntelSetResponseTypeDef = TypedDict(
    "_RequiredGetThreatIntelSetResponseTypeDef",
    {
        "Name": str,
        "Format": Literal["TXT", "STIX", "OTX_CSV", "ALIEN_VAULT", "PROOF_POINT", "FIRE_EYE"],
        "Location": str,
        "Status": Literal[
            "INACTIVE", "ACTIVATING", "ACTIVE", "DEACTIVATING", "ERROR", "DELETE_PENDING", "DELETED"
        ],
    },
)
_OptionalGetThreatIntelSetResponseTypeDef = TypedDict(
    "_OptionalGetThreatIntelSetResponseTypeDef", {"Tags": Dict[str, str]}, total=False
)


class GetThreatIntelSetResponseTypeDef(
    _RequiredGetThreatIntelSetResponseTypeDef, _OptionalGetThreatIntelSetResponseTypeDef
):
    pass


InviteMembersResponseTypeDef = TypedDict(
    "InviteMembersResponseTypeDef", {"UnprocessedAccounts": List[UnprocessedAccountTypeDef]}
)

_RequiredListDetectorsResponseTypeDef = TypedDict(
    "_RequiredListDetectorsResponseTypeDef", {"DetectorIds": List[str]}
)
_OptionalListDetectorsResponseTypeDef = TypedDict(
    "_OptionalListDetectorsResponseTypeDef", {"NextToken": str}, total=False
)


class ListDetectorsResponseTypeDef(
    _RequiredListDetectorsResponseTypeDef, _OptionalListDetectorsResponseTypeDef
):
    pass


_RequiredListFiltersResponseTypeDef = TypedDict(
    "_RequiredListFiltersResponseTypeDef", {"FilterNames": List[str]}
)
_OptionalListFiltersResponseTypeDef = TypedDict(
    "_OptionalListFiltersResponseTypeDef", {"NextToken": str}, total=False
)


class ListFiltersResponseTypeDef(
    _RequiredListFiltersResponseTypeDef, _OptionalListFiltersResponseTypeDef
):
    pass


_RequiredListFindingsResponseTypeDef = TypedDict(
    "_RequiredListFindingsResponseTypeDef", {"FindingIds": List[str]}
)
_OptionalListFindingsResponseTypeDef = TypedDict(
    "_OptionalListFindingsResponseTypeDef", {"NextToken": str}, total=False
)


class ListFindingsResponseTypeDef(
    _RequiredListFindingsResponseTypeDef, _OptionalListFindingsResponseTypeDef
):
    pass


_RequiredListIPSetsResponseTypeDef = TypedDict(
    "_RequiredListIPSetsResponseTypeDef", {"IpSetIds": List[str]}
)
_OptionalListIPSetsResponseTypeDef = TypedDict(
    "_OptionalListIPSetsResponseTypeDef", {"NextToken": str}, total=False
)


class ListIPSetsResponseTypeDef(
    _RequiredListIPSetsResponseTypeDef, _OptionalListIPSetsResponseTypeDef
):
    pass


InvitationTypeDef = TypedDict(
    "InvitationTypeDef",
    {"AccountId": str, "InvitationId": str, "RelationshipStatus": str, "InvitedAt": str},
    total=False,
)

ListInvitationsResponseTypeDef = TypedDict(
    "ListInvitationsResponseTypeDef",
    {"Invitations": List[InvitationTypeDef], "NextToken": str},
    total=False,
)

ListMembersResponseTypeDef = TypedDict(
    "ListMembersResponseTypeDef", {"Members": List[MemberTypeDef], "NextToken": str}, total=False
)

DestinationTypeDef = TypedDict(
    "DestinationTypeDef",
    {
        "DestinationId": str,
        "DestinationType": Literal["S3"],
        "Status": Literal[
            "PENDING_VERIFICATION",
            "PUBLISHING",
            "UNABLE_TO_PUBLISH_FIX_DESTINATION_PROPERTY",
            "STOPPED",
        ],
    },
)

_RequiredListPublishingDestinationsResponseTypeDef = TypedDict(
    "_RequiredListPublishingDestinationsResponseTypeDef", {"Destinations": List[DestinationTypeDef]}
)
_OptionalListPublishingDestinationsResponseTypeDef = TypedDict(
    "_OptionalListPublishingDestinationsResponseTypeDef", {"NextToken": str}, total=False
)


class ListPublishingDestinationsResponseTypeDef(
    _RequiredListPublishingDestinationsResponseTypeDef,
    _OptionalListPublishingDestinationsResponseTypeDef,
):
    pass


ListTagsForResourceResponseTypeDef = TypedDict(
    "ListTagsForResourceResponseTypeDef", {"Tags": Dict[str, str]}, total=False
)

_RequiredListThreatIntelSetsResponseTypeDef = TypedDict(
    "_RequiredListThreatIntelSetsResponseTypeDef", {"ThreatIntelSetIds": List[str]}
)
_OptionalListThreatIntelSetsResponseTypeDef = TypedDict(
    "_OptionalListThreatIntelSetsResponseTypeDef", {"NextToken": str}, total=False
)


class ListThreatIntelSetsResponseTypeDef(
    _RequiredListThreatIntelSetsResponseTypeDef, _OptionalListThreatIntelSetsResponseTypeDef
):
    pass


PaginatorConfigTypeDef = TypedDict(
    "PaginatorConfigTypeDef", {"MaxItems": int, "PageSize": int, "StartingToken": str}, total=False
)

SortCriteriaTypeDef = TypedDict(
    "SortCriteriaTypeDef", {"AttributeName": str, "OrderBy": Literal["ASC", "DESC"]}, total=False
)

StartMonitoringMembersResponseTypeDef = TypedDict(
    "StartMonitoringMembersResponseTypeDef",
    {"UnprocessedAccounts": List[UnprocessedAccountTypeDef]},
)

StopMonitoringMembersResponseTypeDef = TypedDict(
    "StopMonitoringMembersResponseTypeDef", {"UnprocessedAccounts": List[UnprocessedAccountTypeDef]}
)

UpdateFilterResponseTypeDef = TypedDict("UpdateFilterResponseTypeDef", {"Name": str})
