module Stratosphere.KMS.Alias (
        Alias(..), mkAlias
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Alias
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html>
    Alias {Alias -> ()
haddock_workaround_ :: (),
           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html#cfn-kms-alias-aliasname>
           Alias -> Value Text
aliasName :: (Value Prelude.Text),
           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html#cfn-kms-alias-targetkeyid>
           Alias -> Value Text
targetKeyId :: (Value Prelude.Text)}
  deriving stock (Alias -> Alias -> Bool
(Alias -> Alias -> Bool) -> (Alias -> Alias -> Bool) -> Eq Alias
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Alias -> Alias -> Bool
== :: Alias -> Alias -> Bool
$c/= :: Alias -> Alias -> Bool
/= :: Alias -> Alias -> Bool
Prelude.Eq, Int -> Alias -> ShowS
[Alias] -> ShowS
Alias -> String
(Int -> Alias -> ShowS)
-> (Alias -> String) -> ([Alias] -> ShowS) -> Show Alias
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Alias -> ShowS
showsPrec :: Int -> Alias -> ShowS
$cshow :: Alias -> String
show :: Alias -> String
$cshowList :: [Alias] -> ShowS
showList :: [Alias] -> ShowS
Prelude.Show)
mkAlias :: Value Prelude.Text -> Value Prelude.Text -> Alias
mkAlias :: Value Text -> Value Text -> Alias
mkAlias Value Text
aliasName Value Text
targetKeyId
  = Alias
      {haddock_workaround_ :: ()
haddock_workaround_ = (), aliasName :: Value Text
aliasName = Value Text
aliasName,
       targetKeyId :: Value Text
targetKeyId = Value Text
targetKeyId}
instance ToResourceProperties Alias where
  toResourceProperties :: Alias -> ResourceProperties
toResourceProperties Alias {()
Value Text
haddock_workaround_ :: Alias -> ()
aliasName :: Alias -> Value Text
targetKeyId :: Alias -> Value Text
haddock_workaround_ :: ()
aliasName :: Value Text
targetKeyId :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::KMS::Alias", supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Key
"AliasName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
aliasName,
                       Key
"TargetKeyId" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
targetKeyId]}
instance JSON.ToJSON Alias where
  toJSON :: Alias -> Value
toJSON Alias {()
Value Text
haddock_workaround_ :: Alias -> ()
aliasName :: Alias -> Value Text
targetKeyId :: Alias -> Value Text
haddock_workaround_ :: ()
aliasName :: Value Text
targetKeyId :: Value Text
..}
    = [(Key, Value)] -> Value
JSON.object
        [Key
"AliasName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
aliasName, Key
"TargetKeyId" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
targetKeyId]
instance Property "AliasName" Alias where
  type PropertyType "AliasName" Alias = Value Prelude.Text
  set :: PropertyType "AliasName" Alias -> Alias -> Alias
set PropertyType "AliasName" Alias
newValue Alias {()
Value Text
haddock_workaround_ :: Alias -> ()
aliasName :: Alias -> Value Text
targetKeyId :: Alias -> Value Text
haddock_workaround_ :: ()
aliasName :: Value Text
targetKeyId :: Value Text
..} = Alias {aliasName :: Value Text
aliasName = PropertyType "AliasName" Alias
Value Text
newValue, ()
Value Text
haddock_workaround_ :: ()
targetKeyId :: Value Text
haddock_workaround_ :: ()
targetKeyId :: Value Text
..}
instance Property "TargetKeyId" Alias where
  type PropertyType "TargetKeyId" Alias = Value Prelude.Text
  set :: PropertyType "TargetKeyId" Alias -> Alias -> Alias
set PropertyType "TargetKeyId" Alias
newValue Alias {()
Value Text
haddock_workaround_ :: Alias -> ()
aliasName :: Alias -> Value Text
targetKeyId :: Alias -> Value Text
haddock_workaround_ :: ()
aliasName :: Value Text
targetKeyId :: Value Text
..} = Alias {targetKeyId :: Value Text
targetKeyId = PropertyType "TargetKeyId" Alias
Value Text
newValue, ()
Value Text
haddock_workaround_ :: ()
aliasName :: Value Text
haddock_workaround_ :: ()
aliasName :: Value Text
..}