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__ = ["S3Log", "S3LogSchema"]
__pdoc__ = {
    "S3LogSchema.resource": False,
    "S3LogSchema.opts": False,
    "S3Log": False,
}

class S3LogSchema(ResourceSchema, metaclass=ResourceSchemaMeta):
    """The fields of the S3Log 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 s3_log. """

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

  * json  - ONTAP-specific Json log format.


Valid choices:

* json """

    retention = marshmallow_fields.Nested(
                lambda: lazy_import_schema("netapp_ontap.models.s3_log_retention", "S3LogRetentionSchema"),
                unknown=EXCLUDE,
                data_key="retention",
                allow_none=True
            )
    r""" The retention field of the s3_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 S3Log

    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 S3Log(Resource):

    _schema = S3LogSchema
