module Stratosphere.Config.AggregationAuthorization (
        AggregationAuthorization(..), mkAggregationAuthorization
    ) 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 AggregationAuthorization
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-aggregationauthorization.html>
    AggregationAuthorization {AggregationAuthorization -> ()
haddock_workaround_ :: (),
                              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-aggregationauthorization.html#cfn-config-aggregationauthorization-authorizedaccountid>
                              AggregationAuthorization -> Value Text
authorizedAccountId :: (Value Prelude.Text),
                              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-aggregationauthorization.html#cfn-config-aggregationauthorization-authorizedawsregion>
                              AggregationAuthorization -> Value Text
authorizedAwsRegion :: (Value Prelude.Text),
                              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-aggregationauthorization.html#cfn-config-aggregationauthorization-tags>
                              AggregationAuthorization -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (AggregationAuthorization -> AggregationAuthorization -> Bool
(AggregationAuthorization -> AggregationAuthorization -> Bool)
-> (AggregationAuthorization -> AggregationAuthorization -> Bool)
-> Eq AggregationAuthorization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AggregationAuthorization -> AggregationAuthorization -> Bool
== :: AggregationAuthorization -> AggregationAuthorization -> Bool
$c/= :: AggregationAuthorization -> AggregationAuthorization -> Bool
/= :: AggregationAuthorization -> AggregationAuthorization -> Bool
Prelude.Eq, Int -> AggregationAuthorization -> ShowS
[AggregationAuthorization] -> ShowS
AggregationAuthorization -> String
(Int -> AggregationAuthorization -> ShowS)
-> (AggregationAuthorization -> String)
-> ([AggregationAuthorization] -> ShowS)
-> Show AggregationAuthorization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AggregationAuthorization -> ShowS
showsPrec :: Int -> AggregationAuthorization -> ShowS
$cshow :: AggregationAuthorization -> String
show :: AggregationAuthorization -> String
$cshowList :: [AggregationAuthorization] -> ShowS
showList :: [AggregationAuthorization] -> ShowS
Prelude.Show)
mkAggregationAuthorization ::
  Value Prelude.Text
  -> Value Prelude.Text -> AggregationAuthorization
mkAggregationAuthorization :: Value Text -> Value Text -> AggregationAuthorization
mkAggregationAuthorization Value Text
authorizedAccountId Value Text
authorizedAwsRegion
  = AggregationAuthorization
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       authorizedAccountId :: Value Text
authorizedAccountId = Value Text
authorizedAccountId,
       authorizedAwsRegion :: Value Text
authorizedAwsRegion = Value Text
authorizedAwsRegion, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties AggregationAuthorization where
  toResourceProperties :: AggregationAuthorization -> ResourceProperties
toResourceProperties AggregationAuthorization {Maybe [Tag]
()
Value Text
haddock_workaround_ :: AggregationAuthorization -> ()
authorizedAccountId :: AggregationAuthorization -> Value Text
authorizedAwsRegion :: AggregationAuthorization -> Value Text
tags :: AggregationAuthorization -> Maybe [Tag]
haddock_workaround_ :: ()
authorizedAccountId :: Value Text
authorizedAwsRegion :: Value Text
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Config::AggregationAuthorization",
         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
"AuthorizedAccountId" 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
authorizedAccountId,
                            Key
"AuthorizedAwsRegion" 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
authorizedAwsRegion]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [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 AggregationAuthorization where
  toJSON :: AggregationAuthorization -> Value
toJSON AggregationAuthorization {Maybe [Tag]
()
Value Text
haddock_workaround_ :: AggregationAuthorization -> ()
authorizedAccountId :: AggregationAuthorization -> Value Text
authorizedAwsRegion :: AggregationAuthorization -> Value Text
tags :: AggregationAuthorization -> Maybe [Tag]
haddock_workaround_ :: ()
authorizedAccountId :: Value Text
authorizedAwsRegion :: Value Text
tags :: Maybe [Tag]
..}
    = [(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
"AuthorizedAccountId" 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
authorizedAccountId,
               Key
"AuthorizedAwsRegion" 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
authorizedAwsRegion]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [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 "AuthorizedAccountId" AggregationAuthorization where
  type PropertyType "AuthorizedAccountId" AggregationAuthorization = Value Prelude.Text
  set :: PropertyType "AuthorizedAccountId" AggregationAuthorization
-> AggregationAuthorization -> AggregationAuthorization
set PropertyType "AuthorizedAccountId" AggregationAuthorization
newValue AggregationAuthorization {Maybe [Tag]
()
Value Text
haddock_workaround_ :: AggregationAuthorization -> ()
authorizedAccountId :: AggregationAuthorization -> Value Text
authorizedAwsRegion :: AggregationAuthorization -> Value Text
tags :: AggregationAuthorization -> Maybe [Tag]
haddock_workaround_ :: ()
authorizedAccountId :: Value Text
authorizedAwsRegion :: Value Text
tags :: Maybe [Tag]
..}
    = AggregationAuthorization {authorizedAccountId :: Value Text
authorizedAccountId = PropertyType "AuthorizedAccountId" AggregationAuthorization
Value Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
authorizedAwsRegion :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
authorizedAwsRegion :: Value Text
tags :: Maybe [Tag]
..}
instance Property "AuthorizedAwsRegion" AggregationAuthorization where
  type PropertyType "AuthorizedAwsRegion" AggregationAuthorization = Value Prelude.Text
  set :: PropertyType "AuthorizedAwsRegion" AggregationAuthorization
-> AggregationAuthorization -> AggregationAuthorization
set PropertyType "AuthorizedAwsRegion" AggregationAuthorization
newValue AggregationAuthorization {Maybe [Tag]
()
Value Text
haddock_workaround_ :: AggregationAuthorization -> ()
authorizedAccountId :: AggregationAuthorization -> Value Text
authorizedAwsRegion :: AggregationAuthorization -> Value Text
tags :: AggregationAuthorization -> Maybe [Tag]
haddock_workaround_ :: ()
authorizedAccountId :: Value Text
authorizedAwsRegion :: Value Text
tags :: Maybe [Tag]
..}
    = AggregationAuthorization {authorizedAwsRegion :: Value Text
authorizedAwsRegion = PropertyType "AuthorizedAwsRegion" AggregationAuthorization
Value Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
authorizedAccountId :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
authorizedAccountId :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Tags" AggregationAuthorization where
  type PropertyType "Tags" AggregationAuthorization = [Tag]
  set :: PropertyType "Tags" AggregationAuthorization
-> AggregationAuthorization -> AggregationAuthorization
set PropertyType "Tags" AggregationAuthorization
newValue AggregationAuthorization {Maybe [Tag]
()
Value Text
haddock_workaround_ :: AggregationAuthorization -> ()
authorizedAccountId :: AggregationAuthorization -> Value Text
authorizedAwsRegion :: AggregationAuthorization -> Value Text
tags :: AggregationAuthorization -> Maybe [Tag]
haddock_workaround_ :: ()
authorizedAccountId :: Value Text
authorizedAwsRegion :: Value Text
tags :: Maybe [Tag]
..}
    = AggregationAuthorization {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" AggregationAuthorization
newValue, ()
Value Text
haddock_workaround_ :: ()
authorizedAccountId :: Value Text
authorizedAwsRegion :: Value Text
haddock_workaround_ :: ()
authorizedAccountId :: Value Text
authorizedAwsRegion :: Value Text
..}