# This file is automatically generated by botocraft.  Do not edit directly.
# mypy: disable-error-code="index, override, assignment, union-attr, misc"
from botocraft.mixins.tags import TagsDictMixin
from .abstract import PrimaryBoto3ModelQuerySet
from collections import OrderedDict
from typing import ClassVar, Type, Optional, Literal, Dict, List, Union, Any, cast
from datetime import datetime
from botocraft.mixins.route53 import HostedZoneModelMixin
from pydantic import Field
from .abstract import (
    Boto3Model,
    ReadonlyBoto3Model,
    PrimaryBoto3Model,
    ReadonlyPrimaryBoto3Model,
    Boto3ModelManager,
    ReadonlyBoto3ModelManager,
)
from functools import cached_property

# ===============
# Managers
# ===============


class HostedZoneManager(Boto3ModelManager):
    service_name: str = "route53"

    def create(
        self,
        model: "HostedZone",
        VPC: Optional["Route53VPC"] = None,
        HostedZoneConfig: Optional["HostedZoneConfig"] = None,
        DelegationSetId: str | None = None,
    ) -> "HostedZone":
        """
        Creates a new public or private hosted zone. You create records in a public
        hosted zone to define how you want to route traffic on the internet for a
        domain, such as example.com, and its subdomains (apex.example.com,
        acme.example.com). You create records in a private hosted zone to define how you
        want to route traffic for a domain and its subdomains within one or more Amazon
        Virtual Private Clouds (Amazon VPCs).

        Args:
            model: The :py:class:`HostedZone` to create.

        Keyword Args:
            VPC: (Private hosted zones only) A complex type that contains information about the Amazon VPC that you're
                associating with this hosted zone.
            HostedZoneConfig: (Optional) A complex type that contains the following optional values:
            DelegationSetId: If you want to associate a reusable delegation set with this hosted zone, the ID that Amazon
                Route 53 assigned to the reusable delegation set when you created it. For more information about reusable delegation
                sets, see `CreateReusableDel egationSet
                <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html>`_.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            Name=data.get("Name"),
            CallerReference=data.get("CallerReference"),
            VPC=self.serialize(VPC),
            HostedZoneConfig=self.serialize(HostedZoneConfig),
            DelegationSetId=self.serialize(DelegationSetId),
        )
        _response = self.client.create_hosted_zone(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateHostedZoneResponse(**_response)

        self.sessionize(response.HostedZone)
        return cast("HostedZone", response.HostedZone)

    def delete(self, Id: str) -> "HostedZone":
        """
        Deletes a hosted zone.

        Args:
            Id: The ID of the hosted zone you want to delete.
        """
        args: Dict[str, Any] = dict(Id=self.serialize(Id))
        _response = self.client.delete_hosted_zone(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DeleteHostedZoneResponse(**_response)
        return cast("HostedZone", response.ChangeInfo)

    def get(self, Id: str) -> Optional["HostedZone"]:
        """
        Gets information about a specified hosted zone including the four name servers
        assigned to the hosted zone.

        Args:
            Id: The ID of the hosted zone that you want to get information about.
        """
        args: Dict[str, Any] = dict(Id=self.serialize(Id))
        _response = self.client.get_hosted_zone(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = GetHostedZoneResponse(**_response)

        if response and response.HostedZone:
            self.sessionize(response.HostedZone)
            return response.HostedZone
        return None

    def list(
        self,
        *,
        MaxItems: str | None = None,
        DelegationSetId: str | None = None,
        HostedZoneType: Literal["PrivateHostedZone"] | None = None,
    ) -> PrimaryBoto3ModelQuerySet:
        """
        Retrieves a list of the public and private hosted zones that are associated with
        the current Amazon Web Services account. The response includes a ``HostedZones``
        child element for each hosted zone.

        Keyword Args:
            MaxItems: (Optional) The maximum number of hosted zones that you want Amazon Route 53 to return. If you have more
                than ``maxitems`` hosted zones, the value of ``IsTruncated`` in the response is ``true``, and the value of
                ``NextMarker`` is the hosted zone ID of the first hosted zone that Route 53 will return if you submit another
                request.
            DelegationSetId: If you're using reusable delegation sets and you want to list all of the hosted zones that are
                associated with a reusable delegation set, specify the ID of that reusable delegation set.
            HostedZoneType: (Optional) Specifies if the hosted zone is private.
        """
        paginator = self.client.get_paginator("list_hosted_zones")
        args: Dict[str, Any] = dict(
            MaxItems=self.serialize(MaxItems),
            DelegationSetId=self.serialize(DelegationSetId),
            HostedZoneType=self.serialize(HostedZoneType),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results = []
        for _response in response_iterator:
            if list(_response.keys()) == ["ResponseMetadata"]:
                break
            if "ResponseMetadata" in _response:
                del _response["ResponseMetadata"]
            response = ListHostedZonesResponse(**_response)
            if response.HostedZones:
                results.extend(response.HostedZones)
            else:
                if getattr(response, "NextToken", None):
                    continue
                break
        self.sessionize(results)
        if results and isinstance(results[0], Boto3Model):
            return PrimaryBoto3ModelQuerySet(results)
        return results

    def list_records(
        self,
        HostedZoneId: str,
        *,
        StartRecordName: str | None = None,
        StartRecordType: Literal["SOA", "A", "TXT", "NS", "CNAME", "MX", "NAPTR", "PTR", "SRV", "SPF", "AAAA", "CAA", "DS", "TLSA", "SSHFP", "SVCB", "HTTPS"] | None = None,
        StartRecordIdentifier: str | None = None,
        MaxItems: str | None = None,
    ) -> List["Route53ResourceRecordSet"]:
        """
        Lists the resource record sets in a specified hosted zone.

        Args:
            HostedZoneId: The ID of the hosted zone that contains the resource record sets that you want to list.

        Keyword Args:
            StartRecordName: The first name in the lexicographic ordering of resource record sets that you want to list. If the
                specified record name doesn't exist, the results begin with the first resource record set that has a name greater
                than the value of ``name``.
            StartRecordType: The type of resource record set to begin the record listing from.
            StartRecordIdentifier: *Resource record sets that have a routing policy other than simple:* If results were
                truncated for a given DNS name and   type, specify the value of ``NextRecordIdentifier`` from the previous response
                to get the next resource record set that   has the current DNS name and type.
            MaxItems: (Optional) The maximum number of resource records sets to include in the response body for this request.
                If the response includes more than ``maxitems`` resource record sets, the value of the ``IsTruncated`` element in
                the response is ``true``, and the values of the ``NextRecordName`` and ``NextRecordType`` elements in the response
                identify the first resource record set in the next group of ``maxitems`` resource record sets.
        """
        paginator = self.client.get_paginator("list_resource_record_sets")
        args: Dict[str, Any] = dict(
            HostedZoneId=self.serialize(HostedZoneId),
            StartRecordName=self.serialize(StartRecordName),
            StartRecordType=self.serialize(StartRecordType),
            StartRecordIdentifier=self.serialize(StartRecordIdentifier),
            MaxItems=self.serialize(MaxItems),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )

        results: List["Route53ResourceRecordSet"] = []

        for _response in response_iterator:
            response = ListResourceRecordSetsResponse(**_response)
            if response.ResourceRecordSets is not None:
                results.extend(response.ResourceRecordSets)
            else:
                break

        self.sessionize(results)
        return cast("List[Route53ResourceRecordSet]", results)

    def list_by_name(
        self,
        *,
        DNSName: str | None = None,
        HostedZoneId: str | None = None,
        MaxItems: str | None = None,
    ) -> List["HostedZone"]:
        """
        Retrieves a list of your hosted zones in lexicographic order. The response
        includes a ``HostedZones`` child element for each hosted zone created by the
        current Amazon Web Services account.

        Keyword Args:
            DNSName: (Optional) For your first request to ``ListHostedZonesByName``, include the ``dnsname`` parameter only if
                you want to specify the name of the first hosted zone in the response. If you don't include the ``dnsname``
                parameter, Amazon Route 53 returns all of the hosted zones that were created by the current Amazon Web Services
                account, in ASCII order. For subsequent requests, include both ``dnsname`` and ``hostedzoneid`` parameters. For
                ``dnsname``, specify the value of ``NextDNSName`` from the previous response.
            HostedZoneId: (Optional) For your first request to ``ListHostedZonesByName``, do not include the ``hostedzoneid``
                parameter.
            MaxItems: The maximum number of hosted zones to be included in the response body for this request. If you have more
                than ``maxitems`` hosted zones, then the value of the ``IsTruncated`` element in the response is true, and the
                values of ``NextDNSName`` and ``NextHostedZoneId`` specify the first hosted zone in the next group of ``maxitems``
                hosted zones.
        """
        args: Dict[str, Any] = dict(
            DNSName=self.serialize(DNSName),
            HostedZoneId=self.serialize(HostedZoneId),
            MaxItems=self.serialize(MaxItems),
        )
        _response = self.client.list_hosted_zones_by_name(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = ListHostedZonesByNameResponse(**_response)

        results: List["HostedZone"] = None
        if response is not None:
            results = response.HostedZones

        self.sessionize(results)
        return cast("List[HostedZone]", results)

    def list_by_vpc(
        self,
        *,
        DNSName: str | None = None,
        HostedZoneId: str | None = None,
        MaxItems: str | None = None,
    ) -> List["HostedZone"]:
        """
        Retrieves a list of your hosted zones in lexicographic order. The response
        includes a ``HostedZones`` child element for each hosted zone created by the
        current Amazon Web Services account.

        Keyword Args:
            DNSName: (Optional) For your first request to ``ListHostedZonesByName``, include the ``dnsname`` parameter only if
                you want to specify the name of the first hosted zone in the response. If you don't include the ``dnsname``
                parameter, Amazon Route 53 returns all of the hosted zones that were created by the current Amazon Web Services
                account, in ASCII order. For subsequent requests, include both ``dnsname`` and ``hostedzoneid`` parameters. For
                ``dnsname``, specify the value of ``NextDNSName`` from the previous response.
            HostedZoneId: (Optional) For your first request to ``ListHostedZonesByName``, do not include the ``hostedzoneid``
                parameter.
            MaxItems: The maximum number of hosted zones to be included in the response body for this request. If you have more
                than ``maxitems`` hosted zones, then the value of the ``IsTruncated`` element in the response is true, and the
                values of ``NextDNSName`` and ``NextHostedZoneId`` specify the first hosted zone in the next group of ``maxitems``
                hosted zones.
        """
        args: Dict[str, Any] = dict(
            DNSName=self.serialize(DNSName),
            HostedZoneId=self.serialize(HostedZoneId),
            MaxItems=self.serialize(MaxItems),
        )
        _response = self.client.list_hosted_zones_by_name(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = ListHostedZonesByNameResponse(**_response)

        results: List["HostedZone"] = None
        if response is not None:
            results = response.HostedZones

        self.sessionize(results)
        return cast("List[HostedZone]", results)

    def update_comment(self, Id: str, Comment: str) -> "HostedZone":
        """
        Updates the comment for a specified hosted zone.

        Args:
            Id: The ID for the hosted zone that you want to update the comment for.
            Comment: The new comment for the hosted zone. If you don't specify a value for ``Comment``, Amazon Route 53 deletes
                the existing value of the ``Comment`` element, if any.
        """
        args: Dict[str, Any] = dict(
            Id=self.serialize(Id), Comment=self.serialize(Comment)
        )
        _response = self.client.update_hosted_zone_comment(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = UpdateHostedZoneCommentResponse(**_response)

        results: "HostedZone" = None
        if response is not None:
            results = response.HostedZone

        self.sessionize(results)
        return cast("HostedZone", results)

    def count(
        self,
    ) -> int:
        """
        Retrieves the number of hosted zones that are associated with the current Amazon
        Web Services account.
        """
        args: Dict[str, Any] = dict()
        _response = self.client.get_hosted_zone_count(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = GetHostedZoneCountResponse(**_response)

        results: int = None
        if response is not None:
            results = response.HostedZoneCount

        self.sessionize(results)
        return cast("int", results)

    def limits(
        self,
        Type: Literal["MAX_RRSETS_BY_ZONE", "MAX_VPCS_ASSOCIATED_BY_ZONE"],
        HostedZoneId: str,
    ) -> "GetHostedZoneLimitResponse":
        """
        Gets the specified limit for a specified hosted zone, for example, the maximum
        number of records that you can create in the hosted zone.

        Args:
            Type: The limit that you want to get. Valid values include the following:
            HostedZoneId: The ID of the hosted zone that you want to get a limit for.
        """
        args: Dict[str, Any] = dict(
            Type=self.serialize(Type), HostedZoneId=self.serialize(HostedZoneId)
        )
        _response = self.client.get_hosted_zone_limit(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = GetHostedZoneLimitResponse(**_response)

        results: "GetHostedZoneLimitResponse" = None
        if response is not None:
            results = response

        self.sessionize(results)
        return cast("GetHostedZoneLimitResponse", results)

    def associate_vpc(
        self, HostedZoneId: str, VPC: "Route53VPC", *, Comment: str | None = None
    ) -> "ChangeInfo":
        """
        Associates an Amazon VPC with a private hosted zone.

        Args:
            HostedZoneId: The ID of the private hosted zone that you want to associate an Amazon VPC with.
            VPC: A complex type that contains information about the VPC that you want to associate with a private hosted zone.

        Keyword Args:
            Comment: *Optional:* A comment about the association request.
        """
        args: Dict[str, Any] = dict(
            HostedZoneId=self.serialize(HostedZoneId),
            VPC=self.serialize(VPC),
            Comment=self.serialize(Comment),
        )
        _response = self.client.associate_vpc_with_hosted_zone(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = AssociateVPCWithHostedZoneResponse(**_response)

        results: "ChangeInfo" = None
        if response is not None:
            results = response.ChangeInfo

        self.sessionize(results)
        return cast("ChangeInfo", results)

    def disassociate_vpc(
        self, HostedZoneId: str, VPC: "Route53VPC", *, Comment: str | None = None
    ) -> "ChangeInfo":
        """
        Disassociates an Amazon Virtual Private Cloud (Amazon VPC) from an Amazon Route 53 private hosted zone. Note the
        following:

        Args:
            HostedZoneId: The ID of the private hosted zone that you want to disassociate a VPC from.
            VPC: A complex type that contains information about the VPC that you're disassociating from the specified hosted
                zone.

        Keyword Args:
            Comment: *Optional:* A comment about the disassociation request.

        """
        args: Dict[str, Any] = dict(
            HostedZoneId=self.serialize(HostedZoneId),
            VPC=self.serialize(VPC),
            Comment=self.serialize(Comment),
        )
        _response = self.client.disassociate_vpc_from_hosted_zone(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DisassociateVPCFromHostedZoneResponse(**_response)

        results: "ChangeInfo" = None
        if response is not None:
            results = response.ChangeInfo

        self.sessionize(results)
        return cast("ChangeInfo", results)


class Route53VPCManager(Boto3ModelManager):
    service_name: str = "route53"

    def associate(
        self, HostedZoneId: str, VPC: "Route53VPC", *, Comment: str | None = None
    ) -> "ChangeInfo":
        """
        Associates an Amazon VPC with a private hosted zone.

        Args:
            HostedZoneId: The ID of the private hosted zone that you want to associate an Amazon VPC with.
            VPC: A complex type that contains information about the VPC that you want to associate with a private hosted zone.

        Keyword Args:
            Comment: *Optional:* A comment about the association request.
        """
        args: Dict[str, Any] = dict(
            HostedZoneId=self.serialize(HostedZoneId),
            VPC=self.serialize(VPC),
            Comment=self.serialize(Comment),
        )
        _response = self.client.associate_vpc_with_hosted_zone(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = AssociateVPCWithHostedZoneResponse(**_response)

        results: "ChangeInfo" = None
        if response is not None:
            results = response.ChangeInfo

        self.sessionize(results)
        return cast("ChangeInfo", results)

    def disassociate(
        self, HostedZoneId: str, VPC: "Route53VPC", *, Comment: str | None = None
    ) -> "ChangeInfo":
        """
        Disassociates an Amazon Virtual Private Cloud (Amazon VPC) from an Amazon Route 53 private hosted zone. Note the
        following:

        Args:
            HostedZoneId: The ID of the private hosted zone that you want to disassociate a VPC from.
            VPC: A complex type that contains information about the VPC that you're disassociating from the specified hosted
                zone.

        Keyword Args:
            Comment: *Optional:* A comment about the disassociation request.

        """
        args: Dict[str, Any] = dict(
            HostedZoneId=self.serialize(HostedZoneId),
            VPC=self.serialize(VPC),
            Comment=self.serialize(Comment),
        )
        _response = self.client.disassociate_vpc_from_hosted_zone(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DisassociateVPCFromHostedZoneResponse(**_response)

        results: "ChangeInfo" = None
        if response is not None:
            results = response.ChangeInfo

        self.sessionize(results)
        return cast("ChangeInfo", results)

    def list_hosted_zones(
        self,
        VPCId: str,
        VPCRegion: Literal[
            "us-east-1",
            "us-east-2",
            "us-west-1",
            "us-west-2",
            "eu-west-1",
            "eu-west-2",
            "eu-west-3",
            "eu-central-1",
            "eu-central-2",
            "ap-east-1",
            "me-south-1",
            "us-gov-west-1",
            "us-gov-east-1",
            "us-iso-east-1",
            "us-iso-west-1",
            "us-isob-east-1",
            "me-central-1",
            "ap-southeast-1",
            "ap-southeast-2",
            "ap-southeast-3",
            "ap-south-1",
            "ap-south-2",
            "ap-northeast-1",
            "ap-northeast-2",
            "ap-northeast-3",
            "eu-north-1",
            "sa-east-1",
            "ca-central-1",
            "cn-north-1",
            "cn-northwest-1",
            "af-south-1",
            "eu-south-1",
            "eu-south-2",
            "ap-southeast-4",
            "il-central-1",
            "ca-west-1",
            "ap-southeast-5",
            "mx-central-1",
            "us-isof-south-1",
            "us-isof-east-1",
            "ap-southeast-7",
            "ap-east-2",
            "eu-isoe-west-1",
            "ap-southeast-6",
        ],
        *,
        MaxItems: str | None = None,
        NextToken: str | None = None,
    ) -> List["HostedZoneSummary"]:
        """
        Lists all the private hosted zones that a specified VPC is associated with, regardless of which Amazon Web Services
        account or Amazon Web Services service owns the hosted zones. The ``HostedZoneOwner`` structure in the response contains
        one of the following values:

        Args:
            VPCId: The ID of the Amazon VPC that you want to list hosted zones for.
            VPCRegion: For the Amazon VPC that you specified for ``VPCId``, the Amazon Web Services Region that you created the
                VPC in.

        Keyword Args:
            MaxItems: (Optional) The maximum number of hosted zones that you want Amazon Route 53 to return. If the specified
                VPC is associated with more than ``MaxItems`` hosted zones, the response includes a ``NextToken`` element.
                ``NextToken`` contains an encrypted token that identifies the first hosted zone that Route 53 will return if you
                submit another request.
            NextToken: If the previous response included a ``NextToken`` element, the specified VPC is associated with more
                hosted zones. To get more hosted zones, submit another ``ListHostedZonesByVPC`` request.

        """
        args: Dict[str, Any] = dict(
            VPCId=self.serialize(VPCId),
            VPCRegion=self.serialize(VPCRegion),
            MaxItems=self.serialize(MaxItems),
            NextToken=self.serialize(NextToken),
        )
        _response = self.client.list_hosted_zones_by_vpc(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = ListHostedZonesByVPCResponse(**_response)

        results: List["HostedZoneSummary"] = None
        if response is not None:
            results = response.HostedZoneSummaries

        self.sessionize(results)
        return cast("List[HostedZoneSummary]", results)

    def list_authorizations(self, HostedZoneId: str) -> List["Route53VPC"]:
        """
        Gets a list of the VPCs that were created by other accounts and that can be
        associated with a specified hosted zone because you've submitted one or more
        ``CreateVPCAssociationAuthorization`` requests.

        Args:
            HostedZoneId: The ID of the hosted zone for which you want a list of VPCs that can be associated with the hosted
                zone.
        """
        paginator = self.client.get_paginator("list_vpc_association_authorizations")
        args: Dict[str, Any] = dict(HostedZoneId=self.serialize(HostedZoneId))
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )

        results: List["Route53VPC"] = []

        for _response in response_iterator:
            response = ListVPCAssociationAuthorizationsResponse(**_response)
            if response.VPCs is not None:
                results.extend(response.VPCs)
            else:
                break

        self.sessionize(results)
        return cast("List[Route53VPC]", results)

    def create_authorization(
        self, HostedZoneId: str, VPC: "Route53VPC"
    ) -> "Route53VPC":
        """
        Authorizes the Amazon Web Services account that created a specified VPC to
        submit an ``AssociateVPCWithHostedZone`` request to associate the VPC with a
        specified hosted zone that was created by a different account. To submit a
        ``CreateVPCAssociationAuthorization`` request, you must use the account that
        created the hosted zone. After you authorize the association, use the account
        that created the VPC to submit an ``AssociateVPCWithHostedZone`` request.

        Args:
            HostedZoneId: The ID of the private hosted zone that you want to authorize associating a VPC with.
            VPC: A complex type that contains the VPC ID and region for the VPC that you want to authorize associating with your
                hosted zone.
        """
        args: Dict[str, Any] = dict(
            HostedZoneId=self.serialize(HostedZoneId), VPC=self.serialize(VPC)
        )
        _response = self.client.create_vpc_association_authorization(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateVPCAssociationAuthorizationResponse(**_response)

        results: "Route53VPC" = None
        if response is not None:
            results = response.VPC

        self.sessionize(results)
        return cast("Route53VPC", results)

    def delete_authorization(
        self, HostedZoneId: str, VPC: "Route53VPC"
    ) -> "DeleteVPCAssociationAuthorizationResponse":
        """
        Removes authorization to submit an ``AssociateVPCWithHostedZone`` request to
        associate a specified VPC with a hosted zone that was created by a different
        account. You must use the account that created the hosted zone to submit a
        ``DeleteVPCAssociationAuthorization`` request.

        Args:
            HostedZoneId: When removing authorization to associate a VPC that was created by one Amazon Web Services account
                with a hosted zone that was created with a different Amazon Web Services account, the ID of the hosted zone.
            VPC: When removing authorization to associate a VPC that was created by one Amazon Web Services account with a
                hosted zone that was created with a different Amazon Web Services account, a complex type that includes the ID and
                region of the VPC.
        """
        args: Dict[str, Any] = dict(
            HostedZoneId=self.serialize(HostedZoneId), VPC=self.serialize(VPC)
        )
        _response = self.client.delete_vpc_association_authorization(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DeleteVPCAssociationAuthorizationResponse(**_response)

        results: "DeleteVPCAssociationAuthorizationResponse" = None
        if response is not None:
            results = response

        self.sessionize(results)
        return cast("DeleteVPCAssociationAuthorizationResponse", results)


class Route53CidrCollectionManager(Boto3ModelManager):
    service_name: str = "route53"

    def create(
        self, model: "Route53CidrCollection", CallerReference: str
    ) -> "CreateCidrCollectionResponse":
        """
        Creates a CIDR collection in the current Amazon Web Services account.

        Args:
            model: The :py:class:`CidrCollection` to create.
            CallerReference: A client-specific token that allows requests to be securely retried so that the intended outcome
                will only occur once, retries receive a similar response, and there are no additional edge cases to handle.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            Name=data.get("Name"), CallerReference=self.serialize(CallerReference)
        )
        _response = self.client.create_cidr_collection(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateCidrCollectionResponse(**_response)

        self.sessionize(response)
        return cast("CreateCidrCollectionResponse", response)

    def delete(self, Id: str) -> None:
        """
        Deletes a CIDR collection in the current Amazon Web Services account. The
        collection must be empty before it can be deleted.

        Args:
            Id: The UUID of the collection to delete.
        """
        args: Dict[str, Any] = dict(Id=self.serialize(Id))
        self.client.delete_cidr_collection(
            **{k: v for k, v in args.items() if v is not None}
        )

    def list(
        self,
    ) -> PrimaryBoto3ModelQuerySet:
        """
        Returns a paginated list of CIDR collections in the Amazon Web Services account
        (metadata only).
        """
        paginator = self.client.get_paginator("list_cidr_collections")
        args: Dict[str, Any] = dict()
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results = []
        for _response in response_iterator:
            if list(_response.keys()) == ["ResponseMetadata"]:
                break
            if "ResponseMetadata" in _response:
                del _response["ResponseMetadata"]
            response = ListCidrCollectionsResponse(**_response)
            if response.CidrCollections:
                results.extend(response.CidrCollections)
            else:
                if getattr(response, "NextToken", None):
                    continue
                break
        self.sessionize(results)
        if results and isinstance(results[0], Boto3Model):
            return PrimaryBoto3ModelQuerySet(results)
        return results

    def update(
        self, model: "Route53CidrCollection", CollectionVersion: int | None = None
    ) -> str:
        """
        Creates, changes, or deletes CIDR blocks within a collection. Contains
        authoritative IP information mapping blocks to one or multiple locations.

        Args:
            model: The :py:class:`CidrCollection` to update.

        Keyword Args:
            CollectionVersion: A sequential counter that Amazon Route 53 sets to 1 when you create a collection and increments
                it by 1 each time you update the collection.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            Id=data.get("Id"),
            Changes=data.get("Changes"),
            CollectionVersion=self.serialize(CollectionVersion),
        )
        _response = self.client.change_cidr_collection(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = ChangeCidrCollectionResponse(**_response)

        self.sessionize(response.Id)
        return cast("str", response.Id)


class CidrBlockSummaryManager(Boto3ModelManager):
    service_name: str = "route53"

    def list(
        self, CollectionId: str, *, LocationName: str | None = None
    ) -> PrimaryBoto3ModelQuerySet:
        """
        Returns a paginated list of location objects and their CIDR blocks.

        Args:
            CollectionId: The UUID of the CIDR collection.

        Keyword Args:
            LocationName: The name of the CIDR collection location.
        """
        paginator = self.client.get_paginator("list_cidr_blocks")
        args: Dict[str, Any] = dict(
            CollectionId=self.serialize(CollectionId),
            LocationName=self.serialize(LocationName),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results = []
        for _response in response_iterator:
            if list(_response.keys()) == ["ResponseMetadata"]:
                break
            if "ResponseMetadata" in _response:
                del _response["ResponseMetadata"]
            response = ListCidrBlocksResponse(**_response)
            if response.CidrBlocks:
                results.extend(response.CidrBlocks)
            else:
                if getattr(response, "NextToken", None):
                    continue
                break
        self.sessionize(results)
        if results and isinstance(results[0], Boto3Model):
            return PrimaryBoto3ModelQuerySet(results)
        return results


class Route53QueryLoggingConfigManager(Boto3ModelManager):
    service_name: str = "route53"

    def create(self, model: "Route53QueryLoggingConfig") -> "Route53QueryLoggingConfig":
        """
        Creates a configuration for DNS query logging. After you create a query logging
        configuration, Amazon Route 53 begins to publish log data to an Amazon
        CloudWatch Logs log group.

        Args:
            model: The :py:class:`QueryLoggingConfig` to create.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            HostedZoneId=data.get("HostedZoneId"),
            CloudWatchLogsLogGroupArn=data.get("CloudWatchLogsLogGroupArn"),
        )
        _response = self.client.create_query_logging_config(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateQueryLoggingConfigResponse(**_response)

        self.sessionize(response.QueryLoggingConfig)
        return cast("Route53QueryLoggingConfig", response.QueryLoggingConfig)

    def delete(self, Id: str) -> None:
        """
        Deletes a configuration for DNS query logging. If you delete a configuration,
        Amazon Route 53 stops sending query logs to CloudWatch Logs. Route 53 doesn't
        delete any logs that are already in CloudWatch Logs.

        Args:
            Id: The ID of the configuration that you want to delete.
        """
        args: Dict[str, Any] = dict(Id=self.serialize(Id))
        self.client.delete_query_logging_config(
            **{k: v for k, v in args.items() if v is not None}
        )

    def get(self, Id: str) -> Optional["Route53QueryLoggingConfig"]:
        """
        Gets information about a specified configuration for DNS query logging.

        Args:
            Id: The ID of the configuration for DNS query logging that you want to get information about.
        """
        args: Dict[str, Any] = dict(Id=self.serialize(Id))
        _response = self.client.get_query_logging_config(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = GetQueryLoggingConfigResponse(**_response)

        if response and response.QueryLoggingConfig:
            self.sessionize(response.QueryLoggingConfig)
            return response.QueryLoggingConfig
        return None

    def list(self, *, HostedZoneId: str | None = None) -> PrimaryBoto3ModelQuerySet:
        """
        Lists the configurations for DNS query logging that are associated with the
        current Amazon Web Services account or the configuration that is associated with
        a specified hosted zone.

        Keyword Args:
            HostedZoneId: (Optional) If you want to list the query logging configuration that is associated with a hosted zone,
                specify the ID in ``HostedZoneId``.
        """
        paginator = self.client.get_paginator("list_query_logging_configs")
        args: Dict[str, Any] = dict(HostedZoneId=self.serialize(HostedZoneId))
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results = []
        for _response in response_iterator:
            if list(_response.keys()) == ["ResponseMetadata"]:
                break
            if "ResponseMetadata" in _response:
                del _response["ResponseMetadata"]
            response = ListQueryLoggingConfigsResponse(**_response)
            if response.QueryLoggingConfigs:
                results.extend(response.QueryLoggingConfigs)
            else:
                if getattr(response, "NextToken", None):
                    continue
                break
        self.sessionize(results)
        if results and isinstance(results[0], Boto3Model):
            return PrimaryBoto3ModelQuerySet(results)
        return results


class Route53ResourceRecordSetManager(Boto3ModelManager):
    service_name: str = "route53"

    def change(self, HostedZoneId: str, ChangeBatch: "ChangeBatch") -> "ChangeInfo":
        """
        Creates, changes, or deletes a resource record set, which contains authoritative
        DNS information for a specified domain name or subdomain name. For example, you
        can use ``ChangeResourceRecordSets`` to create a resource record set that routes
        traffic for test.example.com to a web server that has an IP address of
        192.0.2.44.

        Args:
            HostedZoneId: The ID of the hosted zone that contains the resource record sets that you want to change.
            ChangeBatch: A complex type that contains an optional comment and the ``Changes`` element.
        """
        args: Dict[str, Any] = dict(
            HostedZoneId=self.serialize(HostedZoneId),
            ChangeBatch=self.serialize(ChangeBatch),
        )
        _response = self.client.change_resource_record_sets(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = ChangeResourceRecordSetsResponse(**_response)

        results: "ChangeInfo" = None
        if response is not None:
            results = response.ChangeInfo

        self.sessionize(results)
        return cast("ChangeInfo", results)

    def list(
        self,
        HostedZoneId: str,
        *,
        StartRecordName: str | None = None,
        StartRecordType: Literal["SOA", "A", "TXT", "NS", "CNAME", "MX", "NAPTR", "PTR", "SRV", "SPF", "AAAA", "CAA", "DS", "TLSA", "SSHFP", "SVCB", "HTTPS"] | None = None,
        StartRecordIdentifier: str | None = None,
        MaxItems: str | None = None,
    ) -> PrimaryBoto3ModelQuerySet:
        """
        Lists the resource record sets in a specified hosted zone.

        Args:
            HostedZoneId: The ID of the hosted zone that contains the resource record sets that you want to list.

        Keyword Args:
            StartRecordName: The first name in the lexicographic ordering of resource record sets that you want to list. If the
                specified record name doesn't exist, the results begin with the first resource record set that has a name greater
                than the value of ``name``.
            StartRecordType: The type of resource record set to begin the record listing from.
            StartRecordIdentifier: *Resource record sets that have a routing policy other than simple:* If results were
                truncated for a given DNS name and   type, specify the value of ``NextRecordIdentifier`` from the previous response
                to get the next resource record set that   has the current DNS name and type.
            MaxItems: (Optional) The maximum number of resource records sets to include in the response body for this request.
                If the response includes more than ``maxitems`` resource record sets, the value of the ``IsTruncated`` element in
                the response is ``true``, and the values of the ``NextRecordName`` and ``NextRecordType`` elements in the response
                identify the first resource record set in the next group of ``maxitems`` resource record sets.
        """
        paginator = self.client.get_paginator("list_resource_record_sets")
        args: Dict[str, Any] = dict(
            HostedZoneId=self.serialize(HostedZoneId),
            StartRecordName=self.serialize(StartRecordName),
            StartRecordType=self.serialize(StartRecordType),
            StartRecordIdentifier=self.serialize(StartRecordIdentifier),
            MaxItems=self.serialize(MaxItems),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results = []
        for _response in response_iterator:
            if list(_response.keys()) == ["ResponseMetadata"]:
                break
            if "ResponseMetadata" in _response:
                del _response["ResponseMetadata"]
            response = ListResourceRecordSetsResponse(**_response)
            if response.ResourceRecordSets:
                results.extend(response.ResourceRecordSets)
            else:
                if getattr(response, "NextToken", None):
                    continue
                break
        self.sessionize(results)
        if results and isinstance(results[0], Boto3Model):
            return PrimaryBoto3ModelQuerySet(results)
        return results


# ==============
# Service Models
# ==============


class HostedZoneConfig(Boto3Model):
    """
    A complex type that contains an optional comment about your hosted zone.

    If you don't want to specify a comment, omit
    both the ``HostedZoneConfig`` and ``Comment`` elements.
    """

    Comment: str | None = None
    """
    Any comments that you want to include about the hosted zone.
    """
    PrivateZone: bool | None = None
    """
    A value that indicates whether this is a private hosted zone.
    """


class Route53LinkedService(Boto3Model):
    """
    If a health check or hosted zone was created by another service, ``LinkedService``
    is a complex type that describes the service that created the resource.

    When a resource is created by another service, you can't edit or delete it using
    Amazon Route 53.
    """

    ServicePrincipal: str | None = None
    """
    If the health check or hosted zone was created by another service, the service that
    created the resource.

    When a resource is created by another service, you can't edit or delete it using
    Amazon Route 53.
    """
    Description: str | None = None
    """
    If the health check or hosted zone was created by another service, an optional
    description that can be provided by the other service.

    When a resource is created by another service, you can't edit or delete it using
    Amazon Route 53.
    """


class HostedZone(HostedZoneModelMixin, PrimaryBoto3Model):
    """
    A complex type that contains general information about the hosted zone.
    """

    manager_class: ClassVar[Type[Boto3ModelManager]] = HostedZoneManager

    Id: str = Field(frozen=True)
    """
    The ID that Amazon Route 53 assigned to the hosted zone when you created it.
    """
    Name: str
    """
    The name of the domain.

    For public hosted zones, this is the name that you have registered with your DNS
    registrar.
    """
    CallerReference: str
    """
    The value that you specified for ``CallerReference`` when you created the hosted
    zone.
    """
    Config: HostedZoneConfig = Field(default=None, frozen=True)
    """
    A complex type that includes the ``Comment`` and ``PrivateZone`` elements.

    If you omitted the ``HostedZoneConfig`` and
    ``Comment`` elements from the request, the ``Config`` and ``Comment`` elements don't appear in the response.
    """
    ResourceRecordSetCount: int = Field(default=None, frozen=True)
    """
    The number of resource record sets in the hosted zone.
    """
    LinkedService: Route53LinkedService = Field(default=None, frozen=True)
    """
    If the hosted zone was created by another service, the service that created the
    hosted zone.

    When a hosted zone is created by another service, you can't edit or delete it using
    Route 53.
    """

    @property
    def pk(self) -> str | None:
        """
        Return the primary key of the model.   This is the value of the :py:attr:`Id`
        attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.Id

    @property
    def name(self) -> str | None:
        """
        Return the name of the model.   This is the value of the :py:attr:`Name`
        attribute.

        Returns:
            The name of the model instance.
        """
        return self.Name

    def __hash__(self) -> int:
        """
        Return the hash of the model.

        This is the value of the
        :py:attr:`Id` attribute.
        """
        return hash(self.Id)

    @cached_property
    def records(self) -> List["Route53ResourceRecordSet"] | None:
        """
        Return the records in the hosted zone.

        .. note::

            The output of this property is cached on the model instance, so
            calling this multiple times will not result in multiple calls to the
            AWS API.   If you need a fresh copy of the data, you can re-get the
            model instance from the manager.
        """

        try:
            pk = OrderedDict(
                {
                    "HostedZoneId": self.Id,
                }
            )
        except AttributeError:
            return []
        return Route53ResourceRecordSet.objects.using(self.session).list(**pk)  # type: ignore[arg-type]

    def update_comment(self, Comment: str) -> "HostedZone":
        """
        Update the comment for the hosted zone.

        Args:
            Comment: The new comment for the hosted zone. If you don't specify a value for ``Comment``, Amazon Route 53 deletes
                the existing value of the ``Comment`` element, if any.
        """

        return (
            cast("HostedZoneManager", self.objects)  # type: ignore[attr-defined]
            .using(self.session)
            .update_comment(
                cast("str", self.Id),
                Comment,
            )
        )


class Route53VPC(PrimaryBoto3Model):
    """
    (Private hosted zones only) A complex type that contains information about an Amazon
    VPC.

    If you associate a private hosted zone with an Amazon VPC when you make a
    `CreateHostedZone <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateHostedZone.html>`_
    request, the
    following parameters are also required.
    """

    manager_class: ClassVar[Type[Boto3ModelManager]] = Route53VPCManager

    VPCRegion: Literal["us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-west-2", "eu-west-3", "eu-central-1", "eu-central-2", "ap-east-1", "me-south-1", "us-gov-west-1", "us-gov-east-1", "us-iso-east-1", "us-iso-west-1", "us-isob-east-1", "me-central-1", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-south-1", "ap-south-2", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "eu-north-1", "sa-east-1", "ca-central-1", "cn-north-1", "cn-northwest-1", "af-south-1", "eu-south-1", "eu-south-2", "ap-southeast-4", "il-central-1", "ca-west-1", "ap-southeast-5", "mx-central-1", "us-isof-south-1", "us-isof-east-1", "ap-southeast-7", "ap-east-2", "eu-isoe-west-1", "ap-southeast-6"] | None = None
    """
    (Private hosted zones only) The region that an Amazon VPC was created in.
    """
    VPCId: str | None = None
    """
    (Private hosted zones only) The ID of an Amazon VPC.
    """

    @property
    def pk(self) -> str | None:
        """
        Return the primary key of the model.   This is the value of the :py:attr:`VPCId`
        attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.VPCId

    def __hash__(self) -> int:
        """
        Return the hash of the model.

        This is the value of the
        :py:attr:`VPCId` attribute.
        """
        return hash(self.VPCId)


class Route53CidrCollection(PrimaryBoto3Model):
    """
    A complex type that identifies a CIDR collection.
    """

    manager_class: ClassVar[Type[Boto3ModelManager]] = Route53CidrCollectionManager

    Arn: str = Field(default=None, frozen=True)
    """
    The ARN of the collection.

    Can be used to reference the collection in IAM policy or in another Amazon Web
    Services account.
    """
    Id: str | None = None
    """
    The unique ID of the CIDR collection.
    """
    Name: str | None = None
    """
    The name of a CIDR collection.
    """
    Version: int = Field(default=None, frozen=True)
    """
    A sequential counter that Route 53 sets to 1 when you create a CIDR collection and
    increments by 1 each time you update settings for the CIDR collection.
    """

    @property
    def pk(self) -> str | None:
        """
        Return the primary key of the model.   This is the value of the :py:attr:`Id`
        attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.Id

    @property
    def arn(self) -> str | None:
        """
        Return the ARN of the model.   This is the value of the :py:attr:`Arn`
        attribute.

        Returns:
            The ARN of the model instance.
        """
        return self.Arn

    @property
    def name(self) -> str | None:
        """
        Return the name of the model.   This is the value of the :py:attr:`Name`
        attribute.

        Returns:
            The name of the model instance.
        """
        return self.Name

    def __hash__(self) -> int:
        """
        Return the hash of the model.

        This is the value of the
        :py:attr:`Id` attribute.
        """
        return hash(self.Id)


class CidrBlockSummary(PrimaryBoto3Model):
    """
    A complex type that lists the CIDR blocks.
    """

    manager_class: ClassVar[Type[Boto3ModelManager]] = CidrBlockSummaryManager

    CidrBlock: str | None = None
    """
    Value for the CIDR block.
    """
    LocationName: str | None = None
    """
    The location name of the CIDR block.
    """

    @property
    def pk(self) -> str | None:
        """
        Return the primary key of the model.   This is the value of the
        :py:attr:`CidrBlock` attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.CidrBlock

    @property
    def name(self) -> str | None:
        """
        Return the name of the model.   This is the value of the :py:attr:`CidrBlock`
        attribute.

        Returns:
            The name of the model instance.
        """
        return self.CidrBlock

    def __hash__(self) -> int:
        """
        Return the hash of the model.

        This is the value of the
        :py:attr:`CidrBlock` attribute.
        """
        return hash(self.CidrBlock)


class Route53QueryLoggingConfig(PrimaryBoto3Model):
    """
    A complex type that contains information about a configuration for DNS query
    logging.
    """

    manager_class: ClassVar[Type[Boto3ModelManager]] = Route53QueryLoggingConfigManager

    Id: str = Field(frozen=True)
    """
    The ID for a configuration for DNS query logging.
    """
    HostedZoneId: str
    """
    The ID of the hosted zone that CloudWatch Logs is logging queries for.
    """
    CloudWatchLogsLogGroupArn: str
    """
    The Amazon Resource Name (ARN) of the CloudWatch Logs log group that Amazon Route 53
    is publishing logs to.
    """

    @property
    def pk(self) -> str | None:
        """
        Return the primary key of the model.   This is the value of the :py:attr:`Id`
        attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.Id

    @property
    def name(self) -> str | None:
        """
        Return the name of the model.   This is the value of the :py:attr:`Id`
        attribute.

        Returns:
            The name of the model instance.
        """
        return self.Id

    def __hash__(self) -> int:
        """
        Return the hash of the model.

        This is the value of the
        :py:attr:`Id` attribute.
        """
        return hash(self.Id)


class Route53GeoLocation(Boto3Model):
    """
    A complex type that contains information about a geographic location.
    """

    ContinentCode: str | None = None
    """
    The two-letter code for the continent.
    """
    CountryCode: str | None = None
    """
    For geolocation resource record sets, the two-letter code for a country.
    """
    SubdivisionCode: str | None = None
    """
    For geolocation resource record sets, the two-letter code for a state of the United
    States.

    Route 53 doesn't support any
    other values for ``SubdivisionCode``. For a list of state abbreviations, see `Appendix B: Two-Letter State and
    Possession Abbreviations <https://pe.usps.com/text/pub28/28apb.htm>`_ on the United States Postal Service website.
    """


class ResourceRecord(Boto3Model):
    """
    Information specific to the resource record.

    If you're creating an alias resource record set, omit ``ResourceRecord``.
    """

    Value: str
    """
    The current or new DNS record value, not to exceed 4,000 characters.

    In the case of a ``DELETE`` action, if the current
    value does not match the actual value, an error is returned. For descriptions about how to format ``Value`` for
    different record types, see `Supported DNS Resource Record
    Types <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html>`_ in the *Amazon Route 53
    Developer Guide*.
    """


class Route53AliasTarget(Boto3Model):
    """
    *Alias resource record sets only:* Information about the Amazon Web Services
    resource, such as a CloudFront distribution or an Amazon S3 bucket, that you want to
    route traffic to.

    When creating resource record sets for a private hosted zone, note the following:

    * For information about creating failover resource record sets in a private hosted zone, see `Configuring Failover in a
      Private Hosted Zone <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html>`_.
    """

    HostedZoneId: str
    """
    *Alias resource records sets only*: The value used depends on where you want to
    route traffic:
    """
    DNSName: str
    """
    *Alias resource record sets only:* The value that you specify depends on where you
    want to route queries:
    """
    EvaluateTargetHealth: bool
    """
    *Applies only to alias, failover alias, geolocation alias, latency alias, and
    weighted alias resource record sets:* When ``EvaluateTargetHealth`` is ``true``, an
    alias resource record set inherits the health of the referenced Amazon Web Services
    resource, such as an ELB load balancer or another resource record set in the hosted
    zone.
    """


class Route53CidrRoutingConfig(Boto3Model):
    """
    The object that is specified in resource record set object when you are linking a
    resource record set to a CIDR location.

    A ``LocationName`` with an asterisk “*” can be used to create a default CIDR record. ``CollectionId`` is still required
    for default record.
    """

    CollectionId: str
    """
    The CIDR collection ID.
    """
    LocationName: str
    """
    The CIDR collection location name.
    """


class Route53Coordinates(Boto3Model):
    """
    A complex type that lists the coordinates for a geoproximity resource record.
    """

    Latitude: str
    """
Specifies a coordinate of the north-south position of a geographic point on the surface of the Earth (-90 - 90).
    """
    Longitude: str
    """
Specifies a coordinate of the east-west position of a geographic point on the surface of the Earth (-180 - 180).
    """


class Route53GeoProximityLocation(Boto3Model):
    """
    (Resource record sets only): A complex type that lets you specify where your
    resources are located. Only one of ``LocalZoneGroup``, ``Coordinates``, or ``Amazon
    Web ServicesRegion`` is allowed per request at a time.

    For more information about geoproximity routing, see
    `Geoproximity routing <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-geoproximity.html>`_
    in the *Amazon
    Route 53 Developer Guide*.
    """

    AWSRegion: str | None = None
    """
    The Amazon Web Services Region the resource you are directing DNS traffic to, is in.
    """
    LocalZoneGroup: str | None = None
    """
    Specifies an Amazon Web Services Local Zone Group.
    """
    Coordinates: Route53Coordinates | None = None
    """
    Contains the longitude and latitude for a geographic region.
    """
    Bias: int | None = None
    """
    The bias increases or decreases the size of the geographic region from which
    Route 53 routes traffic to a resource.
    """


class Route53ResourceRecordSet(PrimaryBoto3Model):
    """
    Information about the resource record set to create or delete.
    """

    manager_class: ClassVar[Type[Boto3ModelManager]] = Route53ResourceRecordSetManager

    Name: str = Field(frozen=True)
    """
    For ``ChangeResourceRecordSets`` requests, the name of the record that you want to
    create, update, or delete.

    For
    ``ListResourceRecordSets`` responses, the name of a record in the specified hosted zone.
    """
    Type: Literal[
        "SOA",
        "A",
        "TXT",
        "NS",
        "CNAME",
        "MX",
        "NAPTR",
        "PTR",
        "SRV",
        "SPF",
        "AAAA",
        "CAA",
        "DS",
        "TLSA",
        "SSHFP",
        "SVCB",
        "HTTPS",
    ] = Field(frozen=True)
    """
    The DNS record type.

    For information about different record types and how data is encoded for them, see
    `Supported DNS Resource Record Types <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html>`_
    in the
    *Amazon Route 53 Developer Guide*.
    """
    SetIdentifier: str = Field(default=None, frozen=True)
    """
    *Resource record sets that have a routing policy other than simple:* An identifier
    that differentiates among multiple resource record sets that have the same
    combination of name and type, such as multiple weighted resource record sets named
    acme.example.com that have a type of A.

    In a group of resource record sets that have the same name and type, the
    value of ``SetIdentifier`` must be unique for each resource record set.
    """
    Weight: int = Field(default=None, frozen=True)
    """
    *Weighted resource record sets only:* Among resource record sets that have the same
    combination of DNS name and type, a value that determines the proportion of DNS
    queries that Amazon Route 53 responds to using the current resource record set.

    Route 53 calculates the sum of the weights for the resource record sets that have
    the same combination of DNS name and type. Route 53 then responds to queries based
    on the ratio of a resource's weight to the total. Note the following:
    """
    Region: Literal[
        "us-east-1",
        "us-east-2",
        "us-west-1",
        "us-west-2",
        "ca-central-1",
        "eu-west-1",
        "eu-west-2",
        "eu-west-3",
        "eu-central-1",
        "eu-central-2",
        "ap-southeast-1",
        "ap-southeast-2",
        "ap-southeast-3",
        "ap-northeast-1",
        "ap-northeast-2",
        "ap-northeast-3",
        "eu-north-1",
        "sa-east-1",
        "cn-north-1",
        "cn-northwest-1",
        "ap-east-1",
        "me-south-1",
        "me-central-1",
        "ap-south-1",
        "ap-south-2",
        "af-south-1",
        "eu-south-1",
        "eu-south-2",
        "ap-southeast-4",
        "il-central-1",
        "ca-west-1",
        "ap-southeast-5",
        "mx-central-1",
        "ap-southeast-7",
        "us-gov-east-1",
        "us-gov-west-1",
        "ap-east-2",
        "ap-southeast-6",
    ] = Field(default=None, frozen=True)
    """
    *Latency-based resource record sets only:* The Amazon EC2 Region where you created
    the resource that this resource record set refers to.

    The resource typically is an Amazon Web Services resource, such as an EC2 instance
    or an ELB load balancer, and is referred to by an IP address or a DNS domain name,
    depending on the record type.
    """
    GeoLocation: Route53GeoLocation = Field(default=None, frozen=True)
    """
    *Geolocation resource record sets only:* A complex type that lets you control how
    Amazon Route 53 responds to DNS queries based on the geographic origin of the query.

    For example, if you want all queries from Africa to be routed to a
    web server with an IP address of ``192.0.2.111``, create a resource record set with a ``Type`` of ``A`` and a
    ``ContinentCode`` of ``AF``.
    """
    Failover: Literal["PRIMARY", "SECONDARY"] = Field(default=None, frozen=True)
    """
    *Failover resource record sets only:* To configure failover, you add the
    ``Failover`` element to two resource record sets.

    For one resource record set, you specify ``PRIMARY`` as the value for ``Failover``; for the other resource record
    set, you specify ``SECONDARY``. In addition, you include the ``HealthCheckId`` element and specify the health check that
    you want Amazon Route 53 to perform for each resource record set.
    """
    MultiValueAnswer: bool = Field(default=None, frozen=True)
    """
    *Multivalue answer resource record sets only*: To route traffic approximately
    randomly to multiple resources, such as web servers, create one multivalue answer
    record for each resource and specify ``true`` for ``MultiValueAnswer``.

    Note
    the following:
    """
    TTL: int = Field(default=None, frozen=True)
    """
    The resource record cache time to live (TTL), in seconds.

    Note the following:
    """
    ResourceRecords: List["ResourceRecord"] = Field(default_factory=list, frozen=True)
    """
    Information about the resource records to act upon.
    """
    AliasTarget: Route53AliasTarget = Field(default=None, frozen=True)
    """
    *Alias resource record sets only:* Information about the Amazon Web Services
    resource, such as a CloudFront distribution or an Amazon S3 bucket, that you want to
    route traffic to.
    """
    HealthCheckId: str = Field(default=None, frozen=True)
    """
    If you want Amazon Route 53 to return this resource record set in response to a DNS
    query only when the status of a health check is healthy, include the
    ``HealthCheckId`` element and specify the ID of the applicable health check.
    """
    TrafficPolicyInstanceId: str = Field(default=None, frozen=True)
    """
    When you create a traffic policy instance, Amazon Route 53 automatically creates a
    resource record set.

    ``TrafficPolicyInstanceId`` is the ID of the traffic policy instance that Route 53 created this resource record set for.
    """
    CidrRoutingConfig: Route53CidrRoutingConfig = Field(default=None, frozen=True)
    """
    The object that is specified in resource record set object when you are linking a
    resource record set to a CIDR location.
    """
    GeoProximityLocation: Route53GeoProximityLocation = Field(default=None, frozen=True)
    """
    *GeoproximityLocation resource record sets only:* A complex type that lets you
    control how Route 53 responds to DNS queries based on the geographic origin of the
    query and your resources.
    """

    @property
    def pk(self) -> str | None:
        """
        Return the primary key of the model.   This is the value of the :py:attr:`Name`
        attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.Name

    @property
    def name(self) -> str | None:
        """
        Return the name of the model.   This is the value of the :py:attr:`Name`
        attribute.

        Returns:
            The name of the model instance.
        """
        return self.Name

    def __hash__(self) -> int:
        """
        Return the hash of the model.

        This is the value of the
        :py:attr:`Name` attribute.
        """
        return hash(self.Name)


# =======================
# Request/Response Models
# =======================


class ChangeInfo(Boto3Model):
    """
    A complex type that describes change information about changes made to your hosted
    zone.
    """

    Id: str
    """
This element contains an ID that you use when performing a
`GetChange <https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetChange.html>`_ action to get detailed
information about the change.
    """
    Status: Literal["PENDING", "INSYNC"]
    """
    The current state of the request.

    ``PENDING`` indicates that this request has not yet been applied to all Amazon Route
    53 DNS servers.
    """
    SubmittedAt: datetime
    """
The date and time that the change request was submitted in `ISO 8601 format <https://en.wikipedia.org/wiki/ISO_8601>`_ and
Coordinated Universal Time (UTC). For example, the value ``2017-03-27T17:48:16.751Z`` represents March 27, 2017 at
17:48:16.751 UTC.
    """
    Comment: str | None = None
    """
    A comment you can provide.
    """


class Route53DelegationSet(Boto3Model):
    """
    A complex type that lists the name servers in a delegation set, as well as the
    ``CallerReference`` and the ``ID`` for the delegation set.
    """

    Id: str | None = None
    """
    The ID that Amazon Route 53 assigns to a reusable delegation set.
    """
    CallerReference: str | None = None
    """
    The value that you specified for ``CallerReference`` when you created the reusable
    delegation set.
    """
    NameServers: List[str]
    """
    A complex type that contains a list of the authoritative name servers for a hosted
    zone or for a reusable delegation set.
    """


class CreateHostedZoneResponse(Boto3Model):
    """
    A complex type containing the response information for the hosted zone.
    """

    HostedZone: "HostedZone"
    """
    A complex type that contains general information about the hosted zone.
    """
    ChangeInfo: "ChangeInfo"
    """
    A complex type that contains information about the ``CreateHostedZone`` request.
    """
    DelegationSet: Route53DelegationSet
    """
    A complex type that describes the name servers for this hosted zone.
    """
    VPC: Route53VPC | None = None
    """
    A complex type that contains information about an Amazon VPC that you associated
    with this hosted zone.
    """
    Location: str
    """
    The unique URL representing the new hosted zone.
    """


class DeleteHostedZoneResponse(Boto3Model):
    """
    A complex type that contains the response to a ``DeleteHostedZone`` request.
    """

    ChangeInfo: "ChangeInfo"
    """
    A complex type that contains the ID, the status, and the date and time of a request
    to delete a hosted zone.
    """


class GetHostedZoneResponse(Boto3Model):
    """
    A complex type that contain the response to a ``GetHostedZone`` request.
    """

    HostedZone: "HostedZone"
    """
    A complex type that contains general information about the specified hosted zone.
    """
    DelegationSet: Route53DelegationSet | None = None
    """
    A complex type that lists the Amazon Route 53 name servers for the specified hosted
    zone.
    """
    VPCs: List["Route53VPC"] | None = None
    """
    A complex type that contains information about the VPCs that are associated with the
    specified hosted zone.
    """


class ListHostedZonesResponse(Boto3Model):
    Marker: str | None = None
    """
    For the second and subsequent calls to ``ListHostedZones``, ``Marker`` is the value
    that you specified for the ``marker`` parameter in the request that produced the
    current response.
    """
    HostedZones: List["HostedZone"]
    """
    A complex type that contains general information about the hosted zone.
    """
    IsTruncated: bool
    """
    A flag indicating whether there are more hosted zones to be listed.

    If the response was truncated, you can get more
    hosted zones by submitting another ``ListHostedZones`` request and specifying the value of ``NextMarker`` in the
    ``marker`` parameter.
    """
    NextMarker: str | None = None
    """
    If ``IsTruncated`` is ``true``, the value of ``NextMarker`` identifies the first
    hosted zone in the next group of hosted zones.

    Submit another ``ListHostedZones`` request, and specify the value of ``NextMarker`` from the response in the
    ``marker`` parameter.
    """
    MaxItems: str
    """
    The value that you specified for the ``maxitems`` parameter in the call to
    ``ListHostedZones`` that produced the current response.
    """


class ListResourceRecordSetsResponse(Boto3Model):
    """
    A complex type that contains list information for the resource record set.
    """

    ResourceRecordSets: List["Route53ResourceRecordSet"]
    """
    Information about multiple resource record sets.
    """
    IsTruncated: bool
    """
    A flag that indicates whether more resource record sets remain to be listed.

    If your results were truncated, you can
    make a follow-up pagination request by using the ``NextRecordName`` element.
    """
    NextRecordName: str | None = None
    """
    If the results were truncated, the name of the next record in the list.
    """
    NextRecordType: Literal["SOA", "A", "TXT", "NS", "CNAME", "MX", "NAPTR", "PTR", "SRV", "SPF", "AAAA", "CAA", "DS", "TLSA", "SSHFP", "SVCB", "HTTPS"] | None = None
    """
    If the results were truncated, the type of the next record in the list.
    """
    NextRecordIdentifier: str | None = None
    """
    *Resource record sets that have a routing policy other than simple:* If results were
    truncated for a given DNS name and type, the value of ``SetIdentifier`` for the next
    resource record set that has the current DNS name and type.
    """
    MaxItems: str
    """
    The maximum number of records you requested.
    """


class ListHostedZonesByNameResponse(Boto3Model):
    """
    A complex type that contains the response information for the request.
    """

    HostedZones: List["HostedZone"]
    """
    A complex type that contains general information about the hosted zone.
    """
    DNSName: str | None = None
    """
    For the second and subsequent calls to ``ListHostedZonesByName``, ``DNSName`` is the
    value that you specified for the ``dnsname`` parameter in the request that produced
    the current response.
    """
    HostedZoneId: str | None = None
    """
    The ID that Amazon Route 53 assigned to the hosted zone when you created it.
    """
    IsTruncated: bool
    """
    A flag that indicates whether there are more hosted zones to be listed.

    If the response was truncated, you can get the
    next group of ``maxitems`` hosted zones by calling ``ListHostedZonesByName`` again and specifying the values of
    ``NextDNSName`` and ``NextHostedZoneId`` elements in the ``dnsname`` and ``hostedzoneid`` parameters.
    """
    NextDNSName: str | None = None
    """
    If ``IsTruncated`` is true, the value of ``NextDNSName`` is the name of the first
    hosted zone in the next group of ``maxitems`` hosted zones.

    Call ``ListHostedZonesByName`` again and specify the value of ``NextDNSName`` and
    ``NextHostedZoneId`` in the ``dnsname`` and ``hostedzoneid`` parameters, respectively.
    """
    NextHostedZoneId: str | None = None
    """
    If ``IsTruncated`` is ``true``, the value of ``NextHostedZoneId`` identifies the
    first hosted zone in the next group of ``maxitems`` hosted zones.

    Call ``ListHostedZonesByName`` again and specify the value of ``NextDNSName`` and
    ``NextHostedZoneId`` in the ``dnsname`` and ``hostedzoneid`` parameters, respectively.
    """
    MaxItems: str
    """
    The value that you specified for the ``maxitems`` parameter in the call to
    ``ListHostedZonesByName`` that produced the current response.
    """


class UpdateHostedZoneCommentResponse(Boto3Model):
    """
    A complex type that contains the response to the ``UpdateHostedZoneComment``
    request.
    """

    HostedZone: "HostedZone"
    """
    A complex type that contains the response to the ``UpdateHostedZoneComment``
    request.
    """


class GetHostedZoneCountResponse(Boto3Model):
    """
    A complex type that contains the response to a ``GetHostedZoneCount`` request.
    """

    HostedZoneCount: int
    """
    The total number of public and private hosted zones that are associated with the
    current Amazon Web Services account.
    """


class HostedZoneLimit(Boto3Model):
    """
    A complex type that contains the type of limit that you specified in the request and
    the current value for that limit.
    """

    Type: Literal["MAX_RRSETS_BY_ZONE", "MAX_VPCS_ASSOCIATED_BY_ZONE"]
    """
    The limit that you requested.

    Valid values include the following:
    """
    Value: int
    """
    The current value for the limit that is specified by ``Type``.
    """


class GetHostedZoneLimitResponse(Boto3Model):
    """
    A complex type that contains the requested limit.
    """

    Limit: HostedZoneLimit
    """
    The current setting for the specified limit.

    For example, if you specified ``MAX_RRSETS_BY_ZONE`` for the value of
    ``Type`` in the request, the value of ``Limit`` is the maximum number of records that you can create in the specified
    hosted zone.
    """
    Count: int
    """
    The current number of entities that you have created of the specified type.

    For example, if you specified
    ``MAX_RRSETS_BY_ZONE`` for the value of ``Type`` in the request, the value of ``Count`` is the current number of records
    that you have created in the specified hosted zone.
    """


class AssociateVPCWithHostedZoneResponse(Boto3Model):
    """
    A complex type that contains the response information for the
    ``AssociateVPCWithHostedZone`` request.
    """

    ChangeInfo: "ChangeInfo"
    """
    A complex type that describes the changes made to your hosted zone.
    """


class DisassociateVPCFromHostedZoneResponse(Boto3Model):
    """
    A complex type that contains the response information for the disassociate request.
    """

    ChangeInfo: "ChangeInfo"
    """
    A complex type that describes the changes made to the specified private hosted zone.
    """


class HostedZoneOwner(Boto3Model):
    """
    A complex type that identifies a hosted zone that a specified Amazon VPC is
    associated with and the owner of the hosted zone.

    If there is a value for ``OwningAccount``, there is no value for ``OwningService``, and vice versa.
    """

    OwningAccount: str | None = None
    """
    If the hosted zone was created by an Amazon Web Services account, or was created by
    an Amazon Web Services service that creates hosted zones using the current account,
    ``OwningAccount`` contains the account ID of that account.

    For example, when you use Cloud Map to create a hosted zone, Cloud Map creates the
    hosted zone using the current Amazon Web Services account.
    """
    OwningService: str | None = None
    """
    If an Amazon Web Services service uses its own account to create a hosted zone and
    associate the specified VPC with that hosted zone, ``OwningService`` contains an
    abbreviation that identifies the service.

    For example, if Amazon Elastic File
    System (Amazon EFS) created a hosted zone and associated a VPC with the hosted zone, the value of ``OwningService`` is
    ``efs.amazonaws.com``.
    """


class HostedZoneSummary(Boto3Model):
    """
    In the response to a ``ListHostedZonesByVPC`` request, the ``HostedZoneSummaries``
    element contains one ``HostedZoneSummary`` element for each hosted zone that the
    specified Amazon VPC is associated with.

    Each
    ``HostedZoneSummary`` element contains the hosted zone name and ID, and information about who owns the hosted zone.
    """

    HostedZoneId: str
    """
    The Route 53 hosted zone ID of a private hosted zone that the specified VPC is
    associated with.
    """
    Name: str
    """
    The name of the private hosted zone, such as ``example.com``.
    """
    Owner: HostedZoneOwner
    """
    The owner of a private hosted zone that the specified VPC is associated with.

    The owner can be either an Amazon Web Services account or an Amazon Web Services
    service.
    """


class ListHostedZonesByVPCResponse(Boto3Model):
    HostedZoneSummaries: List["HostedZoneSummary"]
    """
    A list that contains one ``HostedZoneSummary`` element for each hosted zone that the
    specified Amazon VPC is associated with.

    Each ``HostedZoneSummary`` element contains the hosted zone name and ID, and information about who owns the hosted
    zone.
    """
    MaxItems: str
    """
    The value that you specified for ``MaxItems`` in the most recent
    ``ListHostedZonesByVPC`` request.
    """
    NextToken: str | None = None
    """
    The value that you will use for ``NextToken`` in the next ``ListHostedZonesByVPC``
    request.
    """


class ListVPCAssociationAuthorizationsResponse(Boto3Model):
    """
    A complex type that contains the response information for the request.
    """

    HostedZoneId: str
    """
    The ID of the hosted zone that you can associate the listed VPCs with.
    """
    NextToken: str | None = None
    """
    When the response includes a ``NextToken`` element, there are more VPCs that can be
    associated with the specified hosted zone.

    To get the next page of VPCs, submit another ``ListVPCAssociationAuthorizations`` request, and include the value
    of the ``NextToken`` element from the response in the ``nexttoken`` request parameter.
    """
    VPCs: List["Route53VPC"]
    """
    The list of VPCs that are authorized to be associated with the specified hosted
    zone.
    """


class CreateVPCAssociationAuthorizationResponse(Boto3Model):
    """
    A complex type that contains the response information from a
    ``CreateVPCAssociationAuthorization`` request.
    """

    HostedZoneId: str
    """
    The ID of the hosted zone that you authorized associating a VPC with.
    """
    VPC: Route53VPC
    """
    The VPC that you authorized associating with a hosted zone.
    """


class DeleteVPCAssociationAuthorizationResponse(Boto3Model):
    """
    Empty response for the request.
    """



class CreateCidrCollectionResponse(Boto3Model):
    Collection: Route53CidrCollection | None = None
    """
    A complex type that contains information about the CIDR collection.
    """
    Location: str | None = None
    """
    A unique URL that represents the location for the CIDR collection.
    """


class DeleteCidrCollectionResponse(Boto3Model):
    pass


class CollectionSummary(Boto3Model):
    """A complex type that is an entry in an
    `CidrCollection <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CidrCollection.html>`_ array.
    """

    Arn: str | None = None
    """
    The ARN of the collection summary.

    Can be used to reference the collection in IAM policy or cross-account.
    """
    Id: str | None = None
    """
    Unique ID for the CIDR collection.
    """
    Name: str | None = None
    """
    The name of a CIDR collection.
    """
    Version: int | None = None
    """
    A sequential counter that Route 53 sets to 1 when you create a CIDR collection and
    increments by 1 each time you update settings for the CIDR collection.
    """


class ListCidrCollectionsResponse(Boto3Model):
    NextToken: str | None = None
    """
    An opaque pagination token to indicate where the service is to begin enumerating
    results.
    """
    CidrCollections: List["CollectionSummary"] | None = None
    """
    A complex type with information about the CIDR collection.
    """


class CidrCollectionChange(Boto3Model):
    """
    A complex type that contains information about the CIDR collection change.
    """

    LocationName: str
    """
    Name of the location that is associated with the CIDR collection.
    """
    Action: Literal["PUT", "DELETE_IF_EXISTS"]
    """
    CIDR collection change action.
    """
    CidrList: List[str]
    """
    List of CIDR blocks.
    """


class ChangeCidrCollectionResponse(Boto3Model):
    Id: str
    """
    The ID that is returned by ``ChangeCidrCollection``.

    You can use it as input to ``GetChange`` to see if a CIDR
    collection change has propagated or not.
    """


class ListCidrBlocksResponse(Boto3Model):
    NextToken: str | None = None
    """
    An opaque pagination token to indicate where the service is to begin enumerating
    results.
    """
    CidrBlocks: List["CidrBlockSummary"] | None = None
    """
    A complex type that contains information about the CIDR blocks.
    """


class CreateQueryLoggingConfigResponse(Boto3Model):
    QueryLoggingConfig: Route53QueryLoggingConfig
    """
    A complex type that contains the ID for a query logging configuration, the ID of the
    hosted zone that you want to log queries for, and the ARN for the log group that you
    want Amazon Route 53 to send query logs to.
    """
    Location: str
    """
    The unique URL representing the new query logging configuration.
    """


class DeleteQueryLoggingConfigResponse(Boto3Model):
    pass


class GetQueryLoggingConfigResponse(Boto3Model):
    QueryLoggingConfig: Route53QueryLoggingConfig
    """
A complex type that contains information about the query logging configuration that you specified in a
`GetQueryLoggingConfig <https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetQueryLoggingConfig.html>`_ request.
    """


class ListQueryLoggingConfigsResponse(Boto3Model):
    QueryLoggingConfigs: List["Route53QueryLoggingConfig"]
    """
An array that contains one
`QueryLoggingConfig <https://docs.aws.amazon.com/Route53/latest/APIReference/API_QueryLoggingConfig.html>`_ element for
each configuration for DNS query logging that is associated with the current Amazon Web Services account.
    """
    NextToken: str | None = None
    """
    If a response includes the last of the query logging configurations that are
    associated with the current Amazon Web Services account, ``NextToken`` doesn't
    appear in the response.
    """


class Change(Boto3Model):
    """
    The information for each resource record set that you want to change.
    """

    Action: Literal["CREATE", "DELETE", "UPSERT"]
    """
The action to perform:
    """
    ResourceRecordSet: Route53ResourceRecordSet
    """
    Information about the resource record set to create, delete, or update.
    """


class ChangeBatch(Boto3Model):
    """
    The information for a change request.
    """

    Comment: str | None = None
    """
    *Optional:* Any comments you want to include about a change batch request.
    """
    Changes: List["Change"]
    """
    Information about the changes to make to the record sets.
    """


class ChangeResourceRecordSetsResponse(Boto3Model):
    """
    A complex type containing the response for the request.
    """

    ChangeInfo: "ChangeInfo"
    """
    A complex type that contains information about changes made to your hosted zone.
    """
