module Stratosphere.WAFv2.IPSet (
        IPSet(..), mkIPSet
    ) 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 IPSet
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html>
    IPSet {IPSet -> ()
haddock_workaround_ :: (),
           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html#cfn-wafv2-ipset-addresses>
           IPSet -> ValueList Text
addresses :: (ValueList Prelude.Text),
           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html#cfn-wafv2-ipset-description>
           IPSet -> Maybe (Value Text)
description :: (Prelude.Maybe (Value Prelude.Text)),
           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html#cfn-wafv2-ipset-ipaddressversion>
           IPSet -> Value Text
iPAddressVersion :: (Value Prelude.Text),
           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html#cfn-wafv2-ipset-name>
           IPSet -> Maybe (Value Text)
name :: (Prelude.Maybe (Value Prelude.Text)),
           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html#cfn-wafv2-ipset-scope>
           IPSet -> Value Text
scope :: (Value Prelude.Text),
           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html#cfn-wafv2-ipset-tags>
           IPSet -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  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 ::
  ValueList Prelude.Text
  -> Value Prelude.Text -> Value Prelude.Text -> IPSet
mkIPSet :: ValueList Text -> Value Text -> Value Text -> IPSet
mkIPSet ValueList Text
addresses Value Text
iPAddressVersion Value Text
scope
  = IPSet
      {haddock_workaround_ :: ()
haddock_workaround_ = (), addresses :: ValueList Text
addresses = ValueList Text
addresses,
       iPAddressVersion :: Value Text
iPAddressVersion = Value Text
iPAddressVersion, scope :: Value Text
scope = Value Text
scope,
       description :: Maybe (Value Text)
description = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, name :: Maybe (Value Text)
name = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties IPSet where
  toResourceProperties :: IPSet -> ResourceProperties
toResourceProperties IPSet {Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: IPSet -> ()
addresses :: IPSet -> ValueList Text
description :: IPSet -> Maybe (Value Text)
iPAddressVersion :: IPSet -> Value Text
name :: IPSet -> Maybe (Value Text)
scope :: IPSet -> Value Text
tags :: IPSet -> Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::WAFv2::IPSet", 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
"Addresses" Key -> ValueList Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ValueList Text
addresses,
                            Key
"IPAddressVersion" 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
iPAddressVersion, Key
"Scope" 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
scope]
                           ([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
"Description" (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)
description,
                               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 -> [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 IPSet where
  toJSON :: IPSet -> Value
toJSON IPSet {Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: IPSet -> ()
addresses :: IPSet -> ValueList Text
description :: IPSet -> Maybe (Value Text)
iPAddressVersion :: IPSet -> Value Text
name :: IPSet -> Maybe (Value Text)
scope :: IPSet -> Value Text
tags :: IPSet -> Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: 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
"Addresses" Key -> ValueList Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ValueList Text
addresses,
               Key
"IPAddressVersion" 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
iPAddressVersion, Key
"Scope" 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
scope]
              ([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
"Description" (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)
description,
                  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 -> [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 "Addresses" IPSet where
  type PropertyType "Addresses" IPSet = ValueList Prelude.Text
  set :: PropertyType "Addresses" IPSet -> IPSet -> IPSet
set PropertyType "Addresses" IPSet
newValue IPSet {Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: IPSet -> ()
addresses :: IPSet -> ValueList Text
description :: IPSet -> Maybe (Value Text)
iPAddressVersion :: IPSet -> Value Text
name :: IPSet -> Maybe (Value Text)
scope :: IPSet -> Value Text
tags :: IPSet -> Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
..} = IPSet {addresses :: ValueList Text
addresses = PropertyType "Addresses" IPSet
ValueList Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Description" IPSet where
  type PropertyType "Description" IPSet = Value Prelude.Text
  set :: PropertyType "Description" IPSet -> IPSet -> IPSet
set PropertyType "Description" IPSet
newValue IPSet {Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: IPSet -> ()
addresses :: IPSet -> ValueList Text
description :: IPSet -> Maybe (Value Text)
iPAddressVersion :: IPSet -> Value Text
name :: IPSet -> Maybe (Value Text)
scope :: IPSet -> Value Text
tags :: IPSet -> Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
..}
    = IPSet {description :: Maybe (Value Text)
description = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Description" IPSet
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ()
addresses :: ValueList Text
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
..}
instance Property "IPAddressVersion" IPSet where
  type PropertyType "IPAddressVersion" IPSet = Value Prelude.Text
  set :: PropertyType "IPAddressVersion" IPSet -> IPSet -> IPSet
set PropertyType "IPAddressVersion" IPSet
newValue IPSet {Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: IPSet -> ()
addresses :: IPSet -> ValueList Text
description :: IPSet -> Maybe (Value Text)
iPAddressVersion :: IPSet -> Value Text
name :: IPSet -> Maybe (Value Text)
scope :: IPSet -> Value Text
tags :: IPSet -> Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
..} = IPSet {iPAddressVersion :: Value Text
iPAddressVersion = PropertyType "IPAddressVersion" IPSet
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
..}
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 [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: IPSet -> ()
addresses :: IPSet -> ValueList Text
description :: IPSet -> Maybe (Value Text)
iPAddressVersion :: IPSet -> Value Text
name :: IPSet -> Maybe (Value Text)
scope :: IPSet -> Value Text
tags :: IPSet -> Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
..} = IPSet {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" IPSet
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
scope :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
scope :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Scope" IPSet where
  type PropertyType "Scope" IPSet = Value Prelude.Text
  set :: PropertyType "Scope" IPSet -> IPSet -> IPSet
set PropertyType "Scope" IPSet
newValue IPSet {Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: IPSet -> ()
addresses :: IPSet -> ValueList Text
description :: IPSet -> Maybe (Value Text)
iPAddressVersion :: IPSet -> Value Text
name :: IPSet -> Maybe (Value Text)
scope :: IPSet -> Value Text
tags :: IPSet -> Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
..} = IPSet {scope :: Value Text
scope = PropertyType "Scope" IPSet
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Tags" IPSet where
  type PropertyType "Tags" IPSet = [Tag]
  set :: PropertyType "Tags" IPSet -> IPSet -> IPSet
set PropertyType "Tags" IPSet
newValue IPSet {Maybe [Tag]
Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: IPSet -> ()
addresses :: IPSet -> ValueList Text
description :: IPSet -> Maybe (Value Text)
iPAddressVersion :: IPSet -> Value Text
name :: IPSet -> Maybe (Value Text)
scope :: IPSet -> Value Text
tags :: IPSet -> Maybe [Tag]
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
tags :: Maybe [Tag]
..} = IPSet {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" IPSet
newValue, Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
haddock_workaround_ :: ()
addresses :: ValueList Text
description :: Maybe (Value Text)
iPAddressVersion :: Value Text
name :: Maybe (Value Text)
scope :: Value Text
..}