# --------------------------------------------------------------------------------------------
# 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(
    "sentinel bookmark expand",
    is_experimental=True,
)
class Expand(AAZCommand):
    """Expand an bookmark
    """

    _aaz_info = {
        "version": "2022-06-01-preview",
        "resources": [
            ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/providers/microsoft.securityinsights/bookmarks/{}/expand", "2022-06-01-preview"],
        ]
    }

    def _handler(self, command_args):
        super()._handler(command_args)
        self._execute_operations()
        return 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.bookmark_id = AAZStrArg(
            options=["-n", "--name", "--bookmark-id"],
            help="ID of bookmark.",
            required=True,
            is_experimental=True,
        )
        _args_schema.resource_group = AAZResourceGroupNameArg(
            required=True,
        )
        _args_schema.workspace_name = AAZStrArg(
            options=["-w", "--workspace-name"],
            help="The name of the workspace.",
            required=True,
            is_experimental=True,
        )

        # define Arg Group "Parameters"

        _args_schema = cls._args_schema
        _args_schema.end_time = AAZStrArg(
            options=["--end-time"],
            arg_group="Parameters",
            help="The end date filter, so the only expansion results returned are before this date.",
        )
        _args_schema.expansion_id = AAZStrArg(
            options=["--expansion-id"],
            arg_group="Parameters",
            help="The Id of the expansion to perform.",
        )
        _args_schema.start_time = AAZStrArg(
            options=["--start-time"],
            arg_group="Parameters",
            help="The start date filter, so the only expansion results returned are after this date.",
        )
        return cls._args_schema

    def _execute_operations(self):
        self.BookmarkExpand(ctx=self.ctx)()

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

    class BookmarkExpand(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.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/expand",
                **self.url_parameters
            )

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

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

        @property
        def url_parameters(self):
            parameters = {
                **self.serialize_url_param(
                    "bookmarkId", self.ctx.args.bookmark_id,
                    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,
                ),
                **self.serialize_url_param(
                    "workspaceName", self.ctx.args.workspace_name,
                    required=True,
                ),
            }
            return parameters

        @property
        def query_parameters(self):
            parameters = {
                **self.serialize_query_param(
                    "api-version", "2022-06-01-preview",
                    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("endTime", AAZStrType, ".end_time")
            _builder.set_prop("expansionId", AAZStrType, ".expansion_id")
            _builder.set_prop("startTime", AAZStrType, ".start_time")

            return self.serialize_content(_content_value)

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

            _schema_on_200 = cls._schema_on_200
            _schema_on_200.meta_data = AAZObjectType(
                serialized_name="metaData",
            )
            _schema_on_200.value = AAZObjectType()

            meta_data = cls._schema_on_200.meta_data
            meta_data.aggregations = AAZListType()

            aggregations = cls._schema_on_200.meta_data.aggregations
            aggregations.Element = AAZObjectType()

            _element = cls._schema_on_200.meta_data.aggregations.Element
            _element.aggregation_type = AAZStrType(
                serialized_name="aggregationType",
            )
            _element.count = AAZIntType(
                flags={"required": True},
            )
            _element.display_name = AAZStrType(
                serialized_name="displayName",
            )
            _element.entity_kind = AAZStrType(
                serialized_name="entityKind",
                flags={"required": True},
            )

            value = cls._schema_on_200.value
            value.edges = AAZListType()
            value.entities = AAZListType()

            edges = cls._schema_on_200.value.edges
            edges.Element = AAZObjectType()

            _element = cls._schema_on_200.value.edges.Element
            _element.target_entity_id = AAZStrType(
                serialized_name="targetEntityId",
            )

            entities = cls._schema_on_200.value.entities
            entities.Element = AAZObjectType()

            _element = cls._schema_on_200.value.entities.Element
            _element.id = AAZStrType(
                flags={"read_only": True},
            )
            _element.kind = AAZStrType(
                flags={"required": True},
            )
            _element.name = AAZStrType(
                flags={"read_only": True},
            )
            _element.system_data = AAZObjectType(
                serialized_name="systemData",
                flags={"read_only": True},
            )
            _element.type = AAZStrType(
                flags={"read_only": True},
            )

            system_data = cls._schema_on_200.value.entities.Element.system_data
            system_data.created_at = AAZStrType(
                serialized_name="createdAt",
                flags={"read_only": True},
            )
            system_data.created_by = AAZStrType(
                serialized_name="createdBy",
                flags={"read_only": True},
            )
            system_data.created_by_type = AAZStrType(
                serialized_name="createdByType",
                flags={"read_only": True},
            )
            system_data.last_modified_at = AAZStrType(
                serialized_name="lastModifiedAt",
                flags={"read_only": True},
            )
            system_data.last_modified_by = AAZStrType(
                serialized_name="lastModifiedBy",
                flags={"read_only": True},
            )
            system_data.last_modified_by_type = AAZStrType(
                serialized_name="lastModifiedByType",
                flags={"read_only": True},
            )

            disc_account = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Account")
            disc_account.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Account").properties
            properties.aad_tenant_id = AAZStrType(
                serialized_name="aadTenantId",
                flags={"read_only": True},
            )
            properties.aad_user_id = AAZStrType(
                serialized_name="aadUserId",
                flags={"read_only": True},
            )
            properties.account_name = AAZStrType(
                serialized_name="accountName",
                flags={"read_only": True},
            )
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.display_name = AAZStrType(
                serialized_name="displayName",
                flags={"read_only": True},
            )
            properties.dns_domain = AAZStrType(
                serialized_name="dnsDomain",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.host_entity_id = AAZStrType(
                serialized_name="hostEntityId",
                flags={"read_only": True},
            )
            properties.is_domain_joined = AAZBoolType(
                serialized_name="isDomainJoined",
                flags={"read_only": True},
            )
            properties.nt_domain = AAZStrType(
                serialized_name="ntDomain",
                flags={"read_only": True},
            )
            properties.object_guid = AAZStrType(
                serialized_name="objectGuid",
                flags={"read_only": True},
            )
            properties.puid = AAZStrType(
                flags={"read_only": True},
            )
            properties.sid = AAZStrType(
                flags={"read_only": True},
            )
            properties.upn_suffix = AAZStrType(
                serialized_name="upnSuffix",
                flags={"read_only": True},
            )

            disc_azure_resource = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "AzureResource")
            disc_azure_resource.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "AzureResource").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.resource_id = AAZStrType(
                serialized_name="resourceId",
                flags={"read_only": True},
            )
            properties.subscription_id = AAZStrType(
                serialized_name="subscriptionId",
                flags={"read_only": True},
            )

            disc_bookmark = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Bookmark")
            disc_bookmark.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Bookmark").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.created = AAZStrType()
            properties.created_by = AAZObjectType(
                serialized_name="createdBy",
            )
            _build_schema_user_info_read(properties.created_by)
            properties.display_name = AAZStrType(
                serialized_name="displayName",
                flags={"required": True},
            )
            properties.event_time = AAZStrType(
                serialized_name="eventTime",
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.incident_info = AAZObjectType(
                serialized_name="incidentInfo",
            )
            properties.labels = AAZListType()
            properties.notes = AAZStrType()
            properties.query = AAZStrType(
                flags={"required": True},
            )
            properties.query_result = AAZStrType(
                serialized_name="queryResult",
            )
            properties.updated = AAZStrType()
            properties.updated_by = AAZObjectType(
                serialized_name="updatedBy",
            )
            _build_schema_user_info_read(properties.updated_by)

            incident_info = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Bookmark").properties.incident_info
            incident_info.incident_id = AAZStrType(
                serialized_name="incidentId",
            )
            incident_info.relation_name = AAZStrType(
                serialized_name="relationName",
            )
            incident_info.severity = AAZStrType()
            incident_info.title = AAZStrType()

            labels = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Bookmark").properties.labels
            labels.Element = AAZStrType()

            disc_cloud_application = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "CloudApplication")
            disc_cloud_application.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "CloudApplication").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.app_id = AAZIntType(
                serialized_name="appId",
                flags={"read_only": True},
            )
            properties.app_name = AAZStrType(
                serialized_name="appName",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.instance_name = AAZStrType(
                serialized_name="instanceName",
                flags={"read_only": True},
            )

            disc_dns_resolution = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "DnsResolution")
            disc_dns_resolution.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "DnsResolution").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.dns_server_ip_entity_id = AAZStrType(
                serialized_name="dnsServerIpEntityId",
                flags={"read_only": True},
            )
            properties.domain_name = AAZStrType(
                serialized_name="domainName",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.host_ip_address_entity_id = AAZStrType(
                serialized_name="hostIpAddressEntityId",
                flags={"read_only": True},
            )
            properties.ip_address_entity_ids = AAZListType(
                serialized_name="ipAddressEntityIds",
                flags={"read_only": True},
            )

            ip_address_entity_ids = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "DnsResolution").properties.ip_address_entity_ids
            ip_address_entity_ids.Element = AAZStrType(
                flags={"read_only": True},
            )

            disc_file = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "File")
            disc_file.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "File").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.directory = AAZStrType(
                flags={"read_only": True},
            )
            properties.file_hash_entity_ids = AAZListType(
                serialized_name="fileHashEntityIds",
                flags={"read_only": True},
            )
            properties.file_name = AAZStrType(
                serialized_name="fileName",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.host_entity_id = AAZStrType(
                serialized_name="hostEntityId",
                flags={"read_only": True},
            )

            file_hash_entity_ids = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "File").properties.file_hash_entity_ids
            file_hash_entity_ids.Element = AAZStrType(
                flags={"read_only": True},
            )

            disc_file_hash = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "FileHash")
            disc_file_hash.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "FileHash").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.algorithm = AAZStrType(
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.hash_value = AAZStrType(
                serialized_name="hashValue",
                flags={"read_only": True},
            )

            disc_host = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Host")
            disc_host.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Host").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.azure_id = AAZStrType(
                serialized_name="azureID",
                flags={"read_only": True},
            )
            properties.dns_domain = AAZStrType(
                serialized_name="dnsDomain",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.host_name = AAZStrType(
                serialized_name="hostName",
                flags={"read_only": True},
            )
            properties.is_domain_joined = AAZBoolType(
                serialized_name="isDomainJoined",
                flags={"read_only": True},
            )
            properties.net_bios_name = AAZStrType(
                serialized_name="netBiosName",
                flags={"read_only": True},
            )
            properties.nt_domain = AAZStrType(
                serialized_name="ntDomain",
                flags={"read_only": True},
            )
            properties.oms_agent_id = AAZStrType(
                serialized_name="omsAgentID",
                flags={"read_only": True},
            )
            properties.os_family = AAZStrType(
                serialized_name="osFamily",
            )
            properties.os_version = AAZStrType(
                serialized_name="osVersion",
                flags={"read_only": True},
            )

            disc_io_t_device = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "IoTDevice")
            disc_io_t_device.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "IoTDevice").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.device_id = AAZStrType(
                serialized_name="deviceId",
                flags={"read_only": True},
            )
            properties.device_name = AAZStrType(
                serialized_name="deviceName",
                flags={"read_only": True},
            )
            properties.device_type = AAZStrType(
                serialized_name="deviceType",
                flags={"read_only": True},
            )
            properties.edge_id = AAZStrType(
                serialized_name="edgeId",
                flags={"read_only": True},
            )
            properties.firmware_version = AAZStrType(
                serialized_name="firmwareVersion",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.host_entity_id = AAZStrType(
                serialized_name="hostEntityId",
                flags={"read_only": True},
            )
            properties.iot_hub_entity_id = AAZStrType(
                serialized_name="iotHubEntityId",
                flags={"read_only": True},
            )
            properties.iot_security_agent_id = AAZStrType(
                serialized_name="iotSecurityAgentId",
                flags={"read_only": True},
            )
            properties.ip_address_entity_id = AAZStrType(
                serialized_name="ipAddressEntityId",
                flags={"read_only": True},
            )
            properties.mac_address = AAZStrType(
                serialized_name="macAddress",
                flags={"read_only": True},
            )
            properties.model = AAZStrType(
                flags={"read_only": True},
            )
            properties.operating_system = AAZStrType(
                serialized_name="operatingSystem",
                flags={"read_only": True},
            )
            properties.protocols = AAZListType(
                flags={"read_only": True},
            )
            properties.serial_number = AAZStrType(
                serialized_name="serialNumber",
                flags={"read_only": True},
            )
            properties.source = AAZStrType(
                flags={"read_only": True},
            )
            properties.threat_intelligence = AAZListType(
                serialized_name="threatIntelligence",
                flags={"read_only": True},
            )
            properties.vendor = AAZStrType(
                flags={"read_only": True},
            )

            protocols = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "IoTDevice").properties.protocols
            protocols.Element = AAZStrType(
                flags={"read_only": True},
            )

            threat_intelligence = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "IoTDevice").properties.threat_intelligence
            threat_intelligence.Element = AAZObjectType(
                flags={"read_only": True},
            )
            _build_schema_threat_intelligence_read(threat_intelligence.Element)

            disc_ip = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Ip")
            disc_ip.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Ip").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.address = AAZStrType(
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.location = AAZObjectType(
                flags={"read_only": True},
            )
            properties.threat_intelligence = AAZListType(
                serialized_name="threatIntelligence",
                flags={"read_only": True},
            )

            location = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Ip").properties.location
            location.asn = AAZIntType(
                flags={"read_only": True},
            )
            location.city = AAZStrType(
                flags={"read_only": True},
            )
            location.country_code = AAZStrType(
                serialized_name="countryCode",
                flags={"read_only": True},
            )
            location.country_name = AAZStrType(
                serialized_name="countryName",
                flags={"read_only": True},
            )
            location.latitude = AAZFloatType(
                flags={"read_only": True},
            )
            location.longitude = AAZFloatType(
                flags={"read_only": True},
            )
            location.state = AAZStrType(
                flags={"read_only": True},
            )

            threat_intelligence = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Ip").properties.threat_intelligence
            threat_intelligence.Element = AAZObjectType(
                flags={"read_only": True},
            )
            _build_schema_threat_intelligence_read(threat_intelligence.Element)

            disc_mail_cluster = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "MailCluster")
            disc_mail_cluster.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "MailCluster").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.cluster_group = AAZStrType(
                serialized_name="clusterGroup",
                flags={"read_only": True},
            )
            properties.cluster_query_end_time = AAZStrType(
                serialized_name="clusterQueryEndTime",
                flags={"read_only": True},
            )
            properties.cluster_query_start_time = AAZStrType(
                serialized_name="clusterQueryStartTime",
                flags={"read_only": True},
            )
            properties.cluster_source_identifier = AAZStrType(
                serialized_name="clusterSourceIdentifier",
                flags={"read_only": True},
            )
            properties.cluster_source_type = AAZStrType(
                serialized_name="clusterSourceType",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.is_volume_anomaly = AAZBoolType(
                serialized_name="isVolumeAnomaly",
                flags={"read_only": True},
            )
            properties.mail_count = AAZIntType(
                serialized_name="mailCount",
                flags={"read_only": True},
            )
            properties.network_message_ids = AAZListType(
                serialized_name="networkMessageIds",
                flags={"read_only": True},
            )
            properties.query = AAZStrType(
                flags={"read_only": True},
            )
            properties.query_time = AAZStrType(
                serialized_name="queryTime",
                flags={"read_only": True},
            )
            properties.source = AAZStrType(
                flags={"read_only": True},
            )
            properties.threats = AAZListType(
                flags={"read_only": True},
            )

            network_message_ids = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "MailCluster").properties.network_message_ids
            network_message_ids.Element = AAZStrType(
                flags={"read_only": True},
            )

            threats = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "MailCluster").properties.threats
            threats.Element = AAZStrType(
                flags={"read_only": True},
            )

            disc_mail_message = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "MailMessage")
            disc_mail_message.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "MailMessage").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.antispam_direction = AAZStrType(
                serialized_name="antispamDirection",
            )
            properties.body_fingerprint_bin1 = AAZIntType(
                serialized_name="bodyFingerprintBin1",
            )
            properties.body_fingerprint_bin2 = AAZIntType(
                serialized_name="bodyFingerprintBin2",
            )
            properties.body_fingerprint_bin3 = AAZIntType(
                serialized_name="bodyFingerprintBin3",
            )
            properties.body_fingerprint_bin4 = AAZIntType(
                serialized_name="bodyFingerprintBin4",
            )
            properties.body_fingerprint_bin5 = AAZIntType(
                serialized_name="bodyFingerprintBin5",
            )
            properties.delivery_action = AAZStrType(
                serialized_name="deliveryAction",
            )
            properties.delivery_location = AAZStrType(
                serialized_name="deliveryLocation",
            )
            properties.file_entity_ids = AAZListType(
                serialized_name="fileEntityIds",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.internet_message_id = AAZStrType(
                serialized_name="internetMessageId",
                flags={"read_only": True},
            )
            properties.language = AAZStrType(
                flags={"read_only": True},
            )
            properties.network_message_id = AAZStrType(
                serialized_name="networkMessageId",
                flags={"read_only": True},
            )
            properties.p1_sender = AAZStrType(
                serialized_name="p1Sender",
                flags={"read_only": True},
            )
            properties.p1_sender_display_name = AAZStrType(
                serialized_name="p1SenderDisplayName",
                flags={"read_only": True},
            )
            properties.p1_sender_domain = AAZStrType(
                serialized_name="p1SenderDomain",
                flags={"read_only": True},
            )
            properties.p2_sender = AAZStrType(
                serialized_name="p2Sender",
                flags={"read_only": True},
            )
            properties.p2_sender_display_name = AAZStrType(
                serialized_name="p2SenderDisplayName",
                flags={"read_only": True},
            )
            properties.p2_sender_domain = AAZStrType(
                serialized_name="p2SenderDomain",
                flags={"read_only": True},
            )
            properties.receive_date = AAZStrType(
                serialized_name="receiveDate",
                flags={"read_only": True},
            )
            properties.recipient = AAZStrType(
                flags={"read_only": True},
            )
            properties.sender_ip = AAZStrType(
                serialized_name="senderIP",
                flags={"read_only": True},
            )
            properties.subject = AAZStrType(
                flags={"read_only": True},
            )
            properties.threat_detection_methods = AAZListType(
                serialized_name="threatDetectionMethods",
                flags={"read_only": True},
            )
            properties.threats = AAZListType(
                flags={"read_only": True},
            )
            properties.urls = AAZListType(
                flags={"read_only": True},
            )

            file_entity_ids = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "MailMessage").properties.file_entity_ids
            file_entity_ids.Element = AAZStrType(
                flags={"read_only": True},
            )

            threat_detection_methods = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "MailMessage").properties.threat_detection_methods
            threat_detection_methods.Element = AAZStrType(
                flags={"read_only": True},
            )

            threats = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "MailMessage").properties.threats
            threats.Element = AAZStrType(
                flags={"read_only": True},
            )

            urls = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "MailMessage").properties.urls
            urls.Element = AAZStrType(
                flags={"read_only": True},
            )

            disc_mailbox = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Mailbox")
            disc_mailbox.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Mailbox").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.display_name = AAZStrType(
                serialized_name="displayName",
                flags={"read_only": True},
            )
            properties.external_directory_object_id = AAZStrType(
                serialized_name="externalDirectoryObjectId",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.mailbox_primary_address = AAZStrType(
                serialized_name="mailboxPrimaryAddress",
                flags={"read_only": True},
            )
            properties.upn = AAZStrType(
                flags={"read_only": True},
            )

            disc_malware = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Malware")
            disc_malware.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Malware").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.category = AAZStrType(
                flags={"read_only": True},
            )
            properties.file_entity_ids = AAZListType(
                serialized_name="fileEntityIds",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.malware_name = AAZStrType(
                serialized_name="malwareName",
                flags={"read_only": True},
            )
            properties.process_entity_ids = AAZListType(
                serialized_name="processEntityIds",
                flags={"read_only": True},
            )

            file_entity_ids = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Malware").properties.file_entity_ids
            file_entity_ids.Element = AAZStrType(
                flags={"read_only": True},
            )

            process_entity_ids = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Malware").properties.process_entity_ids
            process_entity_ids.Element = AAZStrType(
                flags={"read_only": True},
            )

            disc_process = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Process")
            disc_process.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Process").properties
            properties.account_entity_id = AAZStrType(
                serialized_name="accountEntityId",
                flags={"read_only": True},
            )
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.command_line = AAZStrType(
                serialized_name="commandLine",
                flags={"read_only": True},
            )
            properties.creation_time_utc = AAZStrType(
                serialized_name="creationTimeUtc",
                flags={"read_only": True},
            )
            properties.elevation_token = AAZStrType(
                serialized_name="elevationToken",
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.host_entity_id = AAZStrType(
                serialized_name="hostEntityId",
                flags={"read_only": True},
            )
            properties.host_logon_session_entity_id = AAZStrType(
                serialized_name="hostLogonSessionEntityId",
                flags={"read_only": True},
            )
            properties.image_file_entity_id = AAZStrType(
                serialized_name="imageFileEntityId",
                flags={"read_only": True},
            )
            properties.parent_process_entity_id = AAZStrType(
                serialized_name="parentProcessEntityId",
                flags={"read_only": True},
            )
            properties.process_id = AAZStrType(
                serialized_name="processId",
                flags={"read_only": True},
            )

            disc_registry_key = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "RegistryKey")
            disc_registry_key.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "RegistryKey").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.hive = AAZStrType(
                flags={"read_only": True},
            )
            properties.key = AAZStrType(
                flags={"read_only": True},
            )

            disc_registry_value = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "RegistryValue")
            disc_registry_value.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "RegistryValue").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.key_entity_id = AAZStrType(
                serialized_name="keyEntityId",
                flags={"read_only": True},
            )
            properties.value_data = AAZStrType(
                serialized_name="valueData",
                flags={"read_only": True},
            )
            properties.value_name = AAZStrType(
                serialized_name="valueName",
                flags={"read_only": True},
            )
            properties.value_type = AAZStrType(
                serialized_name="valueType",
                flags={"read_only": True},
            )

            disc_security_alert = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "SecurityAlert")
            disc_security_alert.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "SecurityAlert").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.alert_display_name = AAZStrType(
                serialized_name="alertDisplayName",
                flags={"read_only": True},
            )
            properties.alert_link = AAZStrType(
                serialized_name="alertLink",
                flags={"read_only": True},
            )
            properties.alert_type = AAZStrType(
                serialized_name="alertType",
                flags={"read_only": True},
            )
            properties.compromised_entity = AAZStrType(
                serialized_name="compromisedEntity",
                flags={"read_only": True},
            )
            properties.confidence_level = AAZStrType(
                serialized_name="confidenceLevel",
                flags={"read_only": True},
            )
            properties.confidence_reasons = AAZListType(
                serialized_name="confidenceReasons",
                flags={"read_only": True},
            )
            properties.confidence_score = AAZFloatType(
                serialized_name="confidenceScore",
                flags={"read_only": True},
            )
            properties.confidence_score_status = AAZStrType(
                serialized_name="confidenceScoreStatus",
                flags={"read_only": True},
            )
            properties.description = AAZStrType(
                flags={"read_only": True},
            )
            properties.end_time_utc = AAZStrType(
                serialized_name="endTimeUtc",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.intent = AAZStrType(
                flags={"read_only": True},
            )
            properties.processing_end_time = AAZStrType(
                serialized_name="processingEndTime",
                flags={"read_only": True},
            )
            properties.product_component_name = AAZStrType(
                serialized_name="productComponentName",
                flags={"read_only": True},
            )
            properties.product_name = AAZStrType(
                serialized_name="productName",
                flags={"read_only": True},
            )
            properties.product_version = AAZStrType(
                serialized_name="productVersion",
                flags={"read_only": True},
            )
            properties.provider_alert_id = AAZStrType(
                serialized_name="providerAlertId",
                flags={"read_only": True},
            )
            properties.remediation_steps = AAZListType(
                serialized_name="remediationSteps",
                flags={"read_only": True},
            )
            properties.severity = AAZStrType()
            properties.start_time_utc = AAZStrType(
                serialized_name="startTimeUtc",
                flags={"read_only": True},
            )
            properties.status = AAZStrType(
                flags={"read_only": True},
            )
            properties.system_alert_id = AAZStrType(
                serialized_name="systemAlertId",
                flags={"read_only": True},
            )
            properties.tactics = AAZListType(
                flags={"read_only": True},
            )
            properties.time_generated = AAZStrType(
                serialized_name="timeGenerated",
                flags={"read_only": True},
            )
            properties.vendor_name = AAZStrType(
                serialized_name="vendorName",
                flags={"read_only": True},
            )

            confidence_reasons = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "SecurityAlert").properties.confidence_reasons
            confidence_reasons.Element = AAZObjectType(
                flags={"read_only": True},
            )

            _element = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "SecurityAlert").properties.confidence_reasons.Element
            _element.reason = AAZStrType(
                flags={"read_only": True},
            )
            _element.reason_type = AAZStrType(
                serialized_name="reasonType",
                flags={"read_only": True},
            )

            remediation_steps = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "SecurityAlert").properties.remediation_steps
            remediation_steps.Element = AAZStrType(
                flags={"read_only": True},
            )

            tactics = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "SecurityAlert").properties.tactics
            tactics.Element = AAZStrType(
                flags={"read_only": True},
            )

            disc_security_group = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "SecurityGroup")
            disc_security_group.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "SecurityGroup").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.distinguished_name = AAZStrType(
                serialized_name="distinguishedName",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.object_guid = AAZStrType(
                serialized_name="objectGuid",
                flags={"read_only": True},
            )
            properties.sid = AAZStrType(
                flags={"read_only": True},
            )

            disc_submission_mail = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "SubmissionMail")
            disc_submission_mail.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "SubmissionMail").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.network_message_id = AAZStrType(
                serialized_name="networkMessageId",
                flags={"read_only": True},
            )
            properties.recipient = AAZStrType(
                flags={"read_only": True},
            )
            properties.report_type = AAZStrType(
                serialized_name="reportType",
                flags={"read_only": True},
            )
            properties.sender = AAZStrType(
                flags={"read_only": True},
            )
            properties.sender_ip = AAZStrType(
                serialized_name="senderIp",
                flags={"read_only": True},
            )
            properties.subject = AAZStrType(
                flags={"read_only": True},
            )
            properties.submission_date = AAZStrType(
                serialized_name="submissionDate",
                flags={"read_only": True},
            )
            properties.submission_id = AAZStrType(
                serialized_name="submissionId",
                flags={"read_only": True},
            )
            properties.submitter = AAZStrType(
                flags={"read_only": True},
            )
            properties.timestamp = AAZStrType(
                flags={"read_only": True},
            )

            disc_url = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Url")
            disc_url.properties = AAZObjectType(
                flags={"client_flatten": True},
            )

            properties = cls._schema_on_200.value.entities.Element.discriminate_by("kind", "Url").properties
            properties.additional_data = AAZDictType(
                serialized_name="additionalData",
                flags={"read_only": True},
            )
            properties.friendly_name = AAZStrType(
                serialized_name="friendlyName",
                flags={"read_only": True},
            )
            properties.url = AAZStrType(
                flags={"read_only": True},
            )

            return cls._schema_on_200


_schema_threat_intelligence_read = None


def _build_schema_threat_intelligence_read(_schema):
    global _schema_threat_intelligence_read
    if _schema_threat_intelligence_read is not None:
        _schema.confidence = _schema_threat_intelligence_read.confidence
        _schema.provider_name = _schema_threat_intelligence_read.provider_name
        _schema.report_link = _schema_threat_intelligence_read.report_link
        _schema.threat_description = _schema_threat_intelligence_read.threat_description
        _schema.threat_name = _schema_threat_intelligence_read.threat_name
        _schema.threat_type = _schema_threat_intelligence_read.threat_type
        return

    _schema_threat_intelligence_read = AAZObjectType(
        flags={"read_only": True}
    )

    threat_intelligence_read = _schema_threat_intelligence_read
    threat_intelligence_read.confidence = AAZFloatType(
        flags={"read_only": True},
    )
    threat_intelligence_read.provider_name = AAZStrType(
        serialized_name="providerName",
        flags={"read_only": True},
    )
    threat_intelligence_read.report_link = AAZStrType(
        serialized_name="reportLink",
        flags={"read_only": True},
    )
    threat_intelligence_read.threat_description = AAZStrType(
        serialized_name="threatDescription",
        flags={"read_only": True},
    )
    threat_intelligence_read.threat_name = AAZStrType(
        serialized_name="threatName",
        flags={"read_only": True},
    )
    threat_intelligence_read.threat_type = AAZStrType(
        serialized_name="threatType",
        flags={"read_only": True},
    )

    _schema.confidence = _schema_threat_intelligence_read.confidence
    _schema.provider_name = _schema_threat_intelligence_read.provider_name
    _schema.report_link = _schema_threat_intelligence_read.report_link
    _schema.threat_description = _schema_threat_intelligence_read.threat_description
    _schema.threat_name = _schema_threat_intelligence_read.threat_name
    _schema.threat_type = _schema_threat_intelligence_read.threat_type


_schema_user_info_read = None


def _build_schema_user_info_read(_schema):
    global _schema_user_info_read
    if _schema_user_info_read is not None:
        _schema.email = _schema_user_info_read.email
        _schema.name = _schema_user_info_read.name
        _schema.object_id = _schema_user_info_read.object_id
        return

    _schema_user_info_read = AAZObjectType()

    user_info_read = _schema_user_info_read
    user_info_read.email = AAZStrType(
        flags={"read_only": True},
    )
    user_info_read.name = AAZStrType(
        flags={"read_only": True},
    )
    user_info_read.object_id = AAZStrType(
        serialized_name="objectId",
        nullable=True,
    )

    _schema.email = _schema_user_info_read.email
    _schema.name = _schema_user_info_read.name
    _schema.object_id = _schema_user_info_read.object_id


__all__ = ["Expand"]
