# --------------------------------------------------------------------------------------------
# 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 create",
)
class Create(AAZCommand):
    """Create the specified Cache within the Capacity Pool

    :example: Caches_CreateOrUpdate
        az netappfiles cache create --resource-group myRG --account-name account1 --pool-name pool1 --cache-name cache1 --location eastus --file-path cache-west-us2-01 --size 107374182400 --ldap Enabled --ldap-server-type OpenLDAP --cache-subnet-resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/cacheVnet/subnets/cacheSubnet1 --peering-subnet-resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/icLifVnet/subnets/peeringSubnet1 --encryption-key-source Microsoft.NetApp --origin-cluster-information "{peer-cluster-name:cluster1,peer-addresses:[192.0.2.10,192.0.2.11],peer-vserver-name:vserver1,peer-volume-name:originvol1}"
    """

    _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

    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,
            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,
            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,
            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.location = AAZResourceLocationArg(
            arg_group="Body",
            help="The geo-location where the resource lives",
            required=True,
            fmt=AAZResourceLocationArgFormat(
                resource_group_arg="resource_group",
            ),
        )
        _args_schema.tags = AAZDictArg(
            options=["--tags"],
            arg_group="Body",
            help="Resource tags.",
        )
        _args_schema.zones = AAZListArg(
            options=["--zones"],
            arg_group="Body",
            help="The availability zones.",
        )

        tags = cls._args_schema.tags
        tags.Element = AAZStrArg()

        zones = cls._args_schema.zones
        zones.Element = AAZStrArg()

        # 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",
        )

        export_policy_rules = cls._args_schema.export_policy_rules
        export_policy_rules.Element = AAZObjectArg()

        _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",
        )
        _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.",
            default="Restricted",
            enum={"Restricted": "Restricted", "Unrestricted": "Unrestricted"},
        )
        _element.cifs = AAZBoolArg(
            options=["cifs"],
            help="Allows CIFS protocol",
        )
        _element.has_root_access = AAZBoolArg(
            options=["has-root-access"],
            help="Has root access to volume",
            default=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",
            default=False,
        )
        _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",
            default=False,
        )
        _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",
            default=False,
        )
        _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",
            default=False,
        )
        _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",
            default=False,
        )
        _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",
            default=False,
        )
        _element.nfsv3 = AAZBoolArg(
            options=["nfsv3"],
            help="Allows NFSv3 protocol. Enable only for NFSv3 type volumes",
        )
        _element.nfsv41 = AAZBoolArg(
            options=["nfsv41"],
            help="Allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes",
        )
        _element.rule_index = AAZIntArg(
            options=["rule-index"],
            help="Order index",
        )
        _element.unix_read_only = AAZBoolArg(
            options=["unix-read-only"],
            help="Read only access",
        )
        _element.unix_read_write = AAZBoolArg(
            options=["unix-read-write"],
            help="Read and write access",
        )

        # define Arg Group "OriginClusterInformation"

        _args_schema = cls._args_schema
        _args_schema.peer_addresses = AAZListArg(
            options=["--peer-addresses"],
            arg_group="OriginClusterInformation",
            help="ONTAP Intercluster LIF IP addresses. One IP address per cluster node is required",
            required=True,
            fmt=AAZListArgFormat(
                min_length=1,
            ),
        )
        _args_schema.peer_cluster_name = AAZStrArg(
            options=["--peer-cluster-name"],
            arg_group="OriginClusterInformation",
            help="ONTAP cluster name of external cluster hosting the origin volume. Must match the exact cluster name.",
            required=True,
        )
        _args_schema.peer_volume_name = AAZStrArg(
            options=["--peer-volume-name"],
            arg_group="OriginClusterInformation",
            help="External origin volume name associated to this cache",
            required=True,
        )
        _args_schema.peer_vserver_name = AAZStrArg(
            options=["--peer-vserver-name"],
            arg_group="OriginClusterInformation",
            help="External Vserver (SVM) name  name of the SVM hosting the origin volume",
            required=True,
        )

        peer_addresses = cls._args_schema.peer_addresses
        peer_addresses.Element = AAZStrArg()

        # define Arg Group "Properties"

        _args_schema = cls._args_schema
        _args_schema.cache_subnet_resource_id = AAZResourceIdArg(
            options=["--cache-subnet-id", "--cache-subnet-resource-id"],
            arg_group="Properties",
            help="The Azure Resource URI for a delegated cache subnet that will be used to allocate data IPs.",
            required=True,
        )
        _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.",
            enum={"Disabled": "Disabled", "Enabled": "Enabled"},
        )
        _args_schema.encryption_key_source = AAZStrArg(
            options=["--encryption-key-source"],
            arg_group="Properties",
            help="Source of key used to encrypt data in the cache. Applicable if NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'",
            required=True,
            enum={"Microsoft.KeyVault": "Microsoft.KeyVault", "Microsoft.NetApp": "Microsoft.NetApp"},
        )
        _args_schema.file_path = AAZStrArg(
            options=["--file-path"],
            arg_group="Properties",
            help="The file path of the Cache.",
            required=True,
            fmt=AAZStrArgFormat(
                pattern="^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$",
                max_length=80,
                min_length=1,
            ),
        )
        _args_schema.global_file_locking = AAZStrArg(
            options=["--global-file-locking"],
            arg_group="Properties",
            help="Flag indicating whether the global file lock is enabled for the cache.",
            enum={"Disabled": "Disabled", "Enabled": "Enabled"},
        )
        _args_schema.kerberos = AAZStrArg(
            options=["--kerberos"],
            arg_group="Properties",
            help="Describe if a cache is Kerberos enabled.",
            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'.",
        )
        _args_schema.ldap = AAZStrArg(
            options=["--ldap"],
            arg_group="Properties",
            help="Specifies whether LDAP is enabled or not for flexcache volume.",
            enum={"Disabled": "Disabled", "Enabled": "Enabled"},
        )
        _args_schema.ldap_server_type = AAZStrArg(
            options=["--ldap-server-type"],
            arg_group="Properties",
            help="Specifies the type of LDAP server for flexcache volume.",
            enum={"ActiveDirectory": "ActiveDirectory", "OpenLDAP": "OpenLDAP"},
        )
        _args_schema.peering_subnet_resource_id = AAZResourceIdArg(
            options=["--peering-subnet-id", "--peering-subnet-resource-id"],
            arg_group="Properties",
            help="The Azure Resource URI for a delegated subnet that will be used for ANF Intercluster Interface IP addresses.",
            required=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",
        )
        _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.",
            required=True,
            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",
        )
        _args_schema.write_back = AAZStrArg(
            options=["--write-back"],
            arg_group="Properties",
            help="Flag indicating whether writeback is enabled for the cache.",
            enum={"Disabled": "Disabled", "Enabled": "Enabled"},
        )

        protocol_types = cls._args_schema.protocol_types
        protocol_types.Element = AAZStrArg(
            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",
            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.",
            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",
            enum={"Disabled": "Disabled", "Enabled": "Enabled"},
        )
        return cls._args_schema

    def _execute_operations(self):
        self.pre_operations()
        yield self.CachesCreateOrUpdate(ctx=self.ctx)()
        self.post_operations()

    @register_callback
    def pre_operations(self):
        pass

    @register_callback
    def post_operations(self):
        pass

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

    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,
                typ=AAZObjectType,
                typ_kwargs={"flags": {"required": True, "client_flatten": True}}
            )
            _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
            _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
            _builder.set_prop("tags", AAZDictType, ".tags")
            _builder.set_prop("zones", AAZListType, ".zones")

            properties = _builder.get(".properties")
            if properties is not None:
                properties.set_prop("cacheSubnetResourceId", AAZStrType, ".cache_subnet_resource_id", typ_kwargs={"flags": {"required": True}})
                properties.set_prop("cifsChangeNotifications", AAZStrType, ".cifs_change_notifications")
                properties.set_prop("encryptionKeySource", AAZStrType, ".encryption_key_source", typ_kwargs={"flags": {"required": True}})
                properties.set_prop("exportPolicy", AAZObjectType)
                properties.set_prop("filePath", AAZStrType, ".file_path", typ_kwargs={"flags": {"required": True}})
                properties.set_prop("globalFileLocking", AAZStrType, ".global_file_locking")
                properties.set_prop("kerberos", AAZStrType, ".kerberos")
                properties.set_prop("keyVaultPrivateEndpointResourceId", AAZStrType, ".key_vault_private_endpoint_resource_id")
                properties.set_prop("ldap", AAZStrType, ".ldap")
                properties.set_prop("ldapServerType", AAZStrType, ".ldap_server_type")
                properties.set_prop("originClusterInformation", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
                properties.set_prop("peeringSubnetResourceId", AAZStrType, ".peering_subnet_resource_id", typ_kwargs={"flags": {"required": True}})
                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")

            origin_cluster_information = _builder.get(".properties.originClusterInformation")
            if origin_cluster_information is not None:
                origin_cluster_information.set_prop("peerAddresses", AAZListType, ".peer_addresses", typ_kwargs={"flags": {"required": True}})
                origin_cluster_information.set_prop("peerClusterName", AAZStrType, ".peer_cluster_name", typ_kwargs={"flags": {"required": True}})
                origin_cluster_information.set_prop("peerVolumeName", AAZStrType, ".peer_volume_name", typ_kwargs={"flags": {"required": True}})
                origin_cluster_information.set_prop("peerVserverName", AAZStrType, ".peer_vserver_name", typ_kwargs={"flags": {"required": True}})

            peer_addresses = _builder.get(".properties.originClusterInformation.peerAddresses")
            if peer_addresses is not None:
                peer_addresses.set_elements(AAZStrType, ".")

            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, ".")

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

            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()

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

            properties = cls._schema_on_200_201.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 = cls._schema_on_200_201.properties.export_policy
            export_policy.rules = AAZListType()

            rules = cls._schema_on_200_201.properties.export_policy.rules
            rules.Element = AAZObjectType()

            _element = cls._schema_on_200_201.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 = cls._schema_on_200_201.properties.mount_targets
            mount_targets.Element = AAZObjectType()

            _element = cls._schema_on_200_201.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 = cls._schema_on_200_201.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 = cls._schema_on_200_201.properties.origin_cluster_information.peer_addresses
            peer_addresses.Element = AAZStrType()

            protocol_types = cls._schema_on_200_201.properties.protocol_types
            protocol_types.Element = AAZStrType()

            smb_settings = cls._schema_on_200_201.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 = cls._schema_on_200_201.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 = cls._schema_on_200_201.tags
            tags.Element = AAZStrType()

            zones = cls._schema_on_200_201.zones
            zones.Element = AAZStrType()

            return cls._schema_on_200_201


class _CreateHelper:
    """Helper class for Create"""


__all__ = ["Create"]
