module Stratosphere.CloudTrail.Channel (
        module Exports, Channel(..), mkChannel
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.CloudTrail.Channel.DestinationProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Channel
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html>
    Channel {Channel -> ()
haddock_workaround_ :: (),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html#cfn-cloudtrail-channel-destinations>
             Channel -> Maybe [DestinationProperty]
destinations :: (Prelude.Maybe [DestinationProperty]),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html#cfn-cloudtrail-channel-name>
             Channel -> Maybe (Value Text)
name :: (Prelude.Maybe (Value Prelude.Text)),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html#cfn-cloudtrail-channel-source>
             Channel -> Maybe (Value Text)
source :: (Prelude.Maybe (Value Prelude.Text)),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html#cfn-cloudtrail-channel-tags>
             Channel -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (Channel -> Channel -> Bool
(Channel -> Channel -> Bool)
-> (Channel -> Channel -> Bool) -> Eq Channel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Channel -> Channel -> Bool
== :: Channel -> Channel -> Bool
$c/= :: Channel -> Channel -> Bool
/= :: Channel -> Channel -> Bool
Prelude.Eq, Int -> Channel -> ShowS
[Channel] -> ShowS
Channel -> String
(Int -> Channel -> ShowS)
-> (Channel -> String) -> ([Channel] -> ShowS) -> Show Channel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Channel -> ShowS
showsPrec :: Int -> Channel -> ShowS
$cshow :: Channel -> String
show :: Channel -> String
$cshowList :: [Channel] -> ShowS
showList :: [Channel] -> ShowS
Prelude.Show)
mkChannel :: Channel
mkChannel :: Channel
mkChannel
  = Channel
      {haddock_workaround_ :: ()
haddock_workaround_ = (), destinations :: Maybe [DestinationProperty]
destinations = Maybe [DestinationProperty]
forall a. Maybe a
Prelude.Nothing,
       name :: Maybe (Value Text)
name = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, source :: Maybe (Value Text)
source = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Channel where
  toResourceProperties :: Channel -> ResourceProperties
toResourceProperties Channel {Maybe [Tag]
Maybe [DestinationProperty]
Maybe (Value Text)
()
haddock_workaround_ :: Channel -> ()
destinations :: Channel -> Maybe [DestinationProperty]
name :: Channel -> Maybe (Value Text)
source :: Channel -> Maybe (Value Text)
tags :: Channel -> Maybe [Tag]
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
name :: Maybe (Value Text)
source :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudTrail::Channel", supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> [DestinationProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Destinations" ([DestinationProperty] -> (Key, Value))
-> Maybe [DestinationProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DestinationProperty]
destinations,
                            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
"Name" (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)
name,
                            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
"Source" (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)
source,
                            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 Channel where
  toJSON :: Channel -> Value
toJSON Channel {Maybe [Tag]
Maybe [DestinationProperty]
Maybe (Value Text)
()
haddock_workaround_ :: Channel -> ()
destinations :: Channel -> Maybe [DestinationProperty]
name :: Channel -> Maybe (Value Text)
source :: Channel -> Maybe (Value Text)
tags :: Channel -> Maybe [Tag]
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
name :: Maybe (Value Text)
source :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> [DestinationProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Destinations" ([DestinationProperty] -> (Key, Value))
-> Maybe [DestinationProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DestinationProperty]
destinations,
               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
"Name" (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)
name,
               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
"Source" (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)
source,
               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 "Destinations" Channel where
  type PropertyType "Destinations" Channel = [DestinationProperty]
  set :: PropertyType "Destinations" Channel -> Channel -> Channel
set PropertyType "Destinations" Channel
newValue Channel {Maybe [Tag]
Maybe [DestinationProperty]
Maybe (Value Text)
()
haddock_workaround_ :: Channel -> ()
destinations :: Channel -> Maybe [DestinationProperty]
name :: Channel -> Maybe (Value Text)
source :: Channel -> Maybe (Value Text)
tags :: Channel -> Maybe [Tag]
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
name :: Maybe (Value Text)
source :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = Channel {destinations :: Maybe [DestinationProperty]
destinations = [DestinationProperty] -> Maybe [DestinationProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [DestinationProperty]
PropertyType "Destinations" Channel
newValue, Maybe [Tag]
Maybe (Value Text)
()
haddock_workaround_ :: ()
name :: Maybe (Value Text)
source :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
name :: Maybe (Value Text)
source :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Name" Channel where
  type PropertyType "Name" Channel = Value Prelude.Text
  set :: PropertyType "Name" Channel -> Channel -> Channel
set PropertyType "Name" Channel
newValue Channel {Maybe [Tag]
Maybe [DestinationProperty]
Maybe (Value Text)
()
haddock_workaround_ :: Channel -> ()
destinations :: Channel -> Maybe [DestinationProperty]
name :: Channel -> Maybe (Value Text)
source :: Channel -> Maybe (Value Text)
tags :: Channel -> Maybe [Tag]
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
name :: Maybe (Value Text)
source :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = Channel {name :: Maybe (Value Text)
name = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Name" Channel
Value Text
newValue, Maybe [Tag]
Maybe [DestinationProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
source :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
source :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Source" Channel where
  type PropertyType "Source" Channel = Value Prelude.Text
  set :: PropertyType "Source" Channel -> Channel -> Channel
set PropertyType "Source" Channel
newValue Channel {Maybe [Tag]
Maybe [DestinationProperty]
Maybe (Value Text)
()
haddock_workaround_ :: Channel -> ()
destinations :: Channel -> Maybe [DestinationProperty]
name :: Channel -> Maybe (Value Text)
source :: Channel -> Maybe (Value Text)
tags :: Channel -> Maybe [Tag]
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
name :: Maybe (Value Text)
source :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = Channel {source :: Maybe (Value Text)
source = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Source" Channel
Value Text
newValue, Maybe [Tag]
Maybe [DestinationProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
name :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Tags" Channel where
  type PropertyType "Tags" Channel = [Tag]
  set :: PropertyType "Tags" Channel -> Channel -> Channel
set PropertyType "Tags" Channel
newValue Channel {Maybe [Tag]
Maybe [DestinationProperty]
Maybe (Value Text)
()
haddock_workaround_ :: Channel -> ()
destinations :: Channel -> Maybe [DestinationProperty]
name :: Channel -> Maybe (Value Text)
source :: Channel -> Maybe (Value Text)
tags :: Channel -> Maybe [Tag]
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
name :: Maybe (Value Text)
source :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = Channel {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" Channel
newValue, Maybe [DestinationProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
name :: Maybe (Value Text)
source :: Maybe (Value Text)
haddock_workaround_ :: ()
destinations :: Maybe [DestinationProperty]
name :: Maybe (Value Text)
source :: Maybe (Value Text)
..}