# --------------------------------------------------------------------------------------------
# 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(
    "databox job update",
)
class Update(AAZCommand):
    """Update the properties of an existing job.

    :example: Update job
        az databox job update -g rg -n job-name --contact-name 'name --email-list email --phone phone-number
    """

    _aaz_info = {
        "version": "2022-12-01",
        "resources": [
            ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databox/jobs/{}", "2022-12-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.job_name = AAZStrArg(
            options=["-n", "--name", "--job-name"],
            help="The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only",
            required=True,
            id_part="name",
            fmt=AAZStrArgFormat(
                pattern="^[-\w\.]+$",
                max_length=24,
                min_length=3,
            ),
        )
        _args_schema.resource_group = AAZResourceGroupNameArg(
            required=True,
        )

        # define Arg Group "ContactDetails"

        _args_schema = cls._args_schema
        _args_schema.contact_name = AAZStrArg(
            options=["--contact-name"],
            arg_group="ContactDetails",
            help="Contact name of the person.",
        )
        _args_schema.email_list = AAZListArg(
            options=["--email-list"],
            arg_group="ContactDetails",
            help="List of Email-ids to be notified about job progress.",
        )
        _args_schema.mobile = AAZStrArg(
            options=["--mobile"],
            arg_group="ContactDetails",
            help="Mobile number of the contact person.",
        )
        _args_schema.phone = AAZStrArg(
            options=["--phone"],
            arg_group="ContactDetails",
            help="Phone number of the contact person.",
        )

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

        # define Arg Group "Details"

        # define Arg Group "JobResourceUpdateParameter"

        # define Arg Group "KeyEncryptionKey"

        _args_schema = cls._args_schema
        _args_schema.kek_identity = AAZObjectArg(
            options=["--kek-identity"],
            arg_group="KeyEncryptionKey",
            help="Managed identity properties used for key encryption.",
        )
        _args_schema.kek_type = AAZStrArg(
            options=["--kek-type"],
            arg_group="KeyEncryptionKey",
            help="Type of encryption key used for key encryption.",
            enum={"CustomerManaged": "CustomerManaged", "MicrosoftManaged": "MicrosoftManaged"},
        )
        _args_schema.kek_url = AAZStrArg(
            options=["--kek-url"],
            arg_group="KeyEncryptionKey",
            help="Key encryption key. It is required in case of Customer managed KekType.",
        )
        _args_schema.kek_vault_resource_id = AAZStrArg(
            options=["--kek-vault-resource-id"],
            arg_group="KeyEncryptionKey",
            help="Kek vault resource id. It is required in case of Customer managed KekType.",
        )

        kek_identity = cls._args_schema.kek_identity
        kek_identity.type = AAZStrArg(
            options=["type"],
            help="Managed service identity type.",
        )
        kek_identity.user_assigned = AAZObjectArg(
            options=["user-assigned"],
            help="User assigned identity properties.",
        )

        user_assigned = cls._args_schema.kek_identity.user_assigned
        user_assigned.resource_id = AAZStrArg(
            options=["resource-id"],
            help="Arm resource id for user assigned identity to be used to fetch MSI token.",
        )

        # define Arg Group "ShippingAddress"

        _args_schema = cls._args_schema
        _args_schema.city = AAZStrArg(
            options=["--city"],
            arg_group="ShippingAddress",
            help="Name of the city.",
        )
        _args_schema.company_name = AAZStrArg(
            options=["--company-name"],
            arg_group="ShippingAddress",
            help="Name of the company.",
        )
        _args_schema.country = AAZStrArg(
            options=["--country"],
            arg_group="ShippingAddress",
            help="Name of the Country.",
        )
        _args_schema.postal_code = AAZStrArg(
            options=["--postal-code"],
            arg_group="ShippingAddress",
            help="Postal code.",
        )
        _args_schema.state_or_province = AAZStrArg(
            options=["--state-or-province"],
            arg_group="ShippingAddress",
            help="Name of the State or Province.",
        )
        _args_schema.street_address1 = AAZStrArg(
            options=["--street-address1"],
            arg_group="ShippingAddress",
            help="Street Address line 1.",
        )
        _args_schema.street_address2 = AAZStrArg(
            options=["--street-address2"],
            arg_group="ShippingAddress",
            help="Street Address line 2.",
        )
        _args_schema.street_address3 = AAZStrArg(
            options=["--street-address3"],
            arg_group="ShippingAddress",
            help="Street Address line 3.",
        )
        return cls._args_schema

    _args_shipping_address_update = None

    @classmethod
    def _build_args_shipping_address_update(cls, _schema):
        if cls._args_shipping_address_update is not None:
            _schema.address_type = cls._args_shipping_address_update.address_type
            _schema.city = cls._args_shipping_address_update.city
            _schema.company_name = cls._args_shipping_address_update.company_name
            _schema.country = cls._args_shipping_address_update.country
            _schema.postal_code = cls._args_shipping_address_update.postal_code
            _schema.skip_address_validation = cls._args_shipping_address_update.skip_address_validation
            _schema.state_or_province = cls._args_shipping_address_update.state_or_province
            _schema.street_address1 = cls._args_shipping_address_update.street_address1
            _schema.street_address2 = cls._args_shipping_address_update.street_address2
            _schema.street_address3 = cls._args_shipping_address_update.street_address3
            _schema.tax_identification_number = cls._args_shipping_address_update.tax_identification_number
            _schema.zip_extended_code = cls._args_shipping_address_update.zip_extended_code
            return

        cls._args_shipping_address_update = AAZObjectArg()

        shipping_address_update = cls._args_shipping_address_update
        shipping_address_update.address_type = AAZStrArg(
            options=["address-type"],
            help="Type of address.",
            default="None",
            enum={"Commercial": "Commercial", "None": "None", "Residential": "Residential"},
        )
        shipping_address_update.city = AAZStrArg(
            options=["city"],
            help="Name of the City.",
        )
        shipping_address_update.company_name = AAZStrArg(
            options=["company-name"],
            help="Name of the company.",
        )
        shipping_address_update.country = AAZStrArg(
            options=["country"],
            help="Name of the Country.",
            required=True,
        )
        shipping_address_update.postal_code = AAZStrArg(
            options=["postal-code"],
            help="Postal code.",
        )
        shipping_address_update.skip_address_validation = AAZBoolArg(
            options=["skip-address-validation"],
            help="Flag to indicate if customer has chosen to skip default address validation",
        )
        shipping_address_update.state_or_province = AAZStrArg(
            options=["state-or-province"],
            help="Name of the State or Province.",
        )
        shipping_address_update.street_address1 = AAZStrArg(
            options=["street-address1"],
            help="Street Address line 1.",
            required=True,
        )
        shipping_address_update.street_address2 = AAZStrArg(
            options=["street-address2"],
            help="Street Address line 2.",
        )
        shipping_address_update.street_address3 = AAZStrArg(
            options=["street-address3"],
            help="Street Address line 3.",
        )
        shipping_address_update.tax_identification_number = AAZStrArg(
            options=["tax-identification-number"],
            help="Tax Identification Number",
        )
        shipping_address_update.zip_extended_code = AAZStrArg(
            options=["zip-extended-code"],
            help="Extended Zip Code.",
        )

        _schema.address_type = cls._args_shipping_address_update.address_type
        _schema.city = cls._args_shipping_address_update.city
        _schema.company_name = cls._args_shipping_address_update.company_name
        _schema.country = cls._args_shipping_address_update.country
        _schema.postal_code = cls._args_shipping_address_update.postal_code
        _schema.skip_address_validation = cls._args_shipping_address_update.skip_address_validation
        _schema.state_or_province = cls._args_shipping_address_update.state_or_province
        _schema.street_address1 = cls._args_shipping_address_update.street_address1
        _schema.street_address2 = cls._args_shipping_address_update.street_address2
        _schema.street_address3 = cls._args_shipping_address_update.street_address3
        _schema.tax_identification_number = cls._args_shipping_address_update.tax_identification_number
        _schema.zip_extended_code = cls._args_shipping_address_update.zip_extended_code

    _args_transport_preferences_update = None

    @classmethod
    def _build_args_transport_preferences_update(cls, _schema):
        if cls._args_transport_preferences_update is not None:
            _schema.preferred_shipment_type = cls._args_transport_preferences_update.preferred_shipment_type
            return

        cls._args_transport_preferences_update = AAZObjectArg()

        transport_preferences_update = cls._args_transport_preferences_update
        transport_preferences_update.preferred_shipment_type = AAZStrArg(
            options=["preferred-shipment-type"],
            help="Indicates Shipment Logistics type that the customer preferred.",
            required=True,
            enum={"CustomerManaged": "CustomerManaged", "MicrosoftManaged": "MicrosoftManaged"},
        )

        _schema.preferred_shipment_type = cls._args_transport_preferences_update.preferred_shipment_type

    def _execute_operations(self):
        self.pre_operations()
        yield self.JobsUpdate(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 JobsUpdate(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,
                    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]:
                return self.client.build_lro_polling(
                    self.ctx.args.no_wait,
                    session,
                    self.on_200,
                    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.DataBox/jobs/{jobName}",
                **self.url_parameters
            )

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

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

        @property
        def url_parameters(self):
            parameters = {
                **self.serialize_url_param(
                    "jobName", self.ctx.args.job_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", "2022-12-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("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})

            properties = _builder.get(".properties")
            if properties is not None:
                properties.set_prop("details", AAZObjectType)

            details = _builder.get(".properties.details")
            if details is not None:
                details.set_prop("contactDetails", AAZObjectType)
                details.set_prop("keyEncryptionKey", AAZObjectType)
                details.set_prop("shippingAddress", AAZObjectType)

            contact_details = _builder.get(".properties.details.contactDetails")
            if contact_details is not None:
                contact_details.set_prop("contactName", AAZStrType, ".contact_name", typ_kwargs={"flags": {"required": True}})
                contact_details.set_prop("emailList", AAZListType, ".email_list", typ_kwargs={"flags": {"required": True}})
                contact_details.set_prop("mobile", AAZStrType, ".mobile")
                contact_details.set_prop("phone", AAZStrType, ".phone", typ_kwargs={"flags": {"required": True}})

            email_list = _builder.get(".properties.details.contactDetails.emailList")
            if email_list is not None:
                email_list.set_elements(AAZStrType, ".")

            key_encryption_key = _builder.get(".properties.details.keyEncryptionKey")
            if key_encryption_key is not None:
                key_encryption_key.set_prop("identityProperties", AAZObjectType, ".kek_identity")
                key_encryption_key.set_prop("kekType", AAZStrType, ".kek_type", typ_kwargs={"flags": {"required": True}})
                key_encryption_key.set_prop("kekUrl", AAZStrType, ".kek_url")
                key_encryption_key.set_prop("kekVaultResourceID", AAZStrType, ".kek_vault_resource_id")

            identity_properties = _builder.get(".properties.details.keyEncryptionKey.identityProperties")
            if identity_properties is not None:
                identity_properties.set_prop("type", AAZStrType, ".type")
                identity_properties.set_prop("userAssigned", AAZObjectType, ".user_assigned")

            user_assigned = _builder.get(".properties.details.keyEncryptionKey.identityProperties.userAssigned")
            if user_assigned is not None:
                user_assigned.set_prop("resourceId", AAZStrType, ".resource_id")

            shipping_address = _builder.get(".properties.details.shippingAddress")
            if shipping_address is not None:
                shipping_address.set_prop("city", AAZStrType, ".city")
                shipping_address.set_prop("companyName", AAZStrType, ".company_name")
                shipping_address.set_prop("country", AAZStrType, ".country", typ_kwargs={"flags": {"required": True}})
                shipping_address.set_prop("postalCode", AAZStrType, ".postal_code")
                shipping_address.set_prop("stateOrProvince", AAZStrType, ".state_or_province")
                shipping_address.set_prop("streetAddress1", AAZStrType, ".street_address1", typ_kwargs={"flags": {"required": True}})
                shipping_address.set_prop("streetAddress2", AAZStrType, ".street_address2")
                shipping_address.set_prop("streetAddress3", AAZStrType, ".street_address3")

            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.id = AAZStrType(
                flags={"read_only": True},
            )
            _schema_on_200.identity = AAZObjectType()
            _schema_on_200.location = AAZStrType(
                flags={"required": True},
            )
            _schema_on_200.name = AAZStrType(
                flags={"read_only": True},
            )
            _schema_on_200.properties = AAZObjectType(
                flags={"required": True, "client_flatten": True},
            )
            _schema_on_200.sku = AAZObjectType(
                flags={"required": True},
            )
            _schema_on_200.system_data = AAZObjectType(
                serialized_name="systemData",
            )
            _schema_on_200.tags = AAZDictType()
            _schema_on_200.type = AAZStrType(
                flags={"read_only": True},
            )

            identity = cls._schema_on_200.identity
            identity.principal_id = AAZStrType(
                serialized_name="principalId",
                flags={"read_only": True},
            )
            identity.tenant_id = AAZStrType(
                serialized_name="tenantId",
                flags={"read_only": True},
            )
            identity.type = AAZStrType()
            identity.user_assigned_identities = AAZDictType(
                serialized_name="userAssignedIdentities",
            )

            user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities
            user_assigned_identities.Element = AAZObjectType()

            _element = cls._schema_on_200.identity.user_assigned_identities.Element
            _element.client_id = AAZStrType(
                serialized_name="clientId",
                flags={"read_only": True},
            )
            _element.principal_id = AAZStrType(
                serialized_name="principalId",
                flags={"read_only": True},
            )

            properties = cls._schema_on_200.properties
            properties.cancellation_reason = AAZStrType(
                serialized_name="cancellationReason",
                flags={"read_only": True},
            )
            properties.delivery_info = AAZObjectType(
                serialized_name="deliveryInfo",
            )
            properties.delivery_type = AAZStrType(
                serialized_name="deliveryType",
            )
            properties.details = AAZObjectType()
            properties.error = AAZObjectType()
            _UpdateHelper._build_schema_cloud_error_read(properties.error)
            properties.is_cancellable = AAZBoolType(
                serialized_name="isCancellable",
                flags={"read_only": True},
            )
            properties.is_cancellable_without_fee = AAZBoolType(
                serialized_name="isCancellableWithoutFee",
                flags={"read_only": True},
            )
            properties.is_deletable = AAZBoolType(
                serialized_name="isDeletable",
                flags={"read_only": True},
            )
            properties.is_prepare_to_ship_enabled = AAZBoolType(
                serialized_name="isPrepareToShipEnabled",
                flags={"read_only": True},
            )
            properties.is_shipping_address_editable = AAZBoolType(
                serialized_name="isShippingAddressEditable",
                flags={"read_only": True},
            )
            properties.reverse_shipping_details_update = AAZStrType(
                serialized_name="reverseShippingDetailsUpdate",
                flags={"read_only": True},
            )
            properties.reverse_transport_preference_update = AAZStrType(
                serialized_name="reverseTransportPreferenceUpdate",
                flags={"read_only": True},
            )
            properties.start_time = AAZStrType(
                serialized_name="startTime",
                flags={"read_only": True},
            )
            properties.status = AAZStrType(
                flags={"read_only": True},
            )
            properties.transfer_type = AAZStrType(
                serialized_name="transferType",
                flags={"required": True},
            )

            delivery_info = cls._schema_on_200.properties.delivery_info
            delivery_info.scheduled_date_time = AAZStrType(
                serialized_name="scheduledDateTime",
            )

            details = cls._schema_on_200.properties.details
            details.actions = AAZListType(
                flags={"read_only": True},
            )
            details.chain_of_custody_sas_key = AAZStrType(
                serialized_name="chainOfCustodySasKey",
                flags={"read_only": True},
            )
            details.contact_details = AAZObjectType(
                serialized_name="contactDetails",
                flags={"required": True},
            )
            details.copy_log_details = AAZListType(
                serialized_name="copyLogDetails",
                flags={"read_only": True},
            )
            details.data_center_code = AAZStrType(
                serialized_name="dataCenterCode",
                flags={"read_only": True},
            )
            details.data_export_details = AAZListType(
                serialized_name="dataExportDetails",
            )
            details.data_import_details = AAZListType(
                serialized_name="dataImportDetails",
            )
            details.datacenter_address = AAZObjectType(
                serialized_name="datacenterAddress",
            )
            details.delivery_package = AAZObjectType(
                serialized_name="deliveryPackage",
            )
            _UpdateHelper._build_schema_package_shipping_details_read(details.delivery_package)
            details.device_erasure_details = AAZObjectType(
                serialized_name="deviceErasureDetails",
            )
            details.expected_data_size_in_tera_bytes = AAZIntType(
                serialized_name="expectedDataSizeInTeraBytes",
            )
            details.job_details_type = AAZStrType(
                serialized_name="jobDetailsType",
                flags={"required": True},
            )
            details.job_stages = AAZListType(
                serialized_name="jobStages",
                flags={"read_only": True},
            )
            details.key_encryption_key = AAZObjectType(
                serialized_name="keyEncryptionKey",
            )
            details.last_mitigation_action_on_job = AAZObjectType(
                serialized_name="lastMitigationActionOnJob",
            )
            details.preferences = AAZObjectType()
            details.return_package = AAZObjectType(
                serialized_name="returnPackage",
            )
            _UpdateHelper._build_schema_package_shipping_details_read(details.return_package)
            details.reverse_shipment_label_sas_key = AAZStrType(
                serialized_name="reverseShipmentLabelSasKey",
                flags={"read_only": True},
            )
            details.reverse_shipping_details = AAZObjectType(
                serialized_name="reverseShippingDetails",
            )
            details.shipping_address = AAZObjectType(
                serialized_name="shippingAddress",
            )
            _UpdateHelper._build_schema_shipping_address_read(details.shipping_address)

            actions = cls._schema_on_200.properties.details.actions
            actions.Element = AAZStrType()

            contact_details = cls._schema_on_200.properties.details.contact_details
            contact_details.contact_name = AAZStrType(
                serialized_name="contactName",
                flags={"required": True},
            )
            contact_details.email_list = AAZListType(
                serialized_name="emailList",
                flags={"required": True},
            )
            contact_details.mobile = AAZStrType()
            contact_details.notification_preference = AAZListType(
                serialized_name="notificationPreference",
            )
            contact_details.phone = AAZStrType(
                flags={"required": True},
            )
            contact_details.phone_extension = AAZStrType(
                serialized_name="phoneExtension",
            )

            email_list = cls._schema_on_200.properties.details.contact_details.email_list
            email_list.Element = AAZStrType()

            notification_preference = cls._schema_on_200.properties.details.contact_details.notification_preference
            notification_preference.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.contact_details.notification_preference.Element
            _element.send_notification = AAZBoolType(
                serialized_name="sendNotification",
                flags={"required": True},
            )
            _element.stage_name = AAZStrType(
                serialized_name="stageName",
                flags={"required": True},
            )

            copy_log_details = cls._schema_on_200.properties.details.copy_log_details
            copy_log_details.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.copy_log_details.Element
            _element.copy_log_details_type = AAZStrType(
                serialized_name="copyLogDetailsType",
                flags={"required": True},
            )

            disc_data_box = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBox")
            disc_data_box.account_name = AAZStrType(
                serialized_name="accountName",
                flags={"read_only": True},
            )
            disc_data_box.copy_log_link = AAZStrType(
                serialized_name="copyLogLink",
                flags={"read_only": True},
            )
            disc_data_box.copy_verbose_log_link = AAZStrType(
                serialized_name="copyVerboseLogLink",
                flags={"read_only": True},
            )

            disc_data_box_customer_disk = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBoxCustomerDisk")
            disc_data_box_customer_disk.error_log_link = AAZStrType(
                serialized_name="errorLogLink",
                flags={"read_only": True},
            )
            disc_data_box_customer_disk.serial_number = AAZStrType(
                serialized_name="serialNumber",
                flags={"read_only": True},
            )
            disc_data_box_customer_disk.verbose_log_link = AAZStrType(
                serialized_name="verboseLogLink",
                flags={"read_only": True},
            )

            disc_data_box_disk = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBoxDisk")
            disc_data_box_disk.disk_serial_number = AAZStrType(
                serialized_name="diskSerialNumber",
                flags={"read_only": True},
            )
            disc_data_box_disk.error_log_link = AAZStrType(
                serialized_name="errorLogLink",
                flags={"read_only": True},
            )
            disc_data_box_disk.verbose_log_link = AAZStrType(
                serialized_name="verboseLogLink",
                flags={"read_only": True},
            )

            disc_data_box_heavy = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBoxHeavy")
            disc_data_box_heavy.account_name = AAZStrType(
                serialized_name="accountName",
                flags={"read_only": True},
            )
            disc_data_box_heavy.copy_log_link = AAZListType(
                serialized_name="copyLogLink",
                flags={"read_only": True},
            )
            disc_data_box_heavy.copy_verbose_log_link = AAZListType(
                serialized_name="copyVerboseLogLink",
                flags={"read_only": True},
            )

            copy_log_link = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBoxHeavy").copy_log_link
            copy_log_link.Element = AAZStrType()

            copy_verbose_log_link = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBoxHeavy").copy_verbose_log_link
            copy_verbose_log_link.Element = AAZStrType()

            data_export_details = cls._schema_on_200.properties.details.data_export_details
            data_export_details.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.data_export_details.Element
            _element.account_details = AAZObjectType(
                serialized_name="accountDetails",
                flags={"required": True},
            )
            _UpdateHelper._build_schema_data_account_details_read(_element.account_details)
            _element.log_collection_level = AAZStrType(
                serialized_name="logCollectionLevel",
            )
            _element.transfer_configuration = AAZObjectType(
                serialized_name="transferConfiguration",
                flags={"required": True},
            )

            transfer_configuration = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration
            transfer_configuration.transfer_all_details = AAZObjectType(
                serialized_name="transferAllDetails",
            )
            transfer_configuration.transfer_configuration_type = AAZStrType(
                serialized_name="transferConfigurationType",
                flags={"required": True},
            )
            transfer_configuration.transfer_filter_details = AAZObjectType(
                serialized_name="transferFilterDetails",
            )

            transfer_all_details = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_all_details
            transfer_all_details.include = AAZObjectType()

            include = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_all_details.include
            include.data_account_type = AAZStrType(
                serialized_name="dataAccountType",
                flags={"required": True},
            )
            include.transfer_all_blobs = AAZBoolType(
                serialized_name="transferAllBlobs",
            )
            include.transfer_all_files = AAZBoolType(
                serialized_name="transferAllFiles",
            )

            transfer_filter_details = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details
            transfer_filter_details.include = AAZObjectType()

            include = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include
            include.azure_file_filter_details = AAZObjectType(
                serialized_name="azureFileFilterDetails",
            )
            include.blob_filter_details = AAZObjectType(
                serialized_name="blobFilterDetails",
            )
            include.data_account_type = AAZStrType(
                serialized_name="dataAccountType",
                flags={"required": True},
            )
            include.filter_file_details = AAZListType(
                serialized_name="filterFileDetails",
            )

            azure_file_filter_details = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.azure_file_filter_details
            azure_file_filter_details.file_path_list = AAZListType(
                serialized_name="filePathList",
            )
            azure_file_filter_details.file_prefix_list = AAZListType(
                serialized_name="filePrefixList",
            )
            azure_file_filter_details.file_share_list = AAZListType(
                serialized_name="fileShareList",
            )

            file_path_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.azure_file_filter_details.file_path_list
            file_path_list.Element = AAZStrType()

            file_prefix_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.azure_file_filter_details.file_prefix_list
            file_prefix_list.Element = AAZStrType()

            file_share_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.azure_file_filter_details.file_share_list
            file_share_list.Element = AAZStrType()

            blob_filter_details = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.blob_filter_details
            blob_filter_details.blob_path_list = AAZListType(
                serialized_name="blobPathList",
            )
            blob_filter_details.blob_prefix_list = AAZListType(
                serialized_name="blobPrefixList",
            )
            blob_filter_details.container_list = AAZListType(
                serialized_name="containerList",
            )

            blob_path_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.blob_filter_details.blob_path_list
            blob_path_list.Element = AAZStrType()

            blob_prefix_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.blob_filter_details.blob_prefix_list
            blob_prefix_list.Element = AAZStrType()

            container_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.blob_filter_details.container_list
            container_list.Element = AAZStrType()

            filter_file_details = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.filter_file_details
            filter_file_details.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.filter_file_details.Element
            _element.filter_file_path = AAZStrType(
                serialized_name="filterFilePath",
                flags={"required": True},
            )
            _element.filter_file_type = AAZStrType(
                serialized_name="filterFileType",
                flags={"required": True},
            )

            data_import_details = cls._schema_on_200.properties.details.data_import_details
            data_import_details.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.data_import_details.Element
            _element.account_details = AAZObjectType(
                serialized_name="accountDetails",
                flags={"required": True},
            )
            _UpdateHelper._build_schema_data_account_details_read(_element.account_details)
            _element.log_collection_level = AAZStrType(
                serialized_name="logCollectionLevel",
            )

            datacenter_address = cls._schema_on_200.properties.details.datacenter_address
            datacenter_address.data_center_azure_location = AAZStrType(
                serialized_name="dataCenterAzureLocation",
                flags={"read_only": True},
            )
            datacenter_address.datacenter_address_type = AAZStrType(
                serialized_name="datacenterAddressType",
                flags={"required": True},
            )
            datacenter_address.supported_carriers_for_return_shipment = AAZListType(
                serialized_name="supportedCarriersForReturnShipment",
                flags={"read_only": True},
            )

            supported_carriers_for_return_shipment = cls._schema_on_200.properties.details.datacenter_address.supported_carriers_for_return_shipment
            supported_carriers_for_return_shipment.Element = AAZStrType()

            disc_datacenter_address_instruction = cls._schema_on_200.properties.details.datacenter_address.discriminate_by("datacenter_address_type", "DatacenterAddressInstruction")
            disc_datacenter_address_instruction.communication_instruction = AAZStrType(
                serialized_name="communicationInstruction",
                flags={"read_only": True},
            )

            disc_datacenter_address_location = cls._schema_on_200.properties.details.datacenter_address.discriminate_by("datacenter_address_type", "DatacenterAddressLocation")
            disc_datacenter_address_location.additional_shipping_information = AAZStrType(
                serialized_name="additionalShippingInformation",
                flags={"read_only": True},
            )
            disc_datacenter_address_location.address_type = AAZStrType(
                serialized_name="addressType",
                flags={"read_only": True},
            )
            disc_datacenter_address_location.city = AAZStrType(
                flags={"read_only": True},
            )
            disc_datacenter_address_location.company = AAZStrType(
                flags={"read_only": True},
            )
            disc_datacenter_address_location.contact_person_name = AAZStrType(
                serialized_name="contactPersonName",
                flags={"read_only": True},
            )
            disc_datacenter_address_location.country = AAZStrType(
                flags={"read_only": True},
            )
            disc_datacenter_address_location.phone = AAZStrType(
                flags={"read_only": True},
            )
            disc_datacenter_address_location.phone_extension = AAZStrType(
                serialized_name="phoneExtension",
                flags={"read_only": True},
            )
            disc_datacenter_address_location.state = AAZStrType(
                flags={"read_only": True},
            )
            disc_datacenter_address_location.street1 = AAZStrType(
                flags={"read_only": True},
            )
            disc_datacenter_address_location.street2 = AAZStrType(
                flags={"read_only": True},
            )
            disc_datacenter_address_location.street3 = AAZStrType(
                flags={"read_only": True},
            )
            disc_datacenter_address_location.zip = AAZStrType(
                flags={"read_only": True},
            )

            device_erasure_details = cls._schema_on_200.properties.details.device_erasure_details
            device_erasure_details.device_erasure_status = AAZStrType(
                serialized_name="deviceErasureStatus",
                flags={"read_only": True},
            )
            device_erasure_details.erasure_or_destruction_certificate_sas_key = AAZStrType(
                serialized_name="erasureOrDestructionCertificateSasKey",
                flags={"read_only": True},
            )

            job_stages = cls._schema_on_200.properties.details.job_stages
            job_stages.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.job_stages.Element
            _element.display_name = AAZStrType(
                serialized_name="displayName",
                flags={"read_only": True},
            )
            _element.stage_name = AAZStrType(
                serialized_name="stageName",
                flags={"read_only": True},
            )
            _element.stage_status = AAZStrType(
                serialized_name="stageStatus",
                flags={"read_only": True},
            )
            _element.stage_time = AAZStrType(
                serialized_name="stageTime",
                flags={"read_only": True},
            )

            key_encryption_key = cls._schema_on_200.properties.details.key_encryption_key
            key_encryption_key.identity_properties = AAZObjectType(
                serialized_name="identityProperties",
            )
            key_encryption_key.kek_type = AAZStrType(
                serialized_name="kekType",
                flags={"required": True},
            )
            key_encryption_key.kek_url = AAZStrType(
                serialized_name="kekUrl",
            )
            key_encryption_key.kek_vault_resource_id = AAZStrType(
                serialized_name="kekVaultResourceID",
            )

            identity_properties = cls._schema_on_200.properties.details.key_encryption_key.identity_properties
            identity_properties.type = AAZStrType()
            identity_properties.user_assigned = AAZObjectType(
                serialized_name="userAssigned",
            )

            user_assigned = cls._schema_on_200.properties.details.key_encryption_key.identity_properties.user_assigned
            user_assigned.resource_id = AAZStrType(
                serialized_name="resourceId",
            )

            last_mitigation_action_on_job = cls._schema_on_200.properties.details.last_mitigation_action_on_job
            last_mitigation_action_on_job.action_date_time_in_utc = AAZStrType(
                serialized_name="actionDateTimeInUtc",
            )
            last_mitigation_action_on_job.customer_resolution = AAZStrType(
                serialized_name="customerResolution",
            )
            last_mitigation_action_on_job.is_performed_by_customer = AAZBoolType(
                serialized_name="isPerformedByCustomer",
            )

            preferences = cls._schema_on_200.properties.details.preferences
            preferences.encryption_preferences = AAZObjectType(
                serialized_name="encryptionPreferences",
            )
            preferences.preferred_data_center_region = AAZListType(
                serialized_name="preferredDataCenterRegion",
            )
            preferences.reverse_transport_preferences = AAZObjectType(
                serialized_name="reverseTransportPreferences",
            )
            _UpdateHelper._build_schema_transport_preferences_read(preferences.reverse_transport_preferences)
            preferences.storage_account_access_tier_preferences = AAZListType(
                serialized_name="storageAccountAccessTierPreferences",
            )
            preferences.transport_preferences = AAZObjectType(
                serialized_name="transportPreferences",
            )
            _UpdateHelper._build_schema_transport_preferences_read(preferences.transport_preferences)

            encryption_preferences = cls._schema_on_200.properties.details.preferences.encryption_preferences
            encryption_preferences.double_encryption = AAZStrType(
                serialized_name="doubleEncryption",
            )
            encryption_preferences.hardware_encryption = AAZStrType(
                serialized_name="hardwareEncryption",
            )

            preferred_data_center_region = cls._schema_on_200.properties.details.preferences.preferred_data_center_region
            preferred_data_center_region.Element = AAZStrType()

            storage_account_access_tier_preferences = cls._schema_on_200.properties.details.preferences.storage_account_access_tier_preferences
            storage_account_access_tier_preferences.Element = AAZStrType()

            reverse_shipping_details = cls._schema_on_200.properties.details.reverse_shipping_details
            reverse_shipping_details.contact_details = AAZObjectType(
                serialized_name="contactDetails",
            )
            reverse_shipping_details.is_updated = AAZBoolType(
                serialized_name="isUpdated",
                flags={"read_only": True},
            )
            reverse_shipping_details.shipping_address = AAZObjectType(
                serialized_name="shippingAddress",
            )
            _UpdateHelper._build_schema_shipping_address_read(reverse_shipping_details.shipping_address)

            contact_details = cls._schema_on_200.properties.details.reverse_shipping_details.contact_details
            contact_details.contact_name = AAZStrType(
                serialized_name="contactName",
                flags={"required": True},
            )
            contact_details.mobile = AAZStrType()
            contact_details.phone = AAZStrType(
                flags={"required": True},
            )
            contact_details.phone_extension = AAZStrType(
                serialized_name="phoneExtension",
            )

            disc_data_box = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBox")
            disc_data_box.copy_progress = AAZListType(
                serialized_name="copyProgress",
                flags={"read_only": True},
            )
            disc_data_box.device_password = AAZStrType(
                serialized_name="devicePassword",
            )

            copy_progress = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBox").copy_progress
            copy_progress.Element = AAZObjectType()
            _UpdateHelper._build_schema_copy_progress_read(copy_progress.Element)

            disc_data_box_customer_disk = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk")
            disc_data_box_customer_disk.copy_progress = AAZListType(
                serialized_name="copyProgress",
                flags={"read_only": True},
            )
            disc_data_box_customer_disk.deliver_to_dc_package_details = AAZObjectType(
                serialized_name="deliverToDcPackageDetails",
            )
            disc_data_box_customer_disk.enable_manifest_backup = AAZBoolType(
                serialized_name="enableManifestBackup",
            )
            disc_data_box_customer_disk.export_disk_details_collection = AAZDictType(
                serialized_name="exportDiskDetailsCollection",
                flags={"read_only": True},
            )
            disc_data_box_customer_disk.import_disk_details_collection = AAZDictType(
                serialized_name="importDiskDetailsCollection",
            )
            disc_data_box_customer_disk.return_to_customer_package_details = AAZObjectType(
                serialized_name="returnToCustomerPackageDetails",
                flags={"required": True},
            )

            copy_progress = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").copy_progress
            copy_progress.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").copy_progress.Element
            _element.account_id = AAZStrType(
                serialized_name="accountId",
                flags={"read_only": True},
            )
            _element.actions = AAZListType(
                flags={"read_only": True},
            )
            _element.bytes_processed = AAZIntType(
                serialized_name="bytesProcessed",
                flags={"read_only": True},
            )
            _element.copy_status = AAZStrType(
                serialized_name="copyStatus",
                flags={"read_only": True},
            )
            _element.data_account_type = AAZStrType(
                serialized_name="dataAccountType",
                flags={"read_only": True},
            )
            _element.directories_errored_out = AAZIntType(
                serialized_name="directoriesErroredOut",
                flags={"read_only": True},
            )
            _element.error = AAZObjectType()
            _UpdateHelper._build_schema_cloud_error_read(_element.error)
            _element.files_errored_out = AAZIntType(
                serialized_name="filesErroredOut",
                flags={"read_only": True},
            )
            _element.files_processed = AAZIntType(
                serialized_name="filesProcessed",
                flags={"read_only": True},
            )
            _element.invalid_directories_processed = AAZIntType(
                serialized_name="invalidDirectoriesProcessed",
                flags={"read_only": True},
            )
            _element.invalid_file_bytes_uploaded = AAZIntType(
                serialized_name="invalidFileBytesUploaded",
                flags={"read_only": True},
            )
            _element.invalid_files_processed = AAZIntType(
                serialized_name="invalidFilesProcessed",
                flags={"read_only": True},
            )
            _element.is_enumeration_in_progress = AAZBoolType(
                serialized_name="isEnumerationInProgress",
                flags={"read_only": True},
            )
            _element.renamed_container_count = AAZIntType(
                serialized_name="renamedContainerCount",
                flags={"read_only": True},
            )
            _element.serial_number = AAZStrType(
                serialized_name="serialNumber",
                flags={"read_only": True},
            )
            _element.storage_account_name = AAZStrType(
                serialized_name="storageAccountName",
                flags={"read_only": True},
            )
            _element.total_bytes_to_process = AAZIntType(
                serialized_name="totalBytesToProcess",
                flags={"read_only": True},
            )
            _element.total_files_to_process = AAZIntType(
                serialized_name="totalFilesToProcess",
                flags={"read_only": True},
            )
            _element.transfer_type = AAZStrType(
                serialized_name="transferType",
                flags={"read_only": True},
            )

            actions = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").copy_progress.Element.actions
            actions.Element = AAZStrType()

            deliver_to_dc_package_details = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").deliver_to_dc_package_details
            deliver_to_dc_package_details.carrier_name = AAZStrType(
                serialized_name="carrierName",
            )
            deliver_to_dc_package_details.tracking_id = AAZStrType(
                serialized_name="trackingId",
            )

            export_disk_details_collection = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").export_disk_details_collection
            export_disk_details_collection.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").export_disk_details_collection.Element
            _element.backup_manifest_cloud_path = AAZStrType(
                serialized_name="backupManifestCloudPath",
                flags={"read_only": True},
            )
            _element.manifest_file = AAZStrType(
                serialized_name="manifestFile",
                flags={"read_only": True},
            )
            _element.manifest_hash = AAZStrType(
                serialized_name="manifestHash",
                flags={"read_only": True},
            )

            import_disk_details_collection = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").import_disk_details_collection
            import_disk_details_collection.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").import_disk_details_collection.Element
            _element.backup_manifest_cloud_path = AAZStrType(
                serialized_name="backupManifestCloudPath",
                flags={"read_only": True},
            )
            _element.bit_locker_key = AAZStrType(
                serialized_name="bitLockerKey",
                flags={"required": True, "secret": True},
            )
            _element.manifest_file = AAZStrType(
                serialized_name="manifestFile",
                flags={"required": True},
            )
            _element.manifest_hash = AAZStrType(
                serialized_name="manifestHash",
                flags={"required": True},
            )

            return_to_customer_package_details = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").return_to_customer_package_details
            return_to_customer_package_details.carrier_account_number = AAZStrType(
                serialized_name="carrierAccountNumber",
                flags={"secret": True},
            )
            return_to_customer_package_details.carrier_name = AAZStrType(
                serialized_name="carrierName",
            )
            return_to_customer_package_details.tracking_id = AAZStrType(
                serialized_name="trackingId",
            )

            disc_data_box_disk = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk")
            disc_data_box_disk.copy_progress = AAZListType(
                serialized_name="copyProgress",
                flags={"read_only": True},
            )
            disc_data_box_disk.disks_and_size_details = AAZDictType(
                serialized_name="disksAndSizeDetails",
                flags={"read_only": True},
            )
            disc_data_box_disk.granular_copy_log_details = AAZListType(
                serialized_name="granularCopyLogDetails",
                flags={"read_only": True},
            )
            disc_data_box_disk.granular_copy_progress = AAZListType(
                serialized_name="granularCopyProgress",
                flags={"read_only": True},
            )
            disc_data_box_disk.passkey = AAZStrType()
            disc_data_box_disk.preferred_disks = AAZDictType(
                serialized_name="preferredDisks",
            )

            copy_progress = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").copy_progress
            copy_progress.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").copy_progress.Element
            _element.actions = AAZListType(
                flags={"read_only": True},
            )
            _element.bytes_copied = AAZIntType(
                serialized_name="bytesCopied",
                flags={"read_only": True},
            )
            _element.error = AAZObjectType()
            _UpdateHelper._build_schema_cloud_error_read(_element.error)
            _element.percent_complete = AAZIntType(
                serialized_name="percentComplete",
                flags={"read_only": True},
            )
            _element.serial_number = AAZStrType(
                serialized_name="serialNumber",
                flags={"read_only": True},
            )
            _element.status = AAZStrType(
                flags={"read_only": True},
            )

            actions = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").copy_progress.Element.actions
            actions.Element = AAZStrType()

            disks_and_size_details = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").disks_and_size_details
            disks_and_size_details.Element = AAZIntType()

            granular_copy_log_details = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").granular_copy_log_details
            granular_copy_log_details.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").granular_copy_log_details.Element
            _element.account_id = AAZStrType(
                serialized_name="accountId",
                flags={"read_only": True},
            )
            _element.copy_log_details_type = AAZStrType(
                serialized_name="copyLogDetailsType",
                flags={"required": True},
            )
            _element.error_log_link = AAZStrType(
                serialized_name="errorLogLink",
                flags={"read_only": True},
            )
            _element.serial_number = AAZStrType(
                serialized_name="serialNumber",
                flags={"read_only": True},
            )
            _element.verbose_log_link = AAZStrType(
                serialized_name="verboseLogLink",
                flags={"read_only": True},
            )

            granular_copy_progress = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").granular_copy_progress
            granular_copy_progress.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").granular_copy_progress.Element
            _element.account_id = AAZStrType(
                serialized_name="accountId",
                flags={"read_only": True},
            )
            _element.actions = AAZListType(
                flags={"read_only": True},
            )
            _element.bytes_processed = AAZIntType(
                serialized_name="bytesProcessed",
                flags={"read_only": True},
            )
            _element.copy_status = AAZStrType(
                serialized_name="copyStatus",
                flags={"read_only": True},
            )
            _element.data_account_type = AAZStrType(
                serialized_name="dataAccountType",
                flags={"read_only": True},
            )
            _element.directories_errored_out = AAZIntType(
                serialized_name="directoriesErroredOut",
                flags={"read_only": True},
            )
            _element.error = AAZObjectType()
            _UpdateHelper._build_schema_cloud_error_read(_element.error)
            _element.files_errored_out = AAZIntType(
                serialized_name="filesErroredOut",
                flags={"read_only": True},
            )
            _element.files_processed = AAZIntType(
                serialized_name="filesProcessed",
                flags={"read_only": True},
            )
            _element.invalid_directories_processed = AAZIntType(
                serialized_name="invalidDirectoriesProcessed",
                flags={"read_only": True},
            )
            _element.invalid_file_bytes_uploaded = AAZIntType(
                serialized_name="invalidFileBytesUploaded",
                flags={"read_only": True},
            )
            _element.invalid_files_processed = AAZIntType(
                serialized_name="invalidFilesProcessed",
                flags={"read_only": True},
            )
            _element.is_enumeration_in_progress = AAZBoolType(
                serialized_name="isEnumerationInProgress",
                flags={"read_only": True},
            )
            _element.renamed_container_count = AAZIntType(
                serialized_name="renamedContainerCount",
                flags={"read_only": True},
            )
            _element.serial_number = AAZStrType(
                serialized_name="serialNumber",
                flags={"read_only": True},
            )
            _element.storage_account_name = AAZStrType(
                serialized_name="storageAccountName",
                flags={"read_only": True},
            )
            _element.total_bytes_to_process = AAZIntType(
                serialized_name="totalBytesToProcess",
                flags={"read_only": True},
            )
            _element.total_files_to_process = AAZIntType(
                serialized_name="totalFilesToProcess",
                flags={"read_only": True},
            )
            _element.transfer_type = AAZStrType(
                serialized_name="transferType",
                flags={"read_only": True},
            )

            actions = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").granular_copy_progress.Element.actions
            actions.Element = AAZStrType()

            preferred_disks = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").preferred_disks
            preferred_disks.Element = AAZIntType()

            disc_data_box_heavy = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxHeavy")
            disc_data_box_heavy.copy_progress = AAZListType(
                serialized_name="copyProgress",
                flags={"read_only": True},
            )
            disc_data_box_heavy.device_password = AAZStrType(
                serialized_name="devicePassword",
            )

            copy_progress = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxHeavy").copy_progress
            copy_progress.Element = AAZObjectType()
            _UpdateHelper._build_schema_copy_progress_read(copy_progress.Element)

            sku = cls._schema_on_200.sku
            sku.display_name = AAZStrType(
                serialized_name="displayName",
            )
            sku.family = AAZStrType()
            sku.name = AAZStrType(
                flags={"required": True},
            )

            system_data = cls._schema_on_200.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},
            )

            tags = cls._schema_on_200.tags
            tags.Element = AAZStrType()

            return cls._schema_on_200


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

    @classmethod
    def _build_schema_shipping_address_update(cls, _builder):
        if _builder is None:
            return
        _builder.set_prop("addressType", AAZStrType, ".address_type")
        _builder.set_prop("city", AAZStrType, ".city")
        _builder.set_prop("companyName", AAZStrType, ".company_name")
        _builder.set_prop("country", AAZStrType, ".country", typ_kwargs={"flags": {"required": True}})
        _builder.set_prop("postalCode", AAZStrType, ".postal_code")
        _builder.set_prop("skipAddressValidation", AAZBoolType, ".skip_address_validation")
        _builder.set_prop("stateOrProvince", AAZStrType, ".state_or_province")
        _builder.set_prop("streetAddress1", AAZStrType, ".street_address1", typ_kwargs={"flags": {"required": True}})
        _builder.set_prop("streetAddress2", AAZStrType, ".street_address2")
        _builder.set_prop("streetAddress3", AAZStrType, ".street_address3")
        _builder.set_prop("taxIdentificationNumber", AAZStrType, ".tax_identification_number")
        _builder.set_prop("zipExtendedCode", AAZStrType, ".zip_extended_code")

    @classmethod
    def _build_schema_transport_preferences_update(cls, _builder):
        if _builder is None:
            return
        _builder.set_prop("preferredShipmentType", AAZStrType, ".preferred_shipment_type", typ_kwargs={"flags": {"required": True}})

    _schema_cloud_error_read = None

    @classmethod
    def _build_schema_cloud_error_read(cls, _schema):
        if cls._schema_cloud_error_read is not None:
            _schema.additional_info = cls._schema_cloud_error_read.additional_info
            _schema.code = cls._schema_cloud_error_read.code
            _schema.details = cls._schema_cloud_error_read.details
            _schema.message = cls._schema_cloud_error_read.message
            _schema.target = cls._schema_cloud_error_read.target
            return

        cls._schema_cloud_error_read = _schema_cloud_error_read = AAZObjectType()

        cloud_error_read = _schema_cloud_error_read
        cloud_error_read.additional_info = AAZListType(
            serialized_name="additionalInfo",
            flags={"read_only": True},
        )
        cloud_error_read.code = AAZStrType()
        cloud_error_read.details = AAZListType(
            flags={"read_only": True},
        )
        cloud_error_read.message = AAZStrType()
        cloud_error_read.target = AAZStrType()

        additional_info = _schema_cloud_error_read.additional_info
        additional_info.Element = AAZObjectType()

        _element = _schema_cloud_error_read.additional_info.Element
        _element.type = AAZStrType()

        details = _schema_cloud_error_read.details
        details.Element = AAZObjectType()
        cls._build_schema_cloud_error_read(details.Element)

        _schema.additional_info = cls._schema_cloud_error_read.additional_info
        _schema.code = cls._schema_cloud_error_read.code
        _schema.details = cls._schema_cloud_error_read.details
        _schema.message = cls._schema_cloud_error_read.message
        _schema.target = cls._schema_cloud_error_read.target

    _schema_copy_progress_read = None

    @classmethod
    def _build_schema_copy_progress_read(cls, _schema):
        if cls._schema_copy_progress_read is not None:
            _schema.account_id = cls._schema_copy_progress_read.account_id
            _schema.actions = cls._schema_copy_progress_read.actions
            _schema.bytes_processed = cls._schema_copy_progress_read.bytes_processed
            _schema.data_account_type = cls._schema_copy_progress_read.data_account_type
            _schema.directories_errored_out = cls._schema_copy_progress_read.directories_errored_out
            _schema.error = cls._schema_copy_progress_read.error
            _schema.files_errored_out = cls._schema_copy_progress_read.files_errored_out
            _schema.files_processed = cls._schema_copy_progress_read.files_processed
            _schema.invalid_directories_processed = cls._schema_copy_progress_read.invalid_directories_processed
            _schema.invalid_file_bytes_uploaded = cls._schema_copy_progress_read.invalid_file_bytes_uploaded
            _schema.invalid_files_processed = cls._schema_copy_progress_read.invalid_files_processed
            _schema.is_enumeration_in_progress = cls._schema_copy_progress_read.is_enumeration_in_progress
            _schema.renamed_container_count = cls._schema_copy_progress_read.renamed_container_count
            _schema.storage_account_name = cls._schema_copy_progress_read.storage_account_name
            _schema.total_bytes_to_process = cls._schema_copy_progress_read.total_bytes_to_process
            _schema.total_files_to_process = cls._schema_copy_progress_read.total_files_to_process
            _schema.transfer_type = cls._schema_copy_progress_read.transfer_type
            return

        cls._schema_copy_progress_read = _schema_copy_progress_read = AAZObjectType()

        copy_progress_read = _schema_copy_progress_read
        copy_progress_read.account_id = AAZStrType(
            serialized_name="accountId",
            flags={"read_only": True},
        )
        copy_progress_read.actions = AAZListType(
            flags={"read_only": True},
        )
        copy_progress_read.bytes_processed = AAZIntType(
            serialized_name="bytesProcessed",
            flags={"read_only": True},
        )
        copy_progress_read.data_account_type = AAZStrType(
            serialized_name="dataAccountType",
            flags={"read_only": True},
        )
        copy_progress_read.directories_errored_out = AAZIntType(
            serialized_name="directoriesErroredOut",
            flags={"read_only": True},
        )
        copy_progress_read.error = AAZObjectType()
        cls._build_schema_cloud_error_read(copy_progress_read.error)
        copy_progress_read.files_errored_out = AAZIntType(
            serialized_name="filesErroredOut",
            flags={"read_only": True},
        )
        copy_progress_read.files_processed = AAZIntType(
            serialized_name="filesProcessed",
            flags={"read_only": True},
        )
        copy_progress_read.invalid_directories_processed = AAZIntType(
            serialized_name="invalidDirectoriesProcessed",
            flags={"read_only": True},
        )
        copy_progress_read.invalid_file_bytes_uploaded = AAZIntType(
            serialized_name="invalidFileBytesUploaded",
            flags={"read_only": True},
        )
        copy_progress_read.invalid_files_processed = AAZIntType(
            serialized_name="invalidFilesProcessed",
            flags={"read_only": True},
        )
        copy_progress_read.is_enumeration_in_progress = AAZBoolType(
            serialized_name="isEnumerationInProgress",
            flags={"read_only": True},
        )
        copy_progress_read.renamed_container_count = AAZIntType(
            serialized_name="renamedContainerCount",
            flags={"read_only": True},
        )
        copy_progress_read.storage_account_name = AAZStrType(
            serialized_name="storageAccountName",
            flags={"read_only": True},
        )
        copy_progress_read.total_bytes_to_process = AAZIntType(
            serialized_name="totalBytesToProcess",
            flags={"read_only": True},
        )
        copy_progress_read.total_files_to_process = AAZIntType(
            serialized_name="totalFilesToProcess",
            flags={"read_only": True},
        )
        copy_progress_read.transfer_type = AAZStrType(
            serialized_name="transferType",
            flags={"read_only": True},
        )

        actions = _schema_copy_progress_read.actions
        actions.Element = AAZStrType()

        _schema.account_id = cls._schema_copy_progress_read.account_id
        _schema.actions = cls._schema_copy_progress_read.actions
        _schema.bytes_processed = cls._schema_copy_progress_read.bytes_processed
        _schema.data_account_type = cls._schema_copy_progress_read.data_account_type
        _schema.directories_errored_out = cls._schema_copy_progress_read.directories_errored_out
        _schema.error = cls._schema_copy_progress_read.error
        _schema.files_errored_out = cls._schema_copy_progress_read.files_errored_out
        _schema.files_processed = cls._schema_copy_progress_read.files_processed
        _schema.invalid_directories_processed = cls._schema_copy_progress_read.invalid_directories_processed
        _schema.invalid_file_bytes_uploaded = cls._schema_copy_progress_read.invalid_file_bytes_uploaded
        _schema.invalid_files_processed = cls._schema_copy_progress_read.invalid_files_processed
        _schema.is_enumeration_in_progress = cls._schema_copy_progress_read.is_enumeration_in_progress
        _schema.renamed_container_count = cls._schema_copy_progress_read.renamed_container_count
        _schema.storage_account_name = cls._schema_copy_progress_read.storage_account_name
        _schema.total_bytes_to_process = cls._schema_copy_progress_read.total_bytes_to_process
        _schema.total_files_to_process = cls._schema_copy_progress_read.total_files_to_process
        _schema.transfer_type = cls._schema_copy_progress_read.transfer_type

    _schema_data_account_details_read = None

    @classmethod
    def _build_schema_data_account_details_read(cls, _schema):
        if cls._schema_data_account_details_read is not None:
            _schema.data_account_type = cls._schema_data_account_details_read.data_account_type
            _schema.discriminate_by(
                "data_account_type",
                "ManagedDisk",
                cls._schema_data_account_details_read.discriminate_by(
                    "data_account_type",
                    "ManagedDisk",
                )
            )
            _schema.discriminate_by(
                "data_account_type",
                "StorageAccount",
                cls._schema_data_account_details_read.discriminate_by(
                    "data_account_type",
                    "StorageAccount",
                )
            )
            return

        cls._schema_data_account_details_read = _schema_data_account_details_read = AAZObjectType()

        data_account_details_read = _schema_data_account_details_read
        data_account_details_read.data_account_type = AAZStrType(
            serialized_name="dataAccountType",
            flags={"required": True},
        )

        disc_managed_disk = _schema_data_account_details_read.discriminate_by("data_account_type", "ManagedDisk")
        disc_managed_disk.resource_group_id = AAZStrType(
            serialized_name="resourceGroupId",
            flags={"required": True},
        )
        disc_managed_disk.staging_storage_account_id = AAZStrType(
            serialized_name="stagingStorageAccountId",
            flags={"required": True},
        )

        disc_storage_account = _schema_data_account_details_read.discriminate_by("data_account_type", "StorageAccount")
        disc_storage_account.storage_account_id = AAZStrType(
            serialized_name="storageAccountId",
            flags={"required": True},
        )

        _schema.data_account_type = cls._schema_data_account_details_read.data_account_type
        _schema.discriminate_by(
                "data_account_type",
                "ManagedDisk",
                cls._schema_data_account_details_read.discriminate_by(
                    "data_account_type",
                    "ManagedDisk",
                )
            )
        _schema.discriminate_by(
                "data_account_type",
                "StorageAccount",
                cls._schema_data_account_details_read.discriminate_by(
                    "data_account_type",
                    "StorageAccount",
                )
            )

    _schema_package_shipping_details_read = None

    @classmethod
    def _build_schema_package_shipping_details_read(cls, _schema):
        if cls._schema_package_shipping_details_read is not None:
            _schema.carrier_name = cls._schema_package_shipping_details_read.carrier_name
            _schema.tracking_id = cls._schema_package_shipping_details_read.tracking_id
            _schema.tracking_url = cls._schema_package_shipping_details_read.tracking_url
            return

        cls._schema_package_shipping_details_read = _schema_package_shipping_details_read = AAZObjectType()

        package_shipping_details_read = _schema_package_shipping_details_read
        package_shipping_details_read.carrier_name = AAZStrType(
            serialized_name="carrierName",
            flags={"read_only": True},
        )
        package_shipping_details_read.tracking_id = AAZStrType(
            serialized_name="trackingId",
            flags={"read_only": True},
        )
        package_shipping_details_read.tracking_url = AAZStrType(
            serialized_name="trackingUrl",
            flags={"read_only": True},
        )

        _schema.carrier_name = cls._schema_package_shipping_details_read.carrier_name
        _schema.tracking_id = cls._schema_package_shipping_details_read.tracking_id
        _schema.tracking_url = cls._schema_package_shipping_details_read.tracking_url

    _schema_shipping_address_read = None

    @classmethod
    def _build_schema_shipping_address_read(cls, _schema):
        if cls._schema_shipping_address_read is not None:
            _schema.address_type = cls._schema_shipping_address_read.address_type
            _schema.city = cls._schema_shipping_address_read.city
            _schema.company_name = cls._schema_shipping_address_read.company_name
            _schema.country = cls._schema_shipping_address_read.country
            _schema.postal_code = cls._schema_shipping_address_read.postal_code
            _schema.skip_address_validation = cls._schema_shipping_address_read.skip_address_validation
            _schema.state_or_province = cls._schema_shipping_address_read.state_or_province
            _schema.street_address1 = cls._schema_shipping_address_read.street_address1
            _schema.street_address2 = cls._schema_shipping_address_read.street_address2
            _schema.street_address3 = cls._schema_shipping_address_read.street_address3
            _schema.tax_identification_number = cls._schema_shipping_address_read.tax_identification_number
            _schema.zip_extended_code = cls._schema_shipping_address_read.zip_extended_code
            return

        cls._schema_shipping_address_read = _schema_shipping_address_read = AAZObjectType()

        shipping_address_read = _schema_shipping_address_read
        shipping_address_read.address_type = AAZStrType(
            serialized_name="addressType",
        )
        shipping_address_read.city = AAZStrType()
        shipping_address_read.company_name = AAZStrType(
            serialized_name="companyName",
        )
        shipping_address_read.country = AAZStrType(
            flags={"required": True},
        )
        shipping_address_read.postal_code = AAZStrType(
            serialized_name="postalCode",
        )
        shipping_address_read.skip_address_validation = AAZBoolType(
            serialized_name="skipAddressValidation",
        )
        shipping_address_read.state_or_province = AAZStrType(
            serialized_name="stateOrProvince",
        )
        shipping_address_read.street_address1 = AAZStrType(
            serialized_name="streetAddress1",
            flags={"required": True},
        )
        shipping_address_read.street_address2 = AAZStrType(
            serialized_name="streetAddress2",
        )
        shipping_address_read.street_address3 = AAZStrType(
            serialized_name="streetAddress3",
        )
        shipping_address_read.tax_identification_number = AAZStrType(
            serialized_name="taxIdentificationNumber",
        )
        shipping_address_read.zip_extended_code = AAZStrType(
            serialized_name="zipExtendedCode",
        )

        _schema.address_type = cls._schema_shipping_address_read.address_type
        _schema.city = cls._schema_shipping_address_read.city
        _schema.company_name = cls._schema_shipping_address_read.company_name
        _schema.country = cls._schema_shipping_address_read.country
        _schema.postal_code = cls._schema_shipping_address_read.postal_code
        _schema.skip_address_validation = cls._schema_shipping_address_read.skip_address_validation
        _schema.state_or_province = cls._schema_shipping_address_read.state_or_province
        _schema.street_address1 = cls._schema_shipping_address_read.street_address1
        _schema.street_address2 = cls._schema_shipping_address_read.street_address2
        _schema.street_address3 = cls._schema_shipping_address_read.street_address3
        _schema.tax_identification_number = cls._schema_shipping_address_read.tax_identification_number
        _schema.zip_extended_code = cls._schema_shipping_address_read.zip_extended_code

    _schema_transport_preferences_read = None

    @classmethod
    def _build_schema_transport_preferences_read(cls, _schema):
        if cls._schema_transport_preferences_read is not None:
            _schema.is_updated = cls._schema_transport_preferences_read.is_updated
            _schema.preferred_shipment_type = cls._schema_transport_preferences_read.preferred_shipment_type
            return

        cls._schema_transport_preferences_read = _schema_transport_preferences_read = AAZObjectType()

        transport_preferences_read = _schema_transport_preferences_read
        transport_preferences_read.is_updated = AAZBoolType(
            serialized_name="isUpdated",
            flags={"read_only": True},
        )
        transport_preferences_read.preferred_shipment_type = AAZStrType(
            serialized_name="preferredShipmentType",
            flags={"required": True},
        )

        _schema.is_updated = cls._schema_transport_preferences_read.is_updated
        _schema.preferred_shipment_type = cls._schema_transport_preferences_read.preferred_shipment_type


__all__ = ["Update"]
