# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command(
    "netappfiles cache update",
)
class Update(AAZCommand):
    """Update the specified Cache within the Capacity Pool

    :example: Caches_CreateOrUpdate
        az netappfiles cache update --resource-group myRG --account-name account1 --pool-name pool1 --cache-name cache1 --size 107374182400
    """

    _aaz_info = {
        "version": "2026-04-01",
        "resources": [
            ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts/{}/capacitypools/{}/caches/{}", "2026-04-01"],
        ]
    }

    AZ_SUPPORT_NO_WAIT = True

    AZ_SUPPORT_GENERIC_UPDATE = True

    def _handler(self, command_args):
        super()._handler(command_args)
        return self.build_lro_poller(self._execute_operations, self._output)

    _args_schema = None

    @classmethod
    def _build_arguments_schema(cls, *args, **kwargs):
        if cls._args_schema is not None:
            return cls._args_schema
        cls._args_schema = super()._build_arguments_schema(*args, **kwargs)

        # define Arg Group ""

        _args_schema = cls._args_schema
        _args_schema.account_name = AAZStrArg(
            options=["-a", "--account-name"],
            help="The name of the NetApp account",
            required=True,
            id_part="name",
            fmt=AAZStrArgFormat(
                pattern="^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,127}$",
            ),
        )
        _args_schema.cache_name = AAZStrArg(
            options=["-n", "--name", "--cache-name"],
            help="The name of the cache resource.",
            required=True,
            id_part="child_name_2",
            fmt=AAZStrArgFormat(
                pattern="^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$",
                max_length=64,
                min_length=3,
            ),
        )
        _args_schema.pool_name = AAZStrArg(
            options=["-p", "--pool-name"],
            help="The name of the capacity pool",
            required=True,
            id_part="child_name_1",
            fmt=AAZStrArgFormat(
                pattern="^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$",
                max_length=64,
                min_length=1,
            ),
        )
        _args_schema.resource_group = AAZResourceGroupNameArg(
            required=True,
        )

        # define Arg Group "Body"

        _args_schema = cls._args_schema
        _args_schema.tags = AAZDictArg(
            options=["--tags"],
            arg_group="Body",
            help="Resource tags.",
            nullable=True,
        )

        tags = cls._args_schema.tags
        tags.Element = AAZStrArg(
            nullable=True,
        )

        # define Arg Group "ExportPolicy"

        _args_schema = cls._args_schema
        _args_schema.export_policy_rules = AAZListArg(
            options=["--rules", "--export-policy-rules"],
            arg_group="ExportPolicy",
            help="Export policy rule",
            nullable=True,
        )

        export_policy_rules = cls._args_schema.export_policy_rules
        export_policy_rules.Element = AAZObjectArg(
            nullable=True,
        )

        _element = cls._args_schema.export_policy_rules.Element
        _element.allowed_clients = AAZStrArg(
            options=["allowed-clients"],
            help="Client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names",
            nullable=True,
        )
        _element.chown_mode = AAZStrArg(
            options=["chown-mode"],
            help="This parameter specifies who is authorized to change the ownership of a file. restricted - Only root user can change the ownership of the file. unrestricted - Non-root users can change ownership of files that they own.",
            nullable=True,
            enum={"Restricted": "Restricted", "Unrestricted": "Unrestricted"},
        )
        _element.cifs = AAZBoolArg(
            options=["cifs"],
            help="Allows CIFS protocol",
            nullable=True,
        )
        _element.has_root_access = AAZBoolArg(
            options=["has-root-access"],
            help="Has root access to volume",
            nullable=True,
        )
        _element.kerberos5_read_only = AAZBoolArg(
            options=["kerberos5-read-only"],
            help="Kerberos5 Read only access. To be use with swagger version 2020-05-01 or later",
            nullable=True,
        )
        _element.kerberos5_read_write = AAZBoolArg(
            options=["kerberos5-read-write"],
            help="Kerberos5 Read and write access. To be use with swagger version 2020-05-01 or later",
            nullable=True,
        )
        _element.kerberos5i_read_only = AAZBoolArg(
            options=["kerberos5i-read-only"],
            help="Kerberos5i Read only access. To be use with swagger version 2020-05-01 or later",
            nullable=True,
        )
        _element.kerberos5i_read_write = AAZBoolArg(
            options=["kerberos5i-read-write"],
            help="Kerberos5i Read and write access. To be use with swagger version 2020-05-01 or later",
            nullable=True,
        )
        _element.kerberos5p_read_only = AAZBoolArg(
            options=["kerberos5p-read-only"],
            help="Kerberos5p Read only access. To be use with swagger version 2020-05-01 or later",
            nullable=True,
        )
        _element.kerberos5p_read_write = AAZBoolArg(
            options=["kerberos5p-read-write"],
            help="Kerberos5p Read and write access. To be use with swagger version 2020-05-01 or later",
            nullable=True,
        )
        _element.nfsv3 = AAZBoolArg(
            options=["nfsv3"],
            help="Allows NFSv3 protocol. Enable only for NFSv3 type volumes",
            nullable=True,
        )
        _element.nfsv41 = AAZBoolArg(
            options=["nfsv41"],
            help="Allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes",
            nullable=True,
        )
        _element.rule_index = AAZIntArg(
            options=["rule-index"],
            help="Order index",
            nullable=True,
        )
        _element.unix_read_only = AAZBoolArg(
            options=["unix-read-only"],
            help="Read only access",
            nullable=True,
        )
        _element.unix_read_write = AAZBoolArg(
            options=["unix-read-write"],
            help="Read and write access",
            nullable=True,
        )

        # define Arg Group "Properties"

        _args_schema = cls._args_schema
        _args_schema.cifs_change_notifications = AAZStrArg(
            options=["--cifs-change-notify", "--cifs-change-notifications"],
            arg_group="Properties",
            help="Flag indicating whether a CIFS change notification is enabled for the cache.",
            nullable=True,
            enum={"Disabled": "Disabled", "Enabled": "Enabled"},
        )
        _args_schema.key_vault_private_endpoint_resource_id = AAZResourceIdArg(
            options=["--kv-private-endpoint-id", "--key-vault-private-endpoint-resource-id"],
            arg_group="Properties",
            help="The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'.",
            nullable=True,
        )
        _args_schema.protocol_types = AAZListArg(
            options=["--protocol-types"],
            arg_group="Properties",
            help="Set of supported protocol types, which include NFSv3, NFSv4 and SMB protocol",
            nullable=True,
        )
        _args_schema.size = AAZIntArg(
            options=["--size"],
            arg_group="Properties",
            help="Maximum storage quota allowed for a file system in bytes. Valid values are in the range 50GiB to 1PiB. Values expressed in bytes as multiples of 1GiB.",
            fmt=AAZIntArgFormat(
                maximum=1125899906842624,
                minimum=53687091200,
            ),
        )
        _args_schema.throughput_mibps = AAZFloatArg(
            options=["--throughput-mibps"],
            arg_group="Properties",
            help="Maximum throughput in MiB/s that can be achieved by this cache volume and this will be accepted as input only for manual qosType cache",
            nullable=True,
        )
        _args_schema.write_back = AAZStrArg(
            options=["--write-back"],
            arg_group="Properties",
            help="Flag indicating whether writeback is enabled for the cache.",
            nullable=True,
            enum={"Disabled": "Disabled", "Enabled": "Enabled"},
        )

        protocol_types = cls._args_schema.protocol_types
        protocol_types.Element = AAZStrArg(
            nullable=True,
            enum={"NFSv3": "NFSv3", "NFSv4": "NFSv4", "SMB": "SMB"},
        )

        # define Arg Group "SmbSettings"

        _args_schema = cls._args_schema
        _args_schema.smb_access_based_enumeration = AAZStrArg(
            options=["--smb-access-enumeration", "--smb-access-based-enumeration"],
            arg_group="SmbSettings",
            help="Enables access-based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume",
            nullable=True,
            enum={"Disabled": "Disabled", "Enabled": "Enabled"},
        )
        _args_schema.smb_encryption = AAZStrArg(
            options=["--smb-encryption"],
            arg_group="SmbSettings",
            help="Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol cache.",
            nullable=True,
            enum={"Disabled": "Disabled", "Enabled": "Enabled"},
        )
        _args_schema.smb_non_browsable = AAZStrArg(
            options=["--smb-non-browsable"],
            arg_group="SmbSettings",
            help="Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume",
            nullable=True,
            enum={"Disabled": "Disabled", "Enabled": "Enabled"},
        )
        return cls._args_schema

    def _execute_operations(self):
        self.pre_operations()
        self.CachesGet(ctx=self.ctx)()
        self.pre_instance_update(self.ctx.vars.instance)
        self.InstanceUpdateByJson(ctx=self.ctx)()
        self.InstanceUpdateByGeneric(ctx=self.ctx)()
        self.post_instance_update(self.ctx.vars.instance)
        yield self.CachesCreateOrUpdate(ctx=self.ctx)()
        self.post_operations()

    @register_callback
    def pre_operations(self):
        pass

    @register_callback
    def post_operations(self):
        pass

    @register_callback
    def pre_instance_update(self, instance):
        pass

    @register_callback
    def post_instance_update(self, instance):
        pass

    def _output(self, *args, **kwargs):
        result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
        return result

    class CachesGet(AAZHttpOperation):
        CLIENT_TYPE = "MgmtClient"

        def __call__(self, *args, **kwargs):
            request = self.make_request()
            session = self.client.send_request(request=request, stream=False, **kwargs)
            if session.http_response.status_code in [200]:
                return self.on_200(session)

            return self.on_error(session.http_response)

        @property
        def url(self):
            return self.client.format_url(
                "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/caches/{cacheName}",
                **self.url_parameters
            )

        @property
        def method(self):
            return "GET"

        @property
        def error_format(self):
            return "MgmtErrorFormat"

        @property
        def url_parameters(self):
            parameters = {
                **self.serialize_url_param(
                    "accountName", self.ctx.args.account_name,
                    required=True,
                ),
                **self.serialize_url_param(
                    "cacheName", self.ctx.args.cache_name,
                    required=True,
                ),
                **self.serialize_url_param(
                    "poolName", self.ctx.args.pool_name,
                    required=True,
                ),
                **self.serialize_url_param(
                    "resourceGroupName", self.ctx.args.resource_group,
                    required=True,
                ),
                **self.serialize_url_param(
                    "subscriptionId", self.ctx.subscription_id,
                    required=True,
                ),
            }
            return parameters

        @property
        def query_parameters(self):
            parameters = {
                **self.serialize_query_param(
                    "api-version", "2026-04-01",
                    required=True,
                ),
            }
            return parameters

        @property
        def header_parameters(self):
            parameters = {
                **self.serialize_header_param(
                    "Accept", "application/json",
                ),
            }
            return parameters

        def on_200(self, session):
            data = self.deserialize_http_content(session)
            self.ctx.set_var(
                "instance",
                data,
                schema_builder=self._build_schema_on_200
            )

        _schema_on_200 = None

        @classmethod
        def _build_schema_on_200(cls):
            if cls._schema_on_200 is not None:
                return cls._schema_on_200

            cls._schema_on_200 = AAZObjectType()
            _UpdateHelper._build_schema_cache_read(cls._schema_on_200)

            return cls._schema_on_200

    class CachesCreateOrUpdate(AAZHttpOperation):
        CLIENT_TYPE = "MgmtClient"

        def __call__(self, *args, **kwargs):
            request = self.make_request()
            session = self.client.send_request(request=request, stream=False, **kwargs)
            if session.http_response.status_code in [202]:
                return self.client.build_lro_polling(
                    self.ctx.args.no_wait,
                    session,
                    self.on_200_201,
                    self.on_error,
                    lro_options={"final-state-via": "azure-async-operation"},
                    path_format_arguments=self.url_parameters,
                )
            if session.http_response.status_code in [200, 201]:
                return self.client.build_lro_polling(
                    self.ctx.args.no_wait,
                    session,
                    self.on_200_201,
                    self.on_error,
                    lro_options={"final-state-via": "azure-async-operation"},
                    path_format_arguments=self.url_parameters,
                )

            return self.on_error(session.http_response)

        @property
        def url(self):
            return self.client.format_url(
                "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/caches/{cacheName}",
                **self.url_parameters
            )

        @property
        def method(self):
            return "PUT"

        @property
        def error_format(self):
            return "MgmtErrorFormat"

        @property
        def url_parameters(self):
            parameters = {
                **self.serialize_url_param(
                    "accountName", self.ctx.args.account_name,
                    required=True,
                ),
                **self.serialize_url_param(
                    "cacheName", self.ctx.args.cache_name,
                    required=True,
                ),
                **self.serialize_url_param(
                    "poolName", self.ctx.args.pool_name,
                    required=True,
                ),
                **self.serialize_url_param(
                    "resourceGroupName", self.ctx.args.resource_group,
                    required=True,
                ),
                **self.serialize_url_param(
                    "subscriptionId", self.ctx.subscription_id,
                    required=True,
                ),
            }
            return parameters

        @property
        def query_parameters(self):
            parameters = {
                **self.serialize_query_param(
                    "api-version", "2026-04-01",
                    required=True,
                ),
            }
            return parameters

        @property
        def header_parameters(self):
            parameters = {
                **self.serialize_header_param(
                    "Content-Type", "application/json",
                ),
                **self.serialize_header_param(
                    "Accept", "application/json",
                ),
            }
            return parameters

        @property
        def content(self):
            _content_value, _builder = self.new_content_builder(
                self.ctx.args,
                value=self.ctx.vars.instance,
            )

            return self.serialize_content(_content_value)

        def on_200_201(self, session):
            data = self.deserialize_http_content(session)
            self.ctx.set_var(
                "instance",
                data,
                schema_builder=self._build_schema_on_200_201
            )

        _schema_on_200_201 = None

        @classmethod
        def _build_schema_on_200_201(cls):
            if cls._schema_on_200_201 is not None:
                return cls._schema_on_200_201

            cls._schema_on_200_201 = AAZObjectType()
            _UpdateHelper._build_schema_cache_read(cls._schema_on_200_201)

            return cls._schema_on_200_201

    class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):

        def __call__(self, *args, **kwargs):
            self._update_instance(self.ctx.vars.instance)

        def _update_instance(self, instance):
            _instance_value, _builder = self.new_content_builder(
                self.ctx.args,
                value=instance,
                typ=AAZObjectType
            )
            _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
            _builder.set_prop("tags", AAZDictType, ".tags")

            properties = _builder.get(".properties")
            if properties is not None:
                properties.set_prop("cifsChangeNotifications", AAZStrType, ".cifs_change_notifications")
                properties.set_prop("exportPolicy", AAZObjectType)
                properties.set_prop("keyVaultPrivateEndpointResourceId", AAZStrType, ".key_vault_private_endpoint_resource_id")
                properties.set_prop("protocolTypes", AAZListType, ".protocol_types")
                properties.set_prop("size", AAZIntType, ".size", typ_kwargs={"flags": {"required": True}})
                properties.set_prop("smbSettings", AAZObjectType)
                properties.set_prop("throughputMibps", AAZFloatType, ".throughput_mibps")
                properties.set_prop("writeBack", AAZStrType, ".write_back")

            export_policy = _builder.get(".properties.exportPolicy")
            if export_policy is not None:
                export_policy.set_prop("rules", AAZListType, ".export_policy_rules")

            rules = _builder.get(".properties.exportPolicy.rules")
            if rules is not None:
                rules.set_elements(AAZObjectType, ".")

            _elements = _builder.get(".properties.exportPolicy.rules[]")
            if _elements is not None:
                _elements.set_prop("allowedClients", AAZStrType, ".allowed_clients")
                _elements.set_prop("chownMode", AAZStrType, ".chown_mode")
                _elements.set_prop("cifs", AAZBoolType, ".cifs")
                _elements.set_prop("hasRootAccess", AAZBoolType, ".has_root_access")
                _elements.set_prop("kerberos5ReadOnly", AAZBoolType, ".kerberos5_read_only")
                _elements.set_prop("kerberos5ReadWrite", AAZBoolType, ".kerberos5_read_write")
                _elements.set_prop("kerberos5iReadOnly", AAZBoolType, ".kerberos5i_read_only")
                _elements.set_prop("kerberos5iReadWrite", AAZBoolType, ".kerberos5i_read_write")
                _elements.set_prop("kerberos5pReadOnly", AAZBoolType, ".kerberos5p_read_only")
                _elements.set_prop("kerberos5pReadWrite", AAZBoolType, ".kerberos5p_read_write")
                _elements.set_prop("nfsv3", AAZBoolType, ".nfsv3")
                _elements.set_prop("nfsv41", AAZBoolType, ".nfsv41")
                _elements.set_prop("ruleIndex", AAZIntType, ".rule_index")
                _elements.set_prop("unixReadOnly", AAZBoolType, ".unix_read_only")
                _elements.set_prop("unixReadWrite", AAZBoolType, ".unix_read_write")

            protocol_types = _builder.get(".properties.protocolTypes")
            if protocol_types is not None:
                protocol_types.set_elements(AAZStrType, ".")

            smb_settings = _builder.get(".properties.smbSettings")
            if smb_settings is not None:
                smb_settings.set_prop("smbAccessBasedEnumeration", AAZStrType, ".smb_access_based_enumeration")
                smb_settings.set_prop("smbEncryption", AAZStrType, ".smb_encryption")
                smb_settings.set_prop("smbNonBrowsable", AAZStrType, ".smb_non_browsable")

            tags = _builder.get(".tags")
            if tags is not None:
                tags.set_elements(AAZStrType, ".")

            return _instance_value

    class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation):

        def __call__(self, *args, **kwargs):
            self._update_instance_by_generic(
                self.ctx.vars.instance,
                self.ctx.generic_update_args
            )


class _UpdateHelper:
    """Helper class for Update"""

    _schema_cache_read = None

    @classmethod
    def _build_schema_cache_read(cls, _schema):
        if cls._schema_cache_read is not None:
            _schema.etag = cls._schema_cache_read.etag
            _schema.id = cls._schema_cache_read.id
            _schema.location = cls._schema_cache_read.location
            _schema.name = cls._schema_cache_read.name
            _schema.properties = cls._schema_cache_read.properties
            _schema.system_data = cls._schema_cache_read.system_data
            _schema.tags = cls._schema_cache_read.tags
            _schema.type = cls._schema_cache_read.type
            _schema.zones = cls._schema_cache_read.zones
            return

        cls._schema_cache_read = _schema_cache_read = AAZObjectType()

        cache_read = _schema_cache_read
        cache_read.etag = AAZStrType(
            flags={"read_only": True},
        )
        cache_read.id = AAZStrType(
            flags={"read_only": True},
        )
        cache_read.location = AAZStrType(
            flags={"required": True},
        )
        cache_read.name = AAZStrType(
            flags={"read_only": True},
        )
        cache_read.properties = AAZObjectType(
            flags={"required": True},
        )
        cache_read.system_data = AAZObjectType(
            serialized_name="systemData",
            flags={"read_only": True},
        )
        cache_read.tags = AAZDictType()
        cache_read.type = AAZStrType(
            flags={"read_only": True},
        )
        cache_read.zones = AAZListType()

        properties = _schema_cache_read.properties
        properties.actual_throughput_mibps = AAZFloatType(
            serialized_name="actualThroughputMibps",
            flags={"read_only": True},
        )
        properties.cache_state = AAZStrType(
            serialized_name="cacheState",
            flags={"read_only": True},
        )
        properties.cache_subnet_resource_id = AAZStrType(
            serialized_name="cacheSubnetResourceId",
            flags={"required": True},
        )
        properties.cifs_change_notifications = AAZStrType(
            serialized_name="cifsChangeNotifications",
        )
        properties.encryption = AAZStrType(
            flags={"read_only": True},
        )
        properties.encryption_key_source = AAZStrType(
            serialized_name="encryptionKeySource",
            flags={"required": True},
        )
        properties.export_policy = AAZObjectType(
            serialized_name="exportPolicy",
        )
        properties.file_access_logs = AAZStrType(
            serialized_name="fileAccessLogs",
            flags={"read_only": True},
        )
        properties.file_path = AAZStrType(
            serialized_name="filePath",
            flags={"required": True},
        )
        properties.global_file_locking = AAZStrType(
            serialized_name="globalFileLocking",
        )
        properties.kerberos = AAZStrType()
        properties.key_vault_private_endpoint_resource_id = AAZStrType(
            serialized_name="keyVaultPrivateEndpointResourceId",
        )
        properties.language = AAZStrType(
            flags={"read_only": True},
        )
        properties.ldap = AAZStrType()
        properties.ldap_server_type = AAZStrType(
            serialized_name="ldapServerType",
        )
        properties.maximum_number_of_files = AAZIntType(
            serialized_name="maximumNumberOfFiles",
            flags={"read_only": True},
        )
        properties.mount_targets = AAZListType(
            serialized_name="mountTargets",
            flags={"read_only": True},
        )
        properties.origin_cluster_information = AAZObjectType(
            serialized_name="originClusterInformation",
            flags={"required": True},
        )
        properties.peering_subnet_resource_id = AAZStrType(
            serialized_name="peeringSubnetResourceId",
            flags={"required": True},
        )
        properties.protocol_types = AAZListType(
            serialized_name="protocolTypes",
        )
        properties.provisioning_state = AAZStrType(
            serialized_name="provisioningState",
            flags={"read_only": True},
        )
        properties.size = AAZIntType(
            flags={"required": True},
        )
        properties.smb_settings = AAZObjectType(
            serialized_name="smbSettings",
        )
        properties.throughput_mibps = AAZFloatType(
            serialized_name="throughputMibps",
        )
        properties.write_back = AAZStrType(
            serialized_name="writeBack",
        )

        export_policy = _schema_cache_read.properties.export_policy
        export_policy.rules = AAZListType()

        rules = _schema_cache_read.properties.export_policy.rules
        rules.Element = AAZObjectType()

        _element = _schema_cache_read.properties.export_policy.rules.Element
        _element.allowed_clients = AAZStrType(
            serialized_name="allowedClients",
        )
        _element.chown_mode = AAZStrType(
            serialized_name="chownMode",
        )
        _element.cifs = AAZBoolType()
        _element.has_root_access = AAZBoolType(
            serialized_name="hasRootAccess",
        )
        _element.kerberos5_read_only = AAZBoolType(
            serialized_name="kerberos5ReadOnly",
        )
        _element.kerberos5_read_write = AAZBoolType(
            serialized_name="kerberos5ReadWrite",
        )
        _element.kerberos5i_read_only = AAZBoolType(
            serialized_name="kerberos5iReadOnly",
        )
        _element.kerberos5i_read_write = AAZBoolType(
            serialized_name="kerberos5iReadWrite",
        )
        _element.kerberos5p_read_only = AAZBoolType(
            serialized_name="kerberos5pReadOnly",
        )
        _element.kerberos5p_read_write = AAZBoolType(
            serialized_name="kerberos5pReadWrite",
        )
        _element.nfsv3 = AAZBoolType()
        _element.nfsv41 = AAZBoolType()
        _element.rule_index = AAZIntType(
            serialized_name="ruleIndex",
        )
        _element.unix_read_only = AAZBoolType(
            serialized_name="unixReadOnly",
        )
        _element.unix_read_write = AAZBoolType(
            serialized_name="unixReadWrite",
        )

        mount_targets = _schema_cache_read.properties.mount_targets
        mount_targets.Element = AAZObjectType()

        _element = _schema_cache_read.properties.mount_targets.Element
        _element.ip_address = AAZStrType(
            serialized_name="ipAddress",
            flags={"read_only": True},
        )
        _element.mount_target_id = AAZStrType(
            serialized_name="mountTargetId",
            flags={"read_only": True},
        )
        _element.smb_server_fqdn = AAZStrType(
            serialized_name="smbServerFqdn",
            flags={"read_only": True},
        )

        origin_cluster_information = _schema_cache_read.properties.origin_cluster_information
        origin_cluster_information.peer_addresses = AAZListType(
            serialized_name="peerAddresses",
            flags={"required": True},
        )
        origin_cluster_information.peer_cluster_name = AAZStrType(
            serialized_name="peerClusterName",
            flags={"required": True},
        )
        origin_cluster_information.peer_volume_name = AAZStrType(
            serialized_name="peerVolumeName",
            flags={"required": True},
        )
        origin_cluster_information.peer_vserver_name = AAZStrType(
            serialized_name="peerVserverName",
            flags={"required": True},
        )

        peer_addresses = _schema_cache_read.properties.origin_cluster_information.peer_addresses
        peer_addresses.Element = AAZStrType()

        protocol_types = _schema_cache_read.properties.protocol_types
        protocol_types.Element = AAZStrType()

        smb_settings = _schema_cache_read.properties.smb_settings
        smb_settings.smb_access_based_enumeration = AAZStrType(
            serialized_name="smbAccessBasedEnumeration",
        )
        smb_settings.smb_encryption = AAZStrType(
            serialized_name="smbEncryption",
        )
        smb_settings.smb_non_browsable = AAZStrType(
            serialized_name="smbNonBrowsable",
        )

        system_data = _schema_cache_read.system_data
        system_data.created_at = AAZStrType(
            serialized_name="createdAt",
        )
        system_data.created_by = AAZStrType(
            serialized_name="createdBy",
        )
        system_data.created_by_type = AAZStrType(
            serialized_name="createdByType",
        )
        system_data.last_modified_at = AAZStrType(
            serialized_name="lastModifiedAt",
        )
        system_data.last_modified_by = AAZStrType(
            serialized_name="lastModifiedBy",
        )
        system_data.last_modified_by_type = AAZStrType(
            serialized_name="lastModifiedByType",
        )

        tags = _schema_cache_read.tags
        tags.Element = AAZStrType()

        zones = _schema_cache_read.zones
        zones.Element = AAZStrType()

        _schema.etag = cls._schema_cache_read.etag
        _schema.id = cls._schema_cache_read.id
        _schema.location = cls._schema_cache_read.location
        _schema.name = cls._schema_cache_read.name
        _schema.properties = cls._schema_cache_read.properties
        _schema.system_data = cls._schema_cache_read.system_data
        _schema.tags = cls._schema_cache_read.tags
        _schema.type = cls._schema_cache_read.type
        _schema.zones = cls._schema_cache_read.zones


__all__ = ["Update"]
