{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.AppSync.Types.ApiKey where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ApiKey = ApiKey'
{
ApiKey -> Maybe Integer
deletes :: Prelude.Maybe Prelude.Integer,
ApiKey -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ApiKey -> Maybe Integer
expires :: Prelude.Maybe Prelude.Integer,
ApiKey -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (ApiKey -> ApiKey -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApiKey -> ApiKey -> Bool
$c/= :: ApiKey -> ApiKey -> Bool
== :: ApiKey -> ApiKey -> Bool
$c== :: ApiKey -> ApiKey -> Bool
Prelude.Eq, ReadPrec [ApiKey]
ReadPrec ApiKey
Int -> ReadS ApiKey
ReadS [ApiKey]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApiKey]
$creadListPrec :: ReadPrec [ApiKey]
readPrec :: ReadPrec ApiKey
$creadPrec :: ReadPrec ApiKey
readList :: ReadS [ApiKey]
$creadList :: ReadS [ApiKey]
readsPrec :: Int -> ReadS ApiKey
$creadsPrec :: Int -> ReadS ApiKey
Prelude.Read, Int -> ApiKey -> ShowS
[ApiKey] -> ShowS
ApiKey -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApiKey] -> ShowS
$cshowList :: [ApiKey] -> ShowS
show :: ApiKey -> String
$cshow :: ApiKey -> String
showsPrec :: Int -> ApiKey -> ShowS
$cshowsPrec :: Int -> ApiKey -> ShowS
Prelude.Show, forall x. Rep ApiKey x -> ApiKey
forall x. ApiKey -> Rep ApiKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApiKey x -> ApiKey
$cfrom :: forall x. ApiKey -> Rep ApiKey x
Prelude.Generic)
newApiKey ::
ApiKey
newApiKey :: ApiKey
newApiKey =
ApiKey'
{ $sel:deletes:ApiKey' :: Maybe Integer
deletes = forall a. Maybe a
Prelude.Nothing,
$sel:description:ApiKey' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:expires:ApiKey' :: Maybe Integer
expires = forall a. Maybe a
Prelude.Nothing,
$sel:id:ApiKey' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing
}
apiKey_deletes :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Integer)
apiKey_deletes :: Lens' ApiKey (Maybe Integer)
apiKey_deletes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiKey' {Maybe Integer
deletes :: Maybe Integer
$sel:deletes:ApiKey' :: ApiKey -> Maybe Integer
deletes} -> Maybe Integer
deletes) (\s :: ApiKey
s@ApiKey' {} Maybe Integer
a -> ApiKey
s {$sel:deletes:ApiKey' :: Maybe Integer
deletes = Maybe Integer
a} :: ApiKey)
apiKey_description :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Text)
apiKey_description :: Lens' ApiKey (Maybe Text)
apiKey_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiKey' {Maybe Text
description :: Maybe Text
$sel:description:ApiKey' :: ApiKey -> Maybe Text
description} -> Maybe Text
description) (\s :: ApiKey
s@ApiKey' {} Maybe Text
a -> ApiKey
s {$sel:description:ApiKey' :: Maybe Text
description = Maybe Text
a} :: ApiKey)
apiKey_expires :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Integer)
apiKey_expires :: Lens' ApiKey (Maybe Integer)
apiKey_expires = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiKey' {Maybe Integer
expires :: Maybe Integer
$sel:expires:ApiKey' :: ApiKey -> Maybe Integer
expires} -> Maybe Integer
expires) (\s :: ApiKey
s@ApiKey' {} Maybe Integer
a -> ApiKey
s {$sel:expires:ApiKey' :: Maybe Integer
expires = Maybe Integer
a} :: ApiKey)
apiKey_id :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Text)
apiKey_id :: Lens' ApiKey (Maybe Text)
apiKey_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiKey' {Maybe Text
id :: Maybe Text
$sel:id:ApiKey' :: ApiKey -> Maybe Text
id} -> Maybe Text
id) (\s :: ApiKey
s@ApiKey' {} Maybe Text
a -> ApiKey
s {$sel:id:ApiKey' :: Maybe Text
id = Maybe Text
a} :: ApiKey)
instance Data.FromJSON ApiKey where
parseJSON :: Value -> Parser ApiKey
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ApiKey"
( \Object
x ->
Maybe Integer
-> Maybe Text -> Maybe Integer -> Maybe Text -> ApiKey
ApiKey'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"deletes")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"expires")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"id")
)
instance Prelude.Hashable ApiKey where
hashWithSalt :: Int -> ApiKey -> Int
hashWithSalt Int
_salt ApiKey' {Maybe Integer
Maybe Text
id :: Maybe Text
expires :: Maybe Integer
description :: Maybe Text
deletes :: Maybe Integer
$sel:id:ApiKey' :: ApiKey -> Maybe Text
$sel:expires:ApiKey' :: ApiKey -> Maybe Integer
$sel:description:ApiKey' :: ApiKey -> Maybe Text
$sel:deletes:ApiKey' :: ApiKey -> Maybe Integer
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
deletes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
expires
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
instance Prelude.NFData ApiKey where
rnf :: ApiKey -> ()
rnf ApiKey' {Maybe Integer
Maybe Text
id :: Maybe Text
expires :: Maybe Integer
description :: Maybe Text
deletes :: Maybe Integer
$sel:id:ApiKey' :: ApiKey -> Maybe Text
$sel:expires:ApiKey' :: ApiKey -> Maybe Integer
$sel:description:ApiKey' :: ApiKey -> Maybe Text
$sel:deletes:ApiKey' :: ApiKey -> Maybe Integer
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
deletes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
expires
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id