module Stratosphere.WAFRegional.IPSet (
        module Exports, IPSet(..), mkIPSet
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.WAFRegional.IPSet.IPSetDescriptorProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data IPSet
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafregional-ipset.html>
    IPSet {IPSet -> ()
haddock_workaround_ :: (),
           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafregional-ipset.html#cfn-wafregional-ipset-ipsetdescriptors>
           IPSet -> Maybe [IPSetDescriptorProperty]
iPSetDescriptors :: (Prelude.Maybe [IPSetDescriptorProperty]),
           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafregional-ipset.html#cfn-wafregional-ipset-name>
           IPSet -> Value Text
name :: (Value Prelude.Text)}
  deriving stock (IPSet -> IPSet -> Bool
(IPSet -> IPSet -> Bool) -> (IPSet -> IPSet -> Bool) -> Eq IPSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IPSet -> IPSet -> Bool
== :: IPSet -> IPSet -> Bool
$c/= :: IPSet -> IPSet -> Bool
/= :: IPSet -> IPSet -> Bool
Prelude.Eq, Int -> IPSet -> ShowS
[IPSet] -> ShowS
IPSet -> String
(Int -> IPSet -> ShowS)
-> (IPSet -> String) -> ([IPSet] -> ShowS) -> Show IPSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IPSet -> ShowS
showsPrec :: Int -> IPSet -> ShowS
$cshow :: IPSet -> String
show :: IPSet -> String
$cshowList :: [IPSet] -> ShowS
showList :: [IPSet] -> ShowS
Prelude.Show)
mkIPSet :: Value Prelude.Text -> IPSet
mkIPSet :: Value Text -> IPSet
mkIPSet Value Text
name
  = IPSet
      {haddock_workaround_ :: ()
haddock_workaround_ = (), name :: Value Text
name = Value Text
name,
       iPSetDescriptors :: Maybe [IPSetDescriptorProperty]
iPSetDescriptors = Maybe [IPSetDescriptorProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties IPSet where
  toResourceProperties :: IPSet -> ResourceProperties
toResourceProperties IPSet {Maybe [IPSetDescriptorProperty]
()
Value Text
haddock_workaround_ :: IPSet -> ()
iPSetDescriptors :: IPSet -> Maybe [IPSetDescriptorProperty]
name :: IPSet -> Value Text
haddock_workaround_ :: ()
iPSetDescriptors :: Maybe [IPSetDescriptorProperty]
name :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::WAFRegional::IPSet", supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         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
"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..= Value Text
name]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> [IPSetDescriptorProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"IPSetDescriptors" ([IPSetDescriptorProperty] -> (Key, Value))
-> Maybe [IPSetDescriptorProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [IPSetDescriptorProperty]
iPSetDescriptors]))}
instance JSON.ToJSON IPSet where
  toJSON :: IPSet -> Value
toJSON IPSet {Maybe [IPSetDescriptorProperty]
()
Value Text
haddock_workaround_ :: IPSet -> ()
iPSetDescriptors :: IPSet -> Maybe [IPSetDescriptorProperty]
name :: IPSet -> Value Text
haddock_workaround_ :: ()
iPSetDescriptors :: Maybe [IPSetDescriptorProperty]
name :: 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
"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..= Value Text
name]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> [IPSetDescriptorProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"IPSetDescriptors" ([IPSetDescriptorProperty] -> (Key, Value))
-> Maybe [IPSetDescriptorProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [IPSetDescriptorProperty]
iPSetDescriptors])))
instance Property "IPSetDescriptors" IPSet where
  type PropertyType "IPSetDescriptors" IPSet = [IPSetDescriptorProperty]
  set :: PropertyType "IPSetDescriptors" IPSet -> IPSet -> IPSet
set PropertyType "IPSetDescriptors" IPSet
newValue IPSet {Maybe [IPSetDescriptorProperty]
()
Value Text
haddock_workaround_ :: IPSet -> ()
iPSetDescriptors :: IPSet -> Maybe [IPSetDescriptorProperty]
name :: IPSet -> Value Text
haddock_workaround_ :: ()
iPSetDescriptors :: Maybe [IPSetDescriptorProperty]
name :: Value Text
..}
    = IPSet {iPSetDescriptors :: Maybe [IPSetDescriptorProperty]
iPSetDescriptors = [IPSetDescriptorProperty] -> Maybe [IPSetDescriptorProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [IPSetDescriptorProperty]
PropertyType "IPSetDescriptors" IPSet
newValue, ()
Value Text
haddock_workaround_ :: ()
name :: Value Text
haddock_workaround_ :: ()
name :: Value Text
..}
instance Property "Name" IPSet where
  type PropertyType "Name" IPSet = Value Prelude.Text
  set :: PropertyType "Name" IPSet -> IPSet -> IPSet
set PropertyType "Name" IPSet
newValue IPSet {Maybe [IPSetDescriptorProperty]
()
Value Text
haddock_workaround_ :: IPSet -> ()
iPSetDescriptors :: IPSet -> Maybe [IPSetDescriptorProperty]
name :: IPSet -> Value Text
haddock_workaround_ :: ()
iPSetDescriptors :: Maybe [IPSetDescriptorProperty]
name :: Value Text
..} = IPSet {name :: Value Text
name = PropertyType "Name" IPSet
Value Text
newValue, Maybe [IPSetDescriptorProperty]
()
haddock_workaround_ :: ()
iPSetDescriptors :: Maybe [IPSetDescriptorProperty]
haddock_workaround_ :: ()
iPSetDescriptors :: Maybe [IPSetDescriptorProperty]
..}