"""Raw representations of every data type in the AWS KMS service.

See Also:
    `AWS developer guide for KMS
    <https://docs.aws.amazon.com/kms/latest/developerguide/overview.html>`_

This file is automatically generated, and should not be directly edited.
"""

from attr import attrib
from attr import attrs

from ..core import ATTRSCONFIG
from ..core import Resource
from ..core import ResourceProperties
from ..core import create_object_converter

__all__ = [
    "Alias",
    "AliasProperties",
    "Key",
    "KeyProperties",
]


@attrs(**ATTRSCONFIG)
class AliasProperties(ResourceProperties):
    AliasName = attrib(default=None)
    TargetKeyId = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Alias(Resource):
    """A Alias for KMS.

    See Also:
        `AWS Cloud Formation documentation for Alias
        <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html>`_
    """

    RESOURCE_TYPE = "AWS::KMS::Alias"

    Properties: AliasProperties = attrib(
        factory=AliasProperties,
        converter=create_object_converter(AliasProperties),
    )


@attrs(**ATTRSCONFIG)
class KeyProperties(ResourceProperties):
    Description = attrib(default=None)
    Enabled = attrib(default=None)
    EnableKeyRotation = attrib(default=None)
    KeyPolicy = attrib(default=None)
    KeyUsage = attrib(default=None)
    PendingWindowInDays = attrib(default=None)
    Tags = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Key(Resource):
    """A Key for KMS.

    See Also:
        `AWS Cloud Formation documentation for Key
        <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html>`_
    """

    RESOURCE_TYPE = "AWS::KMS::Key"

    Properties: KeyProperties = attrib(
        factory=KeyProperties,
        converter=create_object_converter(KeyProperties),
    )
