module Stratosphere.AppSync.ApiKey (
        ApiKey(..), mkApiKey
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ApiKey
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apikey.html>
    ApiKey {ApiKey -> ()
haddock_workaround_ :: (),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apikey.html#cfn-appsync-apikey-apiid>
            ApiKey -> Value Text
apiId :: (Value Prelude.Text),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apikey.html#cfn-appsync-apikey-apikeyid>
            ApiKey -> Maybe (Value Text)
apiKeyId :: (Prelude.Maybe (Value Prelude.Text)),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apikey.html#cfn-appsync-apikey-description>
            ApiKey -> Maybe (Value Text)
description :: (Prelude.Maybe (Value Prelude.Text)),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apikey.html#cfn-appsync-apikey-expires>
            ApiKey -> Maybe (Value Double)
expires :: (Prelude.Maybe (Value Prelude.Double))}
  deriving stock (ApiKey -> ApiKey -> Bool
(ApiKey -> ApiKey -> Bool)
-> (ApiKey -> ApiKey -> Bool) -> Eq ApiKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ApiKey -> ApiKey -> Bool
== :: ApiKey -> ApiKey -> Bool
$c/= :: ApiKey -> ApiKey -> Bool
/= :: ApiKey -> ApiKey -> Bool
Prelude.Eq, Int -> ApiKey -> ShowS
[ApiKey] -> ShowS
ApiKey -> String
(Int -> ApiKey -> ShowS)
-> (ApiKey -> String) -> ([ApiKey] -> ShowS) -> Show ApiKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ApiKey -> ShowS
showsPrec :: Int -> ApiKey -> ShowS
$cshow :: ApiKey -> String
show :: ApiKey -> String
$cshowList :: [ApiKey] -> ShowS
showList :: [ApiKey] -> ShowS
Prelude.Show)
mkApiKey :: Value Prelude.Text -> ApiKey
mkApiKey :: Value Text -> ApiKey
mkApiKey Value Text
apiId
  = ApiKey
      {haddock_workaround_ :: ()
haddock_workaround_ = (), apiId :: Value Text
apiId = Value Text
apiId,
       apiKeyId :: Maybe (Value Text)
apiKeyId = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, description :: Maybe (Value Text)
description = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       expires :: Maybe (Value Double)
expires = Maybe (Value Double)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ApiKey where
  toResourceProperties :: ApiKey -> ResourceProperties
toResourceProperties ApiKey {Maybe (Value Double)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ApiKey -> ()
apiId :: ApiKey -> Value Text
apiKeyId :: ApiKey -> Maybe (Value Text)
description :: ApiKey -> Maybe (Value Text)
expires :: ApiKey -> Maybe (Value Double)
haddock_workaround_ :: ()
apiId :: Value Text
apiKeyId :: Maybe (Value Text)
description :: Maybe (Value Text)
expires :: Maybe (Value Double)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::AppSync::ApiKey", 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
"ApiId" 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
apiId]
                           ([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
"ApiKeyId" (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)
apiKeyId,
                               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 Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Expires" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
expires]))}
instance JSON.ToJSON ApiKey where
  toJSON :: ApiKey -> Value
toJSON ApiKey {Maybe (Value Double)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ApiKey -> ()
apiId :: ApiKey -> Value Text
apiKeyId :: ApiKey -> Maybe (Value Text)
description :: ApiKey -> Maybe (Value Text)
expires :: ApiKey -> Maybe (Value Double)
haddock_workaround_ :: ()
apiId :: Value Text
apiKeyId :: Maybe (Value Text)
description :: Maybe (Value Text)
expires :: Maybe (Value Double)
..}
    = [(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
"ApiId" 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
apiId]
              ([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
"ApiKeyId" (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)
apiKeyId,
                  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 Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Expires" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
expires])))
instance Property "ApiId" ApiKey where
  type PropertyType "ApiId" ApiKey = Value Prelude.Text
  set :: PropertyType "ApiId" ApiKey -> ApiKey -> ApiKey
set PropertyType "ApiId" ApiKey
newValue ApiKey {Maybe (Value Double)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ApiKey -> ()
apiId :: ApiKey -> Value Text
apiKeyId :: ApiKey -> Maybe (Value Text)
description :: ApiKey -> Maybe (Value Text)
expires :: ApiKey -> Maybe (Value Double)
haddock_workaround_ :: ()
apiId :: Value Text
apiKeyId :: Maybe (Value Text)
description :: Maybe (Value Text)
expires :: Maybe (Value Double)
..} = ApiKey {apiId :: Value Text
apiId = PropertyType "ApiId" ApiKey
Value Text
newValue, Maybe (Value Double)
Maybe (Value Text)
()
haddock_workaround_ :: ()
apiKeyId :: Maybe (Value Text)
description :: Maybe (Value Text)
expires :: Maybe (Value Double)
haddock_workaround_ :: ()
apiKeyId :: Maybe (Value Text)
description :: Maybe (Value Text)
expires :: Maybe (Value Double)
..}
instance Property "ApiKeyId" ApiKey where
  type PropertyType "ApiKeyId" ApiKey = Value Prelude.Text
  set :: PropertyType "ApiKeyId" ApiKey -> ApiKey -> ApiKey
set PropertyType "ApiKeyId" ApiKey
newValue ApiKey {Maybe (Value Double)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ApiKey -> ()
apiId :: ApiKey -> Value Text
apiKeyId :: ApiKey -> Maybe (Value Text)
description :: ApiKey -> Maybe (Value Text)
expires :: ApiKey -> Maybe (Value Double)
haddock_workaround_ :: ()
apiId :: Value Text
apiKeyId :: Maybe (Value Text)
description :: Maybe (Value Text)
expires :: Maybe (Value Double)
..}
    = ApiKey {apiKeyId :: Maybe (Value Text)
apiKeyId = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ApiKeyId" ApiKey
Value Text
newValue, Maybe (Value Double)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
apiId :: Value Text
description :: Maybe (Value Text)
expires :: Maybe (Value Double)
haddock_workaround_ :: ()
apiId :: Value Text
description :: Maybe (Value Text)
expires :: Maybe (Value Double)
..}
instance Property "Description" ApiKey where
  type PropertyType "Description" ApiKey = Value Prelude.Text
  set :: PropertyType "Description" ApiKey -> ApiKey -> ApiKey
set PropertyType "Description" ApiKey
newValue ApiKey {Maybe (Value Double)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ApiKey -> ()
apiId :: ApiKey -> Value Text
apiKeyId :: ApiKey -> Maybe (Value Text)
description :: ApiKey -> Maybe (Value Text)
expires :: ApiKey -> Maybe (Value Double)
haddock_workaround_ :: ()
apiId :: Value Text
apiKeyId :: Maybe (Value Text)
description :: Maybe (Value Text)
expires :: Maybe (Value Double)
..}
    = ApiKey {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" ApiKey
Value Text
newValue, Maybe (Value Double)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
apiId :: Value Text
apiKeyId :: Maybe (Value Text)
expires :: Maybe (Value Double)
haddock_workaround_ :: ()
apiId :: Value Text
apiKeyId :: Maybe (Value Text)
expires :: Maybe (Value Double)
..}
instance Property "Expires" ApiKey where
  type PropertyType "Expires" ApiKey = Value Prelude.Double
  set :: PropertyType "Expires" ApiKey -> ApiKey -> ApiKey
set PropertyType "Expires" ApiKey
newValue ApiKey {Maybe (Value Double)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ApiKey -> ()
apiId :: ApiKey -> Value Text
apiKeyId :: ApiKey -> Maybe (Value Text)
description :: ApiKey -> Maybe (Value Text)
expires :: ApiKey -> Maybe (Value Double)
haddock_workaround_ :: ()
apiId :: Value Text
apiKeyId :: Maybe (Value Text)
description :: Maybe (Value Text)
expires :: Maybe (Value Double)
..}
    = ApiKey {expires :: Maybe (Value Double)
expires = Value Double -> Maybe (Value Double)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Expires" ApiKey
Value Double
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
apiId :: Value Text
apiKeyId :: Maybe (Value Text)
description :: Maybe (Value Text)
haddock_workaround_ :: ()
apiId :: Value Text
apiKeyId :: Maybe (Value Text)
description :: Maybe (Value Text)
..}