# pylint: disable=trailing-newlines
# pylint: disable=line-too-long
# pylint: disable=too-many-lines
# pylint: disable=unused-import
# pylint: disable=invalid-name

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


"""

from marshmallow import EXCLUDE, fields  # type: ignore
from netapp_ontap.resource import Resource, ResourceSchema


__all__ = ["SecurityKeyManagerOnboard", "SecurityKeyManagerOnboardSchema"]
__pdoc__ = {
    "SecurityKeyManagerOnboardSchema.resource": False,
    "SecurityKeyManagerOnboard": False,
}


class SecurityKeyManagerOnboardSchema(ResourceSchema):
    """The fields of the SecurityKeyManagerOnboard object"""

    enabled = fields.Boolean(data_key="enabled")
    r""" Is the onboard key manager enabled? """

    existing_passphrase = fields.Str(data_key="existing_passphrase")
    r""" The cluster-wide passphrase. This is not audited.

Example: The cluster password of length 32-256 ASCII characters. """

    key_backup = fields.Str(data_key="key_backup")
    r""" Backup of the onboard key manager's key hierarchy. It is required to save this backup after configuring the onboard key manager to help in the recovery of the cluster in case of catastrophic failures.

Example: '--------------------------BEGIN BACKUP-------------------------- TmV0QXBwIEtleSBCbG9iAAEAAAAEAAAAcAEAAAAAAAAxBFWWAAAAACEAAAAAAAAA QAAAAAAAAABzDyyVAAAAALI5Jsjvy6gUxnT78KoDKXHYb6sSeraM00quOULY6BeV n6dMFxuErCD1lbERaOQZSuaYy1p8oQHtTEfGMLZM4TYiAAAAAAAAACgAAAAAAAAA 3WTh7gAAAAAAAAAAAAAAAAIAAAAAAAgAZJEIWvdeHr5RCAvHGclo+wAAAAAAAAAA IgAAAAAAAAAoAAAAAAAAAEOTcR0AAAAAAAAAAAAAAAACAAAAAAAJAGr3tJA/LRzU QRHwv+1aWvAAAAAAAAAAACQAAAAAAAAAgAAAAAAAAADV1Vd/AAAAAMFM9Q229Bhp mDaTSdqku5DCd8wG+fOZSr4bx4JT5WHvV/r5gJnXDQQAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAACAAAAAAABAMoI9UxrHOGthQm/CB+EHdAAAAAAAAAAACQAAAAAAAAA gAAAAAAAAACnMmUtAAAAAGVk8AtPzENFgsGdsFvnmucmYrlQCsFew0HDSFKaZqK6 W8IEVzBAhPoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ---------------------------END BACKUP---------------------------' """

    passphrase = fields.Str(data_key="passphrase")
    r""" The cluster-wide passphrase. This is not audited.

Example: The cluster password of length 32-256 ASCII characters. """

    synchronize = fields.Boolean(data_key="synchronize")
    r""" Synchronizes missing onboard keys on any node in the cluster. If a node is added to a cluster that has onboard key management configured, the synchronize operation needs to be performed in a PATCH operation. In a MetroCluster configuration, if onboard key management is enabled on one site, then the synchronize operation needs to be run as a POST operation on the remote site providing the same passphrase. """

    @property
    def resource(self):
        return SecurityKeyManagerOnboard

    @property
    def patchable_fields(self):
        return [
            "existing_passphrase",
            "passphrase",
            "synchronize",
        ]

    @property
    def postable_fields(self):
        return [
            "passphrase",
            "synchronize",
        ]


class SecurityKeyManagerOnboard(Resource):  # pylint: disable=missing-docstring

    _schema = SecurityKeyManagerOnboardSchema
