module Stratosphere.Location.APIKey.ApiKeyRestrictionsProperty (
        ApiKeyRestrictionsProperty(..), mkApiKeyRestrictionsProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ApiKeyRestrictionsProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-location-apikey-apikeyrestrictions.html>
    ApiKeyRestrictionsProperty {ApiKeyRestrictionsProperty -> ()
haddock_workaround_ :: (),
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-location-apikey-apikeyrestrictions.html#cfn-location-apikey-apikeyrestrictions-allowactions>
                                ApiKeyRestrictionsProperty -> ValueList Text
allowActions :: (ValueList Prelude.Text),
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-location-apikey-apikeyrestrictions.html#cfn-location-apikey-apikeyrestrictions-allowreferers>
                                ApiKeyRestrictionsProperty -> Maybe (ValueList Text)
allowReferers :: (Prelude.Maybe (ValueList Prelude.Text)),
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-location-apikey-apikeyrestrictions.html#cfn-location-apikey-apikeyrestrictions-allowresources>
                                ApiKeyRestrictionsProperty -> ValueList Text
allowResources :: (ValueList Prelude.Text)}
  deriving stock (ApiKeyRestrictionsProperty -> ApiKeyRestrictionsProperty -> Bool
(ApiKeyRestrictionsProperty -> ApiKeyRestrictionsProperty -> Bool)
-> (ApiKeyRestrictionsProperty
    -> ApiKeyRestrictionsProperty -> Bool)
-> Eq ApiKeyRestrictionsProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ApiKeyRestrictionsProperty -> ApiKeyRestrictionsProperty -> Bool
== :: ApiKeyRestrictionsProperty -> ApiKeyRestrictionsProperty -> Bool
$c/= :: ApiKeyRestrictionsProperty -> ApiKeyRestrictionsProperty -> Bool
/= :: ApiKeyRestrictionsProperty -> ApiKeyRestrictionsProperty -> Bool
Prelude.Eq, Int -> ApiKeyRestrictionsProperty -> ShowS
[ApiKeyRestrictionsProperty] -> ShowS
ApiKeyRestrictionsProperty -> String
(Int -> ApiKeyRestrictionsProperty -> ShowS)
-> (ApiKeyRestrictionsProperty -> String)
-> ([ApiKeyRestrictionsProperty] -> ShowS)
-> Show ApiKeyRestrictionsProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ApiKeyRestrictionsProperty -> ShowS
showsPrec :: Int -> ApiKeyRestrictionsProperty -> ShowS
$cshow :: ApiKeyRestrictionsProperty -> String
show :: ApiKeyRestrictionsProperty -> String
$cshowList :: [ApiKeyRestrictionsProperty] -> ShowS
showList :: [ApiKeyRestrictionsProperty] -> ShowS
Prelude.Show)
mkApiKeyRestrictionsProperty ::
  ValueList Prelude.Text
  -> ValueList Prelude.Text -> ApiKeyRestrictionsProperty
mkApiKeyRestrictionsProperty :: ValueList Text -> ValueList Text -> ApiKeyRestrictionsProperty
mkApiKeyRestrictionsProperty ValueList Text
allowActions ValueList Text
allowResources
  = ApiKeyRestrictionsProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), allowActions :: ValueList Text
allowActions = ValueList Text
allowActions,
       allowResources :: ValueList Text
allowResources = ValueList Text
allowResources, allowReferers :: Maybe (ValueList Text)
allowReferers = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ApiKeyRestrictionsProperty where
  toResourceProperties :: ApiKeyRestrictionsProperty -> ResourceProperties
toResourceProperties ApiKeyRestrictionsProperty {Maybe (ValueList Text)
()
ValueList Text
haddock_workaround_ :: ApiKeyRestrictionsProperty -> ()
allowActions :: ApiKeyRestrictionsProperty -> ValueList Text
allowReferers :: ApiKeyRestrictionsProperty -> Maybe (ValueList Text)
allowResources :: ApiKeyRestrictionsProperty -> ValueList Text
haddock_workaround_ :: ()
allowActions :: ValueList Text
allowReferers :: Maybe (ValueList Text)
allowResources :: ValueList Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Location::APIKey.ApiKeyRestrictions",
         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
"AllowActions" 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
allowActions,
                            Key
"AllowResources" 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
allowResources]
                           ([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
"AllowReferers" (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)
allowReferers]))}
instance JSON.ToJSON ApiKeyRestrictionsProperty where
  toJSON :: ApiKeyRestrictionsProperty -> Value
toJSON ApiKeyRestrictionsProperty {Maybe (ValueList Text)
()
ValueList Text
haddock_workaround_ :: ApiKeyRestrictionsProperty -> ()
allowActions :: ApiKeyRestrictionsProperty -> ValueList Text
allowReferers :: ApiKeyRestrictionsProperty -> Maybe (ValueList Text)
allowResources :: ApiKeyRestrictionsProperty -> ValueList Text
haddock_workaround_ :: ()
allowActions :: ValueList Text
allowReferers :: Maybe (ValueList Text)
allowResources :: ValueList 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
"AllowActions" 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
allowActions,
               Key
"AllowResources" 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
allowResources]
              ([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
"AllowReferers" (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)
allowReferers])))
instance Property "AllowActions" ApiKeyRestrictionsProperty where
  type PropertyType "AllowActions" ApiKeyRestrictionsProperty = ValueList Prelude.Text
  set :: PropertyType "AllowActions" ApiKeyRestrictionsProperty
-> ApiKeyRestrictionsProperty -> ApiKeyRestrictionsProperty
set PropertyType "AllowActions" ApiKeyRestrictionsProperty
newValue ApiKeyRestrictionsProperty {Maybe (ValueList Text)
()
ValueList Text
haddock_workaround_ :: ApiKeyRestrictionsProperty -> ()
allowActions :: ApiKeyRestrictionsProperty -> ValueList Text
allowReferers :: ApiKeyRestrictionsProperty -> Maybe (ValueList Text)
allowResources :: ApiKeyRestrictionsProperty -> ValueList Text
haddock_workaround_ :: ()
allowActions :: ValueList Text
allowReferers :: Maybe (ValueList Text)
allowResources :: ValueList Text
..}
    = ApiKeyRestrictionsProperty {allowActions :: ValueList Text
allowActions = PropertyType "AllowActions" ApiKeyRestrictionsProperty
ValueList Text
newValue, Maybe (ValueList Text)
()
ValueList Text
haddock_workaround_ :: ()
allowReferers :: Maybe (ValueList Text)
allowResources :: ValueList Text
haddock_workaround_ :: ()
allowReferers :: Maybe (ValueList Text)
allowResources :: ValueList Text
..}
instance Property "AllowReferers" ApiKeyRestrictionsProperty where
  type PropertyType "AllowReferers" ApiKeyRestrictionsProperty = ValueList Prelude.Text
  set :: PropertyType "AllowReferers" ApiKeyRestrictionsProperty
-> ApiKeyRestrictionsProperty -> ApiKeyRestrictionsProperty
set PropertyType "AllowReferers" ApiKeyRestrictionsProperty
newValue ApiKeyRestrictionsProperty {Maybe (ValueList Text)
()
ValueList Text
haddock_workaround_ :: ApiKeyRestrictionsProperty -> ()
allowActions :: ApiKeyRestrictionsProperty -> ValueList Text
allowReferers :: ApiKeyRestrictionsProperty -> Maybe (ValueList Text)
allowResources :: ApiKeyRestrictionsProperty -> ValueList Text
haddock_workaround_ :: ()
allowActions :: ValueList Text
allowReferers :: Maybe (ValueList Text)
allowResources :: ValueList Text
..}
    = ApiKeyRestrictionsProperty
        {allowReferers :: Maybe (ValueList Text)
allowReferers = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AllowReferers" ApiKeyRestrictionsProperty
ValueList Text
newValue, ()
ValueList Text
haddock_workaround_ :: ()
allowActions :: ValueList Text
allowResources :: ValueList Text
haddock_workaround_ :: ()
allowActions :: ValueList Text
allowResources :: ValueList Text
..}
instance Property "AllowResources" ApiKeyRestrictionsProperty where
  type PropertyType "AllowResources" ApiKeyRestrictionsProperty = ValueList Prelude.Text
  set :: PropertyType "AllowResources" ApiKeyRestrictionsProperty
-> ApiKeyRestrictionsProperty -> ApiKeyRestrictionsProperty
set PropertyType "AllowResources" ApiKeyRestrictionsProperty
newValue ApiKeyRestrictionsProperty {Maybe (ValueList Text)
()
ValueList Text
haddock_workaround_ :: ApiKeyRestrictionsProperty -> ()
allowActions :: ApiKeyRestrictionsProperty -> ValueList Text
allowReferers :: ApiKeyRestrictionsProperty -> Maybe (ValueList Text)
allowResources :: ApiKeyRestrictionsProperty -> ValueList Text
haddock_workaround_ :: ()
allowActions :: ValueList Text
allowReferers :: Maybe (ValueList Text)
allowResources :: ValueList Text
..}
    = ApiKeyRestrictionsProperty {allowResources :: ValueList Text
allowResources = PropertyType "AllowResources" ApiKeyRestrictionsProperty
ValueList Text
newValue, Maybe (ValueList Text)
()
ValueList Text
haddock_workaround_ :: ()
allowActions :: ValueList Text
allowReferers :: Maybe (ValueList Text)
haddock_workaround_ :: ()
allowActions :: ValueList Text
allowReferers :: Maybe (ValueList Text)
..}