r"""
Copyright &copy; 2026 NetApp Inc.
All rights reserved.

This file has been automatically generated based on the ONTAP REST API documentation.

The suspects DELETE API clears all the suspect files for a volume from the list of potential suspects. <br/>"""

import asyncio
from datetime import datetime
import inspect
from typing import Callable, Iterable, List, Optional, Union
from marshmallow import fields as marshmallow_fields, EXCLUDE  # type: ignore

import netapp_ontap
from netapp_ontap.resource import Resource, ResourceSchema, ResourceSchemaMeta, ImpreciseDateTime, Size, lazy_import_schema
from netapp_ontap.raw_resource import RawResource

from netapp_ontap import NetAppResponse, HostConnection
from netapp_ontap.validations import enum_validation, len_validation, integer_validation
from netapp_ontap.error import NetAppRestError


__all__ = ["AntiRansomwareSuspect", "AntiRansomwareSuspectSchema"]
__pdoc__ = {
    "AntiRansomwareSuspectSchema.resource": False,
    "AntiRansomwareSuspectSchema.opts": False,
}

class AntiRansomwareSuspectSchema(ResourceSchema, metaclass=ResourceSchemaMeta):
    """The fields of the AntiRansomwareSuspect object"""

    links = marshmallow_fields.Nested(
                lambda: lazy_import_schema("netapp_ontap.models.self_link", "SelfLinkSchema"),
                data_key="_links",
                unknown=EXCLUDE,
                allow_none=True
            )
    r""" The links field of the anti_ransomware_suspect."""

    file = marshmallow_fields.Nested(
                lambda: lazy_import_schema("netapp_ontap.models.anti_ransomware_suspect_file", "AntiRansomwareSuspectFileSchema"),
                data_key="file",
                unknown=EXCLUDE,
                allow_none=True
            )
    r""" The file field of the anti_ransomware_suspect."""

    volume = marshmallow_fields.Nested(
                lambda: lazy_import_schema("netapp_ontap.resources.volume", "VolumeSchema"),
                data_key="volume",
                unknown=EXCLUDE,
                allow_none=True
            )
    r""" The volume field of the anti_ransomware_suspect."""

    @property
    def resource(self):
        return AntiRansomwareSuspect

    gettable_fields = [
        "links",
        "file",
        "volume.links",
        "volume.name",
        "volume.uuid",
    ]
    """links,file,volume.links,volume.name,volume.uuid,"""

    patchable_fields = [
    ]
    """"""

    postable_fields = [
    ]
    """"""

class AntiRansomwareSuspect(Resource):
    r""" File suspected to be potentially attacked by ransomware. """

    _schema = AntiRansomwareSuspectSchema
    _path = "/api/security/anti-ransomware/suspects"
    _keys = ["volume.uuid"]

    @classmethod
    def get_collection(
        cls,
        *args,
        connection: HostConnection = None,
        max_records: int = None,
        **kwargs
    ) -> Iterable["Resource"]:
        r"""Retrieves information on the suspects generated by the anti-ransomware analytics.
### Related ONTAP commands
* `security anti-ransomware volume attack generate-report`

### Learn more
* [`DOC /security/anti-ransomware/suspects`](#docs-security-security_anti-ransomware_suspects)"""
        return super()._get_collection(*args, connection=connection, max_records=max_records, **kwargs)

    get_collection.__func__.__doc__ += "\n\n---\n" + inspect.cleandoc(Resource._get_collection.__doc__)

    @classmethod
    def count_collection(
        cls,
        *args,
        connection: HostConnection = None,
        **kwargs
    ) -> int:
        """Returns a count of all AntiRansomwareSuspect resources that match the provided query"""
        return super()._count_collection(*args, connection=connection, **kwargs)

    count_collection.__func__.__doc__ += "\n\n---\n" + inspect.cleandoc(Resource._count_collection.__doc__)


    @classmethod
    def fast_get_collection(
        cls,
        *args,
        connection: HostConnection = None,
        max_records: int = None,
        **kwargs
    ) -> Iterable["RawResource"]:
        """Returns a list of RawResources that represent AntiRansomwareSuspect resources that match the provided query"""
        return super()._get_collection(
            *args, connection=connection, max_records=max_records, raw=True, **kwargs
        )

    fast_get_collection.__func__.__doc__ += "\n\n---\n" + inspect.cleandoc(Resource._get_collection.__doc__)



    @classmethod
    def delete_collection(
        cls,
        *args,
        records: Iterable["AntiRansomwareSuspect"] = None,
        body: Union[Resource, dict] = None,
        poll: bool = True,
        poll_interval: Optional[int] = None,
        poll_timeout: Optional[int] = None,
        connection: HostConnection = None,
        **kwargs
    ) -> NetAppResponse:
        r"""Clears either all the suspect files of a volume or suspect files of a volume based on file format or suspect time provided.
### Related ONTAP commands
* `security anti-ransomware volume attack clear-suspect`

### Learn more
* [`DOC /security/anti-ransomware/suspects/{volume.uuid}`](#docs-security-security_anti-ransomware_suspects_{volume.uuid})"""
        return super()._delete_collection(
            *args, body=body, records=records, poll=poll, poll_interval=poll_interval,
            poll_timeout=poll_timeout, connection=connection, **kwargs
        )

    delete_collection.__func__.__doc__ += "\n\n---\n" + inspect.cleandoc(Resource._delete_collection.__doc__)

    @classmethod
    def find(cls, *args, connection: HostConnection = None, **kwargs) -> Resource:
        r"""Retrieves information on the suspects generated by the anti-ransomware analytics.
### Related ONTAP commands
* `security anti-ransomware volume attack generate-report`

### Learn more
* [`DOC /security/anti-ransomware/suspects`](#docs-security-security_anti-ransomware_suspects)"""
        return super()._find(*args, connection=connection, **kwargs)

    find.__func__.__doc__ += "\n\n---\n" + inspect.cleandoc(Resource._find.__doc__)




    def delete(
        self,
        body: Union[Resource, dict] = None,
        poll: bool = True,
        poll_interval: Optional[int] = None,
        poll_timeout: Optional[int] = None,
        **kwargs
    ) -> NetAppResponse:
        r"""Clears either all the suspect files of a volume or suspect files of a volume based on file format or suspect time provided.
### Related ONTAP commands
* `security anti-ransomware volume attack clear-suspect`

### Learn more
* [`DOC /security/anti-ransomware/suspects/{volume.uuid}`](#docs-security-security_anti-ransomware_suspects_{volume.uuid})"""
        return super()._delete(
            body=body, poll=poll, poll_interval=poll_interval,
            poll_timeout=poll_timeout, **kwargs
        )

    delete.__doc__ += "\n\n---\n" + inspect.cleandoc(Resource._delete.__doc__)


