{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ApiKey = ApiKey'
{
ApiKey -> Maybe Integer
expires :: Prelude.Maybe Prelude.Integer,
ApiKey -> Maybe Integer
deletes :: Prelude.Maybe Prelude.Integer,
ApiKey -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
ApiKey -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (ApiKey -> ApiKey -> Bool
(ApiKey -> ApiKey -> Bool)
-> (ApiKey -> ApiKey -> Bool) -> Eq ApiKey
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]
(Int -> ReadS ApiKey)
-> ReadS [ApiKey]
-> ReadPrec ApiKey
-> ReadPrec [ApiKey]
-> Read 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
(Int -> ApiKey -> ShowS)
-> (ApiKey -> String) -> ([ApiKey] -> ShowS) -> Show ApiKey
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. ApiKey -> Rep ApiKey x)
-> (forall x. Rep ApiKey x -> ApiKey) -> Generic ApiKey
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' :: Maybe Integer
-> Maybe Integer -> Maybe Text -> Maybe Text -> ApiKey
ApiKey'
{ $sel:expires:ApiKey' :: Maybe Integer
expires = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:deletes:ApiKey' :: Maybe Integer
deletes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:id:ApiKey' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:ApiKey' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
apiKey_expires :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Integer)
apiKey_expires :: (Maybe Integer -> f (Maybe Integer)) -> ApiKey -> f ApiKey
apiKey_expires = (ApiKey -> Maybe Integer)
-> (ApiKey -> Maybe Integer -> ApiKey)
-> Lens ApiKey ApiKey (Maybe Integer) (Maybe Integer)
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_deletes :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Integer)
apiKey_deletes :: (Maybe Integer -> f (Maybe Integer)) -> ApiKey -> f ApiKey
apiKey_deletes = (ApiKey -> Maybe Integer)
-> (ApiKey -> Maybe Integer -> ApiKey)
-> Lens ApiKey ApiKey (Maybe Integer) (Maybe Integer)
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_id :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Text)
apiKey_id :: (Maybe Text -> f (Maybe Text)) -> ApiKey -> f ApiKey
apiKey_id = (ApiKey -> Maybe Text)
-> (ApiKey -> Maybe Text -> ApiKey)
-> Lens ApiKey ApiKey (Maybe Text) (Maybe Text)
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)
apiKey_description :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Text)
apiKey_description :: (Maybe Text -> f (Maybe Text)) -> ApiKey -> f ApiKey
apiKey_description = (ApiKey -> Maybe Text)
-> (ApiKey -> Maybe Text -> ApiKey)
-> Lens ApiKey ApiKey (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON ApiKey where
parseJSON :: Value -> Parser ApiKey
parseJSON =
String -> (Object -> Parser ApiKey) -> Value -> Parser ApiKey
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ApiKey"
( \Object
x ->
Maybe Integer
-> Maybe Integer -> Maybe Text -> Maybe Text -> ApiKey
ApiKey'
(Maybe Integer
-> Maybe Integer -> Maybe Text -> Maybe Text -> ApiKey)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> Maybe Text -> Maybe Text -> ApiKey)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"expires")
Parser (Maybe Integer -> Maybe Text -> Maybe Text -> ApiKey)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> Maybe Text -> ApiKey)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deletes")
Parser (Maybe Text -> Maybe Text -> ApiKey)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ApiKey)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"id")
Parser (Maybe Text -> ApiKey)
-> Parser (Maybe Text) -> Parser ApiKey
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
)
instance Prelude.Hashable ApiKey
instance Prelude.NFData ApiKey