# --------------------------------------------------------------------------------------------
# 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(
    "dataprotection backup-policy create",
    is_experimental=True,
)
class Create(AAZCommand):
    """Create a backup policy belonging to a backup vault.

    :example: Create Backup Policy
        az dataprotection backup-policy create -g sarath-rg --vault-name sarath-vault -n mypolicy --policy policy.json
    """

    _aaz_info = {
        "version": "2023-05-01",
        "resources": [
            ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.dataprotection/backupvaults/{}/backuppolicies/{}", "2023-05-01"],
        ]
    }

    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.backup_policy_name = AAZStrArg(
            options=["-n", "--name", "--backup-policy-name"],
            help="Name of the policy",
            required=True,
        )
        _args_schema.resource_group = AAZResourceGroupNameArg(
            required=True,
        )
        _args_schema.vault_name = AAZStrArg(
            options=["--vault-name"],
            help="The name of the backup vault.",
            required=True,
        )
        _args_schema.policy = AAZObjectArg(
            options=["--policy"],
            help="Request body for operation Expected value: json-string/@json-file.",
        )

        policy = cls._args_schema.policy
        policy.policy_rules = AAZListArg(
            options=["policy-rules"],
            help="Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc",
            required=True,
        )

        policy_rules = cls._args_schema.policy.policy_rules
        policy_rules.Element = AAZObjectArg()

        _element = cls._args_schema.policy.policy_rules.Element
        _element.azure_backup_rule = AAZObjectArg(
            options=["azure-backup-rule"],
        )
        _element.azure_retention_rule = AAZObjectArg(
            options=["azure-retention-rule"],
        )
        _element.name = AAZStrArg(
            options=["name"],
            required=True,
        )

        azure_backup_rule = cls._args_schema.policy.policy_rules.Element.azure_backup_rule
        azure_backup_rule.azure_backup_params = AAZObjectArg(
            options=["azure-backup-params"],
        )
        azure_backup_rule.data_store = AAZObjectArg(
            options=["data-store"],
            help="DataStoreInfo base",
            required=True,
        )
        cls._build_args_data_store_info_base_create(azure_backup_rule.data_store)
        azure_backup_rule.adhoc_based_trigger_context = AAZObjectArg(
            options=["adhoc-based-trigger-context"],
        )
        azure_backup_rule.schedule_based_trigger_context = AAZObjectArg(
            options=["schedule-based-trigger-context"],
        )

        azure_backup_params = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.azure_backup_params
        azure_backup_params.backup_type = AAZStrArg(
            options=["backup-type"],
            help="BackupType ; Full/Incremental etc",
            required=True,
        )

        adhoc_based_trigger_context = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.adhoc_based_trigger_context
        adhoc_based_trigger_context.tagging_criteria = AAZObjectArg(
            options=["tagging-criteria"],
            help="Tagging Criteria containing retention tag for adhoc backup.",
            required=True,
        )

        tagging_criteria = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.adhoc_based_trigger_context.tagging_criteria
        tagging_criteria.tag_info = AAZObjectArg(
            options=["tag-info"],
            help="Retention tag information",
        )
        cls._build_args_retention_tag_create(tagging_criteria.tag_info)

        schedule_based_trigger_context = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context
        schedule_based_trigger_context.schedule = AAZObjectArg(
            options=["schedule"],
            help="Schedule for this backup",
            required=True,
        )
        schedule_based_trigger_context.tagging_criteria = AAZListArg(
            options=["tagging-criteria"],
            help="List of tags that can be applicable for given schedule.",
            required=True,
        )

        schedule = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.schedule
        schedule.repeating_time_intervals = AAZListArg(
            options=["repeating-time-intervals"],
            help="ISO 8601 repeating time interval format",
            required=True,
        )
        schedule.time_zone = AAZStrArg(
            options=["time-zone"],
            help="Time zone for a schedule. Example: Pacific Standard Time",
        )

        repeating_time_intervals = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.schedule.repeating_time_intervals
        repeating_time_intervals.Element = AAZStrArg()

        tagging_criteria = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria
        tagging_criteria.Element = AAZObjectArg()

        _element = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element
        _element.criteria = AAZListArg(
            options=["criteria"],
            help="Criteria which decides whether the tag can be applied to a triggered backup.",
        )
        _element.is_default = AAZBoolArg(
            options=["is-default"],
            help="Specifies if tag is default.",
            required=True,
        )
        _element.tag_info = AAZObjectArg(
            options=["tag-info"],
            help="Retention tag information",
            required=True,
        )
        cls._build_args_retention_tag_create(_element.tag_info)
        _element.tagging_priority = AAZIntArg(
            options=["tagging-priority"],
            help="Retention Tag priority.",
            required=True,
        )

        criteria = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element.criteria
        criteria.Element = AAZObjectArg()

        _element = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element.criteria.Element
        _element.schedule_based_backup_criteria = AAZObjectArg(
            options=["schedule-based-backup-criteria"],
        )

        schedule_based_backup_criteria = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element.criteria.Element.schedule_based_backup_criteria
        schedule_based_backup_criteria.absolute_criteria = AAZListArg(
            options=["absolute-criteria"],
            help="it contains absolute values like \"AllBackup\" / \"FirstOfDay\" / \"FirstOfWeek\" / \"FirstOfMonth\" and should be a part of AbsoluteMarker enum",
        )
        schedule_based_backup_criteria.days_of_month = AAZListArg(
            options=["days-of-month"],
            help="This is day of the month from 1 to 28 other wise last of month",
        )
        schedule_based_backup_criteria.days_of_the_week = AAZListArg(
            options=["days-of-the-week"],
            help="It should be Sunday/Monday/T..../Saturday",
        )
        schedule_based_backup_criteria.months_of_year = AAZListArg(
            options=["months-of-year"],
            help="It should be January/February/....../December",
        )
        schedule_based_backup_criteria.schedule_times = AAZListArg(
            options=["schedule-times"],
            help="List of schedule times for backup",
        )
        schedule_based_backup_criteria.weeks_of_the_month = AAZListArg(
            options=["weeks-of-the-month"],
            help="It should be First/Second/Third/Fourth/Last",
        )

        absolute_criteria = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element.criteria.Element.schedule_based_backup_criteria.absolute_criteria
        absolute_criteria.Element = AAZStrArg(
            enum={"AllBackup": "AllBackup", "FirstOfDay": "FirstOfDay", "FirstOfMonth": "FirstOfMonth", "FirstOfWeek": "FirstOfWeek", "FirstOfYear": "FirstOfYear"},
        )

        days_of_month = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element.criteria.Element.schedule_based_backup_criteria.days_of_month
        days_of_month.Element = AAZObjectArg()

        _element = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element.criteria.Element.schedule_based_backup_criteria.days_of_month.Element
        _element.date = AAZIntArg(
            options=["date"],
            help="Date of the month",
        )
        _element.is_last = AAZBoolArg(
            options=["is-last"],
            help="Whether Date is last date of month",
        )

        days_of_the_week = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element.criteria.Element.schedule_based_backup_criteria.days_of_the_week
        days_of_the_week.Element = AAZStrArg(
            enum={"Friday": "Friday", "Monday": "Monday", "Saturday": "Saturday", "Sunday": "Sunday", "Thursday": "Thursday", "Tuesday": "Tuesday", "Wednesday": "Wednesday"},
        )

        months_of_year = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element.criteria.Element.schedule_based_backup_criteria.months_of_year
        months_of_year.Element = AAZStrArg(
            enum={"April": "April", "August": "August", "December": "December", "February": "February", "January": "January", "July": "July", "June": "June", "March": "March", "May": "May", "November": "November", "October": "October", "September": "September"},
        )

        schedule_times = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element.criteria.Element.schedule_based_backup_criteria.schedule_times
        schedule_times.Element = AAZDateTimeArg()

        weeks_of_the_month = cls._args_schema.policy.policy_rules.Element.azure_backup_rule.schedule_based_trigger_context.tagging_criteria.Element.criteria.Element.schedule_based_backup_criteria.weeks_of_the_month
        weeks_of_the_month.Element = AAZStrArg(
            enum={"First": "First", "Fourth": "Fourth", "Last": "Last", "Second": "Second", "Third": "Third"},
        )

        azure_retention_rule = cls._args_schema.policy.policy_rules.Element.azure_retention_rule
        azure_retention_rule.is_default = AAZBoolArg(
            options=["is-default"],
        )
        azure_retention_rule.lifecycles = AAZListArg(
            options=["lifecycles"],
            required=True,
        )

        lifecycles = cls._args_schema.policy.policy_rules.Element.azure_retention_rule.lifecycles
        lifecycles.Element = AAZObjectArg()

        _element = cls._args_schema.policy.policy_rules.Element.azure_retention_rule.lifecycles.Element
        _element.delete_after = AAZObjectArg(
            options=["delete-after"],
            help="Delete Option",
            required=True,
        )
        _element.source_data_store = AAZObjectArg(
            options=["source-data-store"],
            required=True,
        )
        cls._build_args_data_store_info_base_create(_element.source_data_store)
        _element.target_data_store_copy_settings = AAZListArg(
            options=["target-data-store-copy-settings"],
        )

        delete_after = cls._args_schema.policy.policy_rules.Element.azure_retention_rule.lifecycles.Element.delete_after
        delete_after.duration = AAZStrArg(
            options=["duration"],
            help="Duration of deletion after given timespan",
            required=True,
        )
        delete_after.object_type = AAZStrArg(
            options=["object-type"],
            help="Type of the specific object - used for deserializing",
            required=True,
            enum={"AbsoluteDeleteOption": "AbsoluteDeleteOption"},
        )

        target_data_store_copy_settings = cls._args_schema.policy.policy_rules.Element.azure_retention_rule.lifecycles.Element.target_data_store_copy_settings
        target_data_store_copy_settings.Element = AAZObjectArg()

        _element = cls._args_schema.policy.policy_rules.Element.azure_retention_rule.lifecycles.Element.target_data_store_copy_settings.Element
        _element.copy_after = AAZObjectArg(
            options=["copy-after"],
            help="It can be CustomCopyOption or ImmediateCopyOption.",
            required=True,
        )
        _element.data_store = AAZObjectArg(
            options=["data-store"],
            help="Info of target datastore",
            required=True,
        )
        cls._build_args_data_store_info_base_create(_element.data_store)

        copy_after = cls._args_schema.policy.policy_rules.Element.azure_retention_rule.lifecycles.Element.target_data_store_copy_settings.Element.copy_after
        copy_after.custom_copy_option = AAZObjectArg(
            options=["custom-copy-option"],
        )

        custom_copy_option = cls._args_schema.policy.policy_rules.Element.azure_retention_rule.lifecycles.Element.target_data_store_copy_settings.Element.copy_after.custom_copy_option
        custom_copy_option.duration = AAZStrArg(
            options=["duration"],
            help="Data copied after given timespan",
        )

        # define Arg Group "Properties"
        return cls._args_schema

    _args_data_store_info_base_create = None

    @classmethod
    def _build_args_data_store_info_base_create(cls, _schema):
        if cls._args_data_store_info_base_create is not None:
            _schema.data_store_type = cls._args_data_store_info_base_create.data_store_type
            _schema.object_type = cls._args_data_store_info_base_create.object_type
            return

        cls._args_data_store_info_base_create = AAZObjectArg()

        data_store_info_base_create = cls._args_data_store_info_base_create
        data_store_info_base_create.data_store_type = AAZStrArg(
            options=["data-store-type"],
            help="type of datastore; Operational/Vault/Archive",
            required=True,
            enum={"ArchiveStore": "ArchiveStore", "OperationalStore": "OperationalStore", "VaultStore": "VaultStore"},
        )
        data_store_info_base_create.object_type = AAZStrArg(
            options=["object-type"],
            help="Type of Datasource object, used to initialize the right inherited type",
            required=True,
        )

        _schema.data_store_type = cls._args_data_store_info_base_create.data_store_type
        _schema.object_type = cls._args_data_store_info_base_create.object_type

    _args_retention_tag_create = None

    @classmethod
    def _build_args_retention_tag_create(cls, _schema):
        if cls._args_retention_tag_create is not None:
            _schema.tag_name = cls._args_retention_tag_create.tag_name
            return

        cls._args_retention_tag_create = AAZObjectArg()

        retention_tag_create = cls._args_retention_tag_create
        retention_tag_create.tag_name = AAZStrArg(
            options=["tag-name"],
            help="Retention Tag Name to relate it to retention rule.",
            required=True,
        )

        _schema.tag_name = cls._args_retention_tag_create.tag_name

    def _execute_operations(self):
        self.pre_operations()
        self.BackupPoliciesCreateOrUpdate(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 BackupPoliciesCreateOrUpdate(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.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}",
                **self.url_parameters
            )

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

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

        @property
        def url_parameters(self):
            parameters = {
                **self.serialize_url_param(
                    "backupPolicyName", self.ctx.args.backup_policy_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,
                ),
                **self.serialize_url_param(
                    "vaultName", self.ctx.args.vault_name,
                    required=True,
                ),
            }
            return parameters

        @property
        def query_parameters(self):
            parameters = {
                **self.serialize_query_param(
                    "api-version", "2023-05-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)

            properties = _builder.get(".properties")
            if properties is not None:
                properties.set_const("objectType", "BackupPolicy", AAZStrType, ".policy", typ_kwargs={"flags": {"required": True}})
                properties.discriminate_by("objectType", "BackupPolicy")

            disc_backup_policy = _builder.get(".properties{objectType:BackupPolicy}")
            if disc_backup_policy is not None:
                disc_backup_policy.set_prop("policyRules", AAZListType, ".policy.policy_rules", typ_kwargs={"flags": {"required": True}})

            policy_rules = _builder.get(".properties{objectType:BackupPolicy}.policyRules")
            if policy_rules is not None:
                policy_rules.set_elements(AAZObjectType, ".")

            _elements = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]")
            if _elements is not None:
                _elements.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}})
                _elements.set_const("objectType", "AzureBackupRule", AAZStrType, ".azure_backup_rule", typ_kwargs={"flags": {"required": True}})
                _elements.set_const("objectType", "AzureRetentionRule", AAZStrType, ".azure_retention_rule", typ_kwargs={"flags": {"required": True}})
                _elements.discriminate_by("objectType", "AzureBackupRule")
                _elements.discriminate_by("objectType", "AzureRetentionRule")

            disc_azure_backup_rule = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}")
            if disc_azure_backup_rule is not None:
                disc_azure_backup_rule.set_prop("backupParameters", AAZObjectType)
                _CreateHelper._build_schema_data_store_info_base_create(disc_azure_backup_rule.set_prop("dataStore", AAZObjectType, ".azure_backup_rule.data_store", typ_kwargs={"flags": {"required": True}}))
                disc_azure_backup_rule.set_prop("trigger", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})

            backup_parameters = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.backupParameters")
            if backup_parameters is not None:
                backup_parameters.set_const("objectType", "AzureBackupParams", AAZStrType, ".azure_backup_rule.azure_backup_params", typ_kwargs={"flags": {"required": True}})
                backup_parameters.discriminate_by("objectType", "AzureBackupParams")

            disc_azure_backup_params = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.backupParameters{objectType:AzureBackupParams}")
            if disc_azure_backup_params is not None:
                disc_azure_backup_params.set_prop("backupType", AAZStrType, ".azure_backup_rule.azure_backup_params.backup_type", typ_kwargs={"flags": {"required": True}})

            trigger = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger")
            if trigger is not None:
                trigger.set_const("objectType", "AdhocBasedTriggerContext", AAZStrType, ".azure_backup_rule.adhoc_based_trigger_context", typ_kwargs={"flags": {"required": True}})
                trigger.set_const("objectType", "ScheduleBasedTriggerContext", AAZStrType, ".azure_backup_rule.schedule_based_trigger_context", typ_kwargs={"flags": {"required": True}})
                trigger.discriminate_by("objectType", "AdhocBasedTriggerContext")
                trigger.discriminate_by("objectType", "ScheduleBasedTriggerContext")

            disc_adhoc_based_trigger_context = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:AdhocBasedTriggerContext}")
            if disc_adhoc_based_trigger_context is not None:
                disc_adhoc_based_trigger_context.set_prop("taggingCriteria", AAZObjectType, ".azure_backup_rule.adhoc_based_trigger_context.tagging_criteria", typ_kwargs={"flags": {"required": True}})

            tagging_criteria = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:AdhocBasedTriggerContext}.taggingCriteria")
            if tagging_criteria is not None:
                _CreateHelper._build_schema_retention_tag_create(tagging_criteria.set_prop("tagInfo", AAZObjectType, ".tag_info"))

            disc_schedule_based_trigger_context = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}")
            if disc_schedule_based_trigger_context is not None:
                disc_schedule_based_trigger_context.set_prop("schedule", AAZObjectType, ".azure_backup_rule.schedule_based_trigger_context.schedule", typ_kwargs={"flags": {"required": True}})
                disc_schedule_based_trigger_context.set_prop("taggingCriteria", AAZListType, ".azure_backup_rule.schedule_based_trigger_context.tagging_criteria", typ_kwargs={"flags": {"required": True}})

            schedule = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.schedule")
            if schedule is not None:
                schedule.set_prop("repeatingTimeIntervals", AAZListType, ".repeating_time_intervals", typ_kwargs={"flags": {"required": True}})
                schedule.set_prop("timeZone", AAZStrType, ".time_zone")

            repeating_time_intervals = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.schedule.repeatingTimeIntervals")
            if repeating_time_intervals is not None:
                repeating_time_intervals.set_elements(AAZStrType, ".")

            tagging_criteria = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria")
            if tagging_criteria is not None:
                tagging_criteria.set_elements(AAZObjectType, ".")

            _elements = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[]")
            if _elements is not None:
                _elements.set_prop("criteria", AAZListType, ".criteria")
                _elements.set_prop("isDefault", AAZBoolType, ".is_default", typ_kwargs={"flags": {"required": True}})
                _CreateHelper._build_schema_retention_tag_create(_elements.set_prop("tagInfo", AAZObjectType, ".tag_info", typ_kwargs={"flags": {"required": True}}))
                _elements.set_prop("taggingPriority", AAZIntType, ".tagging_priority", typ_kwargs={"flags": {"required": True}})

            criteria = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[].criteria")
            if criteria is not None:
                criteria.set_elements(AAZObjectType, ".")

            _elements = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[].criteria[]")
            if _elements is not None:
                _elements.set_const("objectType", "ScheduleBasedBackupCriteria", AAZStrType, ".schedule_based_backup_criteria", typ_kwargs={"flags": {"required": True}})
                _elements.discriminate_by("objectType", "ScheduleBasedBackupCriteria")

            disc_schedule_based_backup_criteria = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[].criteria[]{objectType:ScheduleBasedBackupCriteria}")
            if disc_schedule_based_backup_criteria is not None:
                disc_schedule_based_backup_criteria.set_prop("absoluteCriteria", AAZListType, ".schedule_based_backup_criteria.absolute_criteria")
                disc_schedule_based_backup_criteria.set_prop("daysOfMonth", AAZListType, ".schedule_based_backup_criteria.days_of_month")
                disc_schedule_based_backup_criteria.set_prop("daysOfTheWeek", AAZListType, ".schedule_based_backup_criteria.days_of_the_week")
                disc_schedule_based_backup_criteria.set_prop("monthsOfYear", AAZListType, ".schedule_based_backup_criteria.months_of_year")
                disc_schedule_based_backup_criteria.set_prop("scheduleTimes", AAZListType, ".schedule_based_backup_criteria.schedule_times")
                disc_schedule_based_backup_criteria.set_prop("weeksOfTheMonth", AAZListType, ".schedule_based_backup_criteria.weeks_of_the_month")

            absolute_criteria = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[].criteria[]{objectType:ScheduleBasedBackupCriteria}.absoluteCriteria")
            if absolute_criteria is not None:
                absolute_criteria.set_elements(AAZStrType, ".")

            days_of_month = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[].criteria[]{objectType:ScheduleBasedBackupCriteria}.daysOfMonth")
            if days_of_month is not None:
                days_of_month.set_elements(AAZObjectType, ".")

            _elements = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[].criteria[]{objectType:ScheduleBasedBackupCriteria}.daysOfMonth[]")
            if _elements is not None:
                _elements.set_prop("date", AAZIntType, ".date")
                _elements.set_prop("isLast", AAZBoolType, ".is_last")

            days_of_the_week = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[].criteria[]{objectType:ScheduleBasedBackupCriteria}.daysOfTheWeek")
            if days_of_the_week is not None:
                days_of_the_week.set_elements(AAZStrType, ".")

            months_of_year = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[].criteria[]{objectType:ScheduleBasedBackupCriteria}.monthsOfYear")
            if months_of_year is not None:
                months_of_year.set_elements(AAZStrType, ".")

            schedule_times = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[].criteria[]{objectType:ScheduleBasedBackupCriteria}.scheduleTimes")
            if schedule_times is not None:
                schedule_times.set_elements(AAZStrType, ".")

            weeks_of_the_month = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureBackupRule}.trigger{objectType:ScheduleBasedTriggerContext}.taggingCriteria[].criteria[]{objectType:ScheduleBasedBackupCriteria}.weeksOfTheMonth")
            if weeks_of_the_month is not None:
                weeks_of_the_month.set_elements(AAZStrType, ".")

            disc_azure_retention_rule = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureRetentionRule}")
            if disc_azure_retention_rule is not None:
                disc_azure_retention_rule.set_prop("isDefault", AAZBoolType, ".azure_retention_rule.is_default")
                disc_azure_retention_rule.set_prop("lifecycles", AAZListType, ".azure_retention_rule.lifecycles", typ_kwargs={"flags": {"required": True}})

            lifecycles = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureRetentionRule}.lifecycles")
            if lifecycles is not None:
                lifecycles.set_elements(AAZObjectType, ".")

            _elements = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureRetentionRule}.lifecycles[]")
            if _elements is not None:
                _elements.set_prop("deleteAfter", AAZObjectType, ".delete_after", typ_kwargs={"flags": {"required": True}})
                _CreateHelper._build_schema_data_store_info_base_create(_elements.set_prop("sourceDataStore", AAZObjectType, ".source_data_store", typ_kwargs={"flags": {"required": True}}))
                _elements.set_prop("targetDataStoreCopySettings", AAZListType, ".target_data_store_copy_settings")

            delete_after = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureRetentionRule}.lifecycles[].deleteAfter")
            if delete_after is not None:
                delete_after.set_prop("duration", AAZStrType, ".duration", typ_kwargs={"flags": {"required": True}})
                delete_after.set_prop("objectType", AAZStrType, ".object_type", typ_kwargs={"flags": {"required": True}})

            target_data_store_copy_settings = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureRetentionRule}.lifecycles[].targetDataStoreCopySettings")
            if target_data_store_copy_settings is not None:
                target_data_store_copy_settings.set_elements(AAZObjectType, ".")

            _elements = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureRetentionRule}.lifecycles[].targetDataStoreCopySettings[]")
            if _elements is not None:
                _elements.set_prop("copyAfter", AAZObjectType, ".copy_after", typ_kwargs={"flags": {"required": True}})
                _CreateHelper._build_schema_data_store_info_base_create(_elements.set_prop("dataStore", AAZObjectType, ".data_store", typ_kwargs={"flags": {"required": True}}))

            copy_after = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureRetentionRule}.lifecycles[].targetDataStoreCopySettings[].copyAfter")
            if copy_after is not None:
                copy_after.set_const("objectType", "CustomCopyOption", AAZStrType, ".custom_copy_option", typ_kwargs={"flags": {"required": True}})
                copy_after.discriminate_by("objectType", "CustomCopyOption")

            disc_custom_copy_option = _builder.get(".properties{objectType:BackupPolicy}.policyRules[]{objectType:AzureRetentionRule}.lifecycles[].targetDataStoreCopySettings[].copyAfter{objectType:CustomCopyOption}")
            if disc_custom_copy_option is not None:
                disc_custom_copy_option.set_prop("duration", AAZStrType, ".custom_copy_option.duration")

            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.name = AAZStrType(
                flags={"read_only": True},
            )
            _schema_on_200.properties = AAZObjectType()
            _schema_on_200.system_data = AAZObjectType(
                serialized_name="systemData",
                flags={"read_only": True},
            )
            _schema_on_200.type = AAZStrType(
                flags={"read_only": True},
            )

            properties = cls._schema_on_200.properties
            properties.datasource_types = AAZListType(
                serialized_name="datasourceTypes",
                flags={"required": True},
            )
            properties.object_type = AAZStrType(
                serialized_name="objectType",
                flags={"required": True},
            )

            datasource_types = cls._schema_on_200.properties.datasource_types
            datasource_types.Element = AAZStrType()

            disc_backup_policy = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy")
            disc_backup_policy.policy_rules = AAZListType(
                serialized_name="policyRules",
                flags={"required": True},
            )

            policy_rules = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules
            policy_rules.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element
            _element.name = AAZStrType(
                flags={"required": True},
            )
            _element.object_type = AAZStrType(
                serialized_name="objectType",
                flags={"required": True},
            )

            disc_azure_backup_rule = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule")
            disc_azure_backup_rule.backup_parameters = AAZObjectType(
                serialized_name="backupParameters",
            )
            disc_azure_backup_rule.data_store = AAZObjectType(
                serialized_name="dataStore",
                flags={"required": True},
            )
            _CreateHelper._build_schema_data_store_info_base_read(disc_azure_backup_rule.data_store)
            disc_azure_backup_rule.trigger = AAZObjectType(
                flags={"required": True},
            )

            backup_parameters = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").backup_parameters
            backup_parameters.object_type = AAZStrType(
                serialized_name="objectType",
                flags={"required": True},
            )

            disc_azure_backup_params = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").backup_parameters.discriminate_by("object_type", "AzureBackupParams")
            disc_azure_backup_params.backup_type = AAZStrType(
                serialized_name="backupType",
                flags={"required": True},
            )

            trigger = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger
            trigger.object_type = AAZStrType(
                serialized_name="objectType",
                flags={"required": True},
            )

            disc_adhoc_based_trigger_context = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "AdhocBasedTriggerContext")
            disc_adhoc_based_trigger_context.tagging_criteria = AAZObjectType(
                serialized_name="taggingCriteria",
                flags={"required": True},
            )

            tagging_criteria = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "AdhocBasedTriggerContext").tagging_criteria
            tagging_criteria.tag_info = AAZObjectType(
                serialized_name="tagInfo",
            )
            _CreateHelper._build_schema_retention_tag_read(tagging_criteria.tag_info)

            disc_schedule_based_trigger_context = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext")
            disc_schedule_based_trigger_context.schedule = AAZObjectType(
                flags={"required": True},
            )
            disc_schedule_based_trigger_context.tagging_criteria = AAZListType(
                serialized_name="taggingCriteria",
                flags={"required": True},
            )

            schedule = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").schedule
            schedule.repeating_time_intervals = AAZListType(
                serialized_name="repeatingTimeIntervals",
                flags={"required": True},
            )
            schedule.time_zone = AAZStrType(
                serialized_name="timeZone",
            )

            repeating_time_intervals = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").schedule.repeating_time_intervals
            repeating_time_intervals.Element = AAZStrType()

            tagging_criteria = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria
            tagging_criteria.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element
            _element.criteria = AAZListType()
            _element.is_default = AAZBoolType(
                serialized_name="isDefault",
                flags={"required": True},
            )
            _element.tag_info = AAZObjectType(
                serialized_name="tagInfo",
                flags={"required": True},
            )
            _CreateHelper._build_schema_retention_tag_read(_element.tag_info)
            _element.tagging_priority = AAZIntType(
                serialized_name="taggingPriority",
                flags={"required": True},
            )

            criteria = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element.criteria
            criteria.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element.criteria.Element
            _element.object_type = AAZStrType(
                serialized_name="objectType",
                flags={"required": True},
            )

            disc_schedule_based_backup_criteria = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element.criteria.Element.discriminate_by("object_type", "ScheduleBasedBackupCriteria")
            disc_schedule_based_backup_criteria.absolute_criteria = AAZListType(
                serialized_name="absoluteCriteria",
            )
            disc_schedule_based_backup_criteria.days_of_month = AAZListType(
                serialized_name="daysOfMonth",
            )
            disc_schedule_based_backup_criteria.days_of_the_week = AAZListType(
                serialized_name="daysOfTheWeek",
            )
            disc_schedule_based_backup_criteria.months_of_year = AAZListType(
                serialized_name="monthsOfYear",
            )
            disc_schedule_based_backup_criteria.schedule_times = AAZListType(
                serialized_name="scheduleTimes",
            )
            disc_schedule_based_backup_criteria.weeks_of_the_month = AAZListType(
                serialized_name="weeksOfTheMonth",
            )

            absolute_criteria = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element.criteria.Element.discriminate_by("object_type", "ScheduleBasedBackupCriteria").absolute_criteria
            absolute_criteria.Element = AAZStrType()

            days_of_month = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element.criteria.Element.discriminate_by("object_type", "ScheduleBasedBackupCriteria").days_of_month
            days_of_month.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element.criteria.Element.discriminate_by("object_type", "ScheduleBasedBackupCriteria").days_of_month.Element
            _element.date = AAZIntType()
            _element.is_last = AAZBoolType(
                serialized_name="isLast",
            )

            days_of_the_week = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element.criteria.Element.discriminate_by("object_type", "ScheduleBasedBackupCriteria").days_of_the_week
            days_of_the_week.Element = AAZStrType()

            months_of_year = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element.criteria.Element.discriminate_by("object_type", "ScheduleBasedBackupCriteria").months_of_year
            months_of_year.Element = AAZStrType()

            schedule_times = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element.criteria.Element.discriminate_by("object_type", "ScheduleBasedBackupCriteria").schedule_times
            schedule_times.Element = AAZStrType()

            weeks_of_the_month = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureBackupRule").trigger.discriminate_by("object_type", "ScheduleBasedTriggerContext").tagging_criteria.Element.criteria.Element.discriminate_by("object_type", "ScheduleBasedBackupCriteria").weeks_of_the_month
            weeks_of_the_month.Element = AAZStrType()

            disc_azure_retention_rule = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureRetentionRule")
            disc_azure_retention_rule.is_default = AAZBoolType(
                serialized_name="isDefault",
            )
            disc_azure_retention_rule.lifecycles = AAZListType(
                flags={"required": True},
            )

            lifecycles = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureRetentionRule").lifecycles
            lifecycles.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureRetentionRule").lifecycles.Element
            _element.delete_after = AAZObjectType(
                serialized_name="deleteAfter",
                flags={"required": True},
            )
            _element.source_data_store = AAZObjectType(
                serialized_name="sourceDataStore",
                flags={"required": True},
            )
            _CreateHelper._build_schema_data_store_info_base_read(_element.source_data_store)
            _element.target_data_store_copy_settings = AAZListType(
                serialized_name="targetDataStoreCopySettings",
            )

            delete_after = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureRetentionRule").lifecycles.Element.delete_after
            delete_after.duration = AAZStrType(
                flags={"required": True},
            )
            delete_after.object_type = AAZStrType(
                serialized_name="objectType",
                flags={"required": True},
            )

            target_data_store_copy_settings = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureRetentionRule").lifecycles.Element.target_data_store_copy_settings
            target_data_store_copy_settings.Element = AAZObjectType()

            _element = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureRetentionRule").lifecycles.Element.target_data_store_copy_settings.Element
            _element.copy_after = AAZObjectType(
                serialized_name="copyAfter",
                flags={"required": True},
            )
            _element.data_store = AAZObjectType(
                serialized_name="dataStore",
                flags={"required": True},
            )
            _CreateHelper._build_schema_data_store_info_base_read(_element.data_store)

            copy_after = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureRetentionRule").lifecycles.Element.target_data_store_copy_settings.Element.copy_after
            copy_after.object_type = AAZStrType(
                serialized_name="objectType",
                flags={"required": True},
            )

            disc_custom_copy_option = cls._schema_on_200.properties.discriminate_by("object_type", "BackupPolicy").policy_rules.Element.discriminate_by("object_type", "AzureRetentionRule").lifecycles.Element.target_data_store_copy_settings.Element.copy_after.discriminate_by("object_type", "CustomCopyOption")
            disc_custom_copy_option.duration = AAZStrType()

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

            return cls._schema_on_200


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

    @classmethod
    def _build_schema_data_store_info_base_create(cls, _builder):
        if _builder is None:
            return
        _builder.set_prop("dataStoreType", AAZStrType, ".data_store_type", typ_kwargs={"flags": {"required": True}})
        _builder.set_prop("objectType", AAZStrType, ".object_type", typ_kwargs={"flags": {"required": True}})

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

    _schema_data_store_info_base_read = None

    @classmethod
    def _build_schema_data_store_info_base_read(cls, _schema):
        if cls._schema_data_store_info_base_read is not None:
            _schema.data_store_type = cls._schema_data_store_info_base_read.data_store_type
            _schema.object_type = cls._schema_data_store_info_base_read.object_type
            return

        cls._schema_data_store_info_base_read = _schema_data_store_info_base_read = AAZObjectType()

        data_store_info_base_read = _schema_data_store_info_base_read
        data_store_info_base_read.data_store_type = AAZStrType(
            serialized_name="dataStoreType",
            flags={"required": True},
        )
        data_store_info_base_read.object_type = AAZStrType(
            serialized_name="objectType",
            flags={"required": True},
        )

        _schema.data_store_type = cls._schema_data_store_info_base_read.data_store_type
        _schema.object_type = cls._schema_data_store_info_base_read.object_type

    _schema_retention_tag_read = None

    @classmethod
    def _build_schema_retention_tag_read(cls, _schema):
        if cls._schema_retention_tag_read is not None:
            _schema.e_tag = cls._schema_retention_tag_read.e_tag
            _schema.id = cls._schema_retention_tag_read.id
            _schema.tag_name = cls._schema_retention_tag_read.tag_name
            return

        cls._schema_retention_tag_read = _schema_retention_tag_read = AAZObjectType()

        retention_tag_read = _schema_retention_tag_read
        retention_tag_read.e_tag = AAZStrType(
            serialized_name="eTag",
            flags={"read_only": True},
        )
        retention_tag_read.id = AAZStrType(
            flags={"read_only": True},
        )
        retention_tag_read.tag_name = AAZStrType(
            serialized_name="tagName",
            flags={"required": True},
        )

        _schema.e_tag = cls._schema_retention_tag_read.e_tag
        _schema.id = cls._schema_retention_tag_read.id
        _schema.tag_name = cls._schema_retention_tag_read.tag_name


__all__ = ["Create"]
