module Stratosphere.CloudFront.Distribution.GeoRestrictionProperty (
GeoRestrictionProperty(..), mkGeoRestrictionProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data GeoRestrictionProperty
=
GeoRestrictionProperty {GeoRestrictionProperty -> ()
haddock_workaround_ :: (),
GeoRestrictionProperty -> Maybe (ValueList Text)
locations :: (Prelude.Maybe (ValueList Prelude.Text)),
GeoRestrictionProperty -> Value Text
restrictionType :: (Value Prelude.Text)}
deriving stock (GeoRestrictionProperty -> GeoRestrictionProperty -> Bool
(GeoRestrictionProperty -> GeoRestrictionProperty -> Bool)
-> (GeoRestrictionProperty -> GeoRestrictionProperty -> Bool)
-> Eq GeoRestrictionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GeoRestrictionProperty -> GeoRestrictionProperty -> Bool
== :: GeoRestrictionProperty -> GeoRestrictionProperty -> Bool
$c/= :: GeoRestrictionProperty -> GeoRestrictionProperty -> Bool
/= :: GeoRestrictionProperty -> GeoRestrictionProperty -> Bool
Prelude.Eq, Int -> GeoRestrictionProperty -> ShowS
[GeoRestrictionProperty] -> ShowS
GeoRestrictionProperty -> String
(Int -> GeoRestrictionProperty -> ShowS)
-> (GeoRestrictionProperty -> String)
-> ([GeoRestrictionProperty] -> ShowS)
-> Show GeoRestrictionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GeoRestrictionProperty -> ShowS
showsPrec :: Int -> GeoRestrictionProperty -> ShowS
$cshow :: GeoRestrictionProperty -> String
show :: GeoRestrictionProperty -> String
$cshowList :: [GeoRestrictionProperty] -> ShowS
showList :: [GeoRestrictionProperty] -> ShowS
Prelude.Show)
mkGeoRestrictionProperty ::
Value Prelude.Text -> GeoRestrictionProperty
mkGeoRestrictionProperty :: Value Text -> GeoRestrictionProperty
mkGeoRestrictionProperty Value Text
restrictionType
= GeoRestrictionProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), restrictionType :: Value Text
restrictionType = Value Text
restrictionType,
locations :: Maybe (ValueList Text)
locations = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties GeoRestrictionProperty where
toResourceProperties :: GeoRestrictionProperty -> ResourceProperties
toResourceProperties GeoRestrictionProperty {Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: GeoRestrictionProperty -> ()
locations :: GeoRestrictionProperty -> Maybe (ValueList Text)
restrictionType :: GeoRestrictionProperty -> Value Text
haddock_workaround_ :: ()
locations :: Maybe (ValueList Text)
restrictionType :: Value Text
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::CloudFront::Distribution.GeoRestriction",
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
"RestrictionType" 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
restrictionType]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [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..=) Key
"Locations" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
locations]))}
instance JSON.ToJSON GeoRestrictionProperty where
toJSON :: GeoRestrictionProperty -> Value
toJSON GeoRestrictionProperty {Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: GeoRestrictionProperty -> ()
locations :: GeoRestrictionProperty -> Maybe (ValueList Text)
restrictionType :: GeoRestrictionProperty -> Value Text
haddock_workaround_ :: ()
locations :: Maybe (ValueList Text)
restrictionType :: 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
"RestrictionType" 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
restrictionType]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [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..=) Key
"Locations" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
locations])))
instance Property "Locations" GeoRestrictionProperty where
type PropertyType "Locations" GeoRestrictionProperty = ValueList Prelude.Text
set :: PropertyType "Locations" GeoRestrictionProperty
-> GeoRestrictionProperty -> GeoRestrictionProperty
set PropertyType "Locations" GeoRestrictionProperty
newValue GeoRestrictionProperty {Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: GeoRestrictionProperty -> ()
locations :: GeoRestrictionProperty -> Maybe (ValueList Text)
restrictionType :: GeoRestrictionProperty -> Value Text
haddock_workaround_ :: ()
locations :: Maybe (ValueList Text)
restrictionType :: Value Text
..}
= GeoRestrictionProperty {locations :: Maybe (ValueList Text)
locations = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Locations" GeoRestrictionProperty
ValueList Text
newValue, ()
Value Text
haddock_workaround_ :: ()
restrictionType :: Value Text
haddock_workaround_ :: ()
restrictionType :: Value Text
..}
instance Property "RestrictionType" GeoRestrictionProperty where
type PropertyType "RestrictionType" GeoRestrictionProperty = Value Prelude.Text
set :: PropertyType "RestrictionType" GeoRestrictionProperty
-> GeoRestrictionProperty -> GeoRestrictionProperty
set PropertyType "RestrictionType" GeoRestrictionProperty
newValue GeoRestrictionProperty {Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: GeoRestrictionProperty -> ()
locations :: GeoRestrictionProperty -> Maybe (ValueList Text)
restrictionType :: GeoRestrictionProperty -> Value Text
haddock_workaround_ :: ()
locations :: Maybe (ValueList Text)
restrictionType :: Value Text
..}
= GeoRestrictionProperty {restrictionType :: Value Text
restrictionType = PropertyType "RestrictionType" GeoRestrictionProperty
Value Text
newValue, Maybe (ValueList Text)
()
haddock_workaround_ :: ()
locations :: Maybe (ValueList Text)
haddock_workaround_ :: ()
locations :: Maybe (ValueList Text)
..}