module Stratosphere.Logs.Destination (
        Destination(..), mkDestination
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Destination
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html>
    Destination {Destination -> ()
haddock_workaround_ :: (),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-destinationname>
                 Destination -> Value Text
destinationName :: (Value Prelude.Text),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-destinationpolicy>
                 Destination -> Maybe (Value Text)
destinationPolicy :: (Prelude.Maybe (Value Prelude.Text)),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-rolearn>
                 Destination -> Value Text
roleArn :: (Value Prelude.Text),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-tags>
                 Destination -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag]),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-targetarn>
                 Destination -> Value Text
targetArn :: (Value Prelude.Text)}
  deriving stock (Destination -> Destination -> Bool
(Destination -> Destination -> Bool)
-> (Destination -> Destination -> Bool) -> Eq Destination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Destination -> Destination -> Bool
== :: Destination -> Destination -> Bool
$c/= :: Destination -> Destination -> Bool
/= :: Destination -> Destination -> Bool
Prelude.Eq, Int -> Destination -> ShowS
[Destination] -> ShowS
Destination -> String
(Int -> Destination -> ShowS)
-> (Destination -> String)
-> ([Destination] -> ShowS)
-> Show Destination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Destination -> ShowS
showsPrec :: Int -> Destination -> ShowS
$cshow :: Destination -> String
show :: Destination -> String
$cshowList :: [Destination] -> ShowS
showList :: [Destination] -> ShowS
Prelude.Show)
mkDestination ::
  Value Prelude.Text
  -> Value Prelude.Text -> Value Prelude.Text -> Destination
mkDestination :: Value Text -> Value Text -> Value Text -> Destination
mkDestination Value Text
destinationName Value Text
roleArn Value Text
targetArn
  = Destination
      {haddock_workaround_ :: ()
haddock_workaround_ = (), destinationName :: Value Text
destinationName = Value Text
destinationName,
       roleArn :: Value Text
roleArn = Value Text
roleArn, targetArn :: Value Text
targetArn = Value Text
targetArn,
       destinationPolicy :: Maybe (Value Text)
destinationPolicy = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Destination where
  toResourceProperties :: Destination -> ResourceProperties
toResourceProperties Destination {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Destination -> ()
destinationName :: Destination -> Value Text
destinationPolicy :: Destination -> Maybe (Value Text)
roleArn :: Destination -> Value Text
tags :: Destination -> Maybe [Tag]
targetArn :: Destination -> Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Logs::Destination", supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"DestinationName" 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
destinationName,
                            Key
"RoleArn" 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
roleArn, Key
"TargetArn" 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
targetArn]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [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..=) Key
"DestinationPolicy" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
destinationPolicy,
                               Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON Destination where
  toJSON :: Destination -> Value
toJSON Destination {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Destination -> ()
destinationName :: Destination -> Value Text
destinationPolicy :: Destination -> Maybe (Value Text)
roleArn :: Destination -> Value Text
tags :: Destination -> Maybe [Tag]
targetArn :: Destination -> Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"DestinationName" 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
destinationName,
               Key
"RoleArn" 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
roleArn, Key
"TargetArn" 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
targetArn]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [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..=) Key
"DestinationPolicy" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
destinationPolicy,
                  Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "DestinationName" Destination where
  type PropertyType "DestinationName" Destination = Value Prelude.Text
  set :: PropertyType "DestinationName" Destination
-> Destination -> Destination
set PropertyType "DestinationName" Destination
newValue Destination {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Destination -> ()
destinationName :: Destination -> Value Text
destinationPolicy :: Destination -> Maybe (Value Text)
roleArn :: Destination -> Value Text
tags :: Destination -> Maybe [Tag]
targetArn :: Destination -> Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
..}
    = Destination {destinationName :: Value Text
destinationName = PropertyType "DestinationName" Destination
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
haddock_workaround_ :: ()
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
..}
instance Property "DestinationPolicy" Destination where
  type PropertyType "DestinationPolicy" Destination = Value Prelude.Text
  set :: PropertyType "DestinationPolicy" Destination
-> Destination -> Destination
set PropertyType "DestinationPolicy" Destination
newValue Destination {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Destination -> ()
destinationName :: Destination -> Value Text
destinationPolicy :: Destination -> Maybe (Value Text)
roleArn :: Destination -> Value Text
tags :: Destination -> Maybe [Tag]
targetArn :: Destination -> Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
..}
    = Destination {destinationPolicy :: Maybe (Value Text)
destinationPolicy = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "DestinationPolicy" Destination
Value Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
..}
instance Property "RoleArn" Destination where
  type PropertyType "RoleArn" Destination = Value Prelude.Text
  set :: PropertyType "RoleArn" Destination -> Destination -> Destination
set PropertyType "RoleArn" Destination
newValue Destination {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Destination -> ()
destinationName :: Destination -> Value Text
destinationPolicy :: Destination -> Maybe (Value Text)
roleArn :: Destination -> Value Text
tags :: Destination -> Maybe [Tag]
targetArn :: Destination -> Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
..}
    = Destination {roleArn :: Value Text
roleArn = PropertyType "RoleArn" Destination
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
tags :: Maybe [Tag]
targetArn :: Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
tags :: Maybe [Tag]
targetArn :: Value Text
..}
instance Property "Tags" Destination where
  type PropertyType "Tags" Destination = [Tag]
  set :: PropertyType "Tags" Destination -> Destination -> Destination
set PropertyType "Tags" Destination
newValue Destination {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Destination -> ()
destinationName :: Destination -> Value Text
destinationPolicy :: Destination -> Maybe (Value Text)
roleArn :: Destination -> Value Text
tags :: Destination -> Maybe [Tag]
targetArn :: Destination -> Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
..}
    = Destination {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" Destination
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
targetArn :: Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
targetArn :: Value Text
..}
instance Property "TargetArn" Destination where
  type PropertyType "TargetArn" Destination = Value Prelude.Text
  set :: PropertyType "TargetArn" Destination -> Destination -> Destination
set PropertyType "TargetArn" Destination
newValue Destination {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Destination -> ()
destinationName :: Destination -> Value Text
destinationPolicy :: Destination -> Maybe (Value Text)
roleArn :: Destination -> Value Text
tags :: Destination -> Maybe [Tag]
targetArn :: Destination -> Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
targetArn :: Value Text
..}
    = Destination {targetArn :: Value Text
targetArn = PropertyType "TargetArn" Destination
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
destinationName :: Value Text
destinationPolicy :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
..}