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

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

"""
from marshmallow import EXCLUDE, fields as marshmallow_fields  # type: ignore
from netapp_ontap.resource import Resource, ResourceSchema, ResourceSchemaMeta, ImpreciseDateTime, Size, lazy_import_schema


__all__ = ["Log", "LogSchema"]
__pdoc__ = {
    "LogSchema.resource": False,
    "LogSchema.opts": False,
    "Log": False,
}

class LogSchema(ResourceSchema, metaclass=ResourceSchemaMeta):
    """The fields of the Log object"""

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

    format = marshmallow_fields.Str(data_key="format", allow_none=True)
    r""" The format in which the logs are generated by consolidation process.
  Possible values are:

  * xml  - Data ONTAP-specific XML log format
  * evtx - Microsoft Windows EVTX log format


Valid choices:

* xml
* evtx """

    retention = marshmallow_fields.Nested(
                lambda: lazy_import_schema("netapp_ontap.models.log_retention", "LogRetentionSchema"),
                unknown=EXCLUDE,
                data_key="retention",
                allow_none=True
            )
    r""" The retention field of the log. """

    rotation = marshmallow_fields.Nested(
                lambda: lazy_import_schema("netapp_ontap.models.rotation", "RotationSchema"),
                unknown=EXCLUDE,
                data_key="rotation",
                allow_none=True
            )
    r""" Audit event log files are rotated when they reach a configured threshold log size or are on a configured schedule. When an event log file is rotated, the scheduled consolidation task first renames the active converted file to a time-stamped archive file, and then creates a new active converted event log file. """

    @property
    def resource(self):
        return Log

    gettable_fields = [
        "links",
        "format",
        "retention",
        "rotation",
    ]
    """links,format,retention,rotation,"""

    patchable_fields = [
        "format",
        "retention",
        "rotation",
    ]
    """format,retention,rotation,"""

    postable_fields = [
        "format",
        "retention",
        "rotation",
    ]
    """format,retention,rotation,"""


class Log(Resource):

    _schema = LogSchema
