{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.APIGateway.Types.ApiKey
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.APIGateway.Types.ApiKey where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A resource that can be distributed to callers for executing Method
-- resources that require an API key. API keys can be mapped to any Stage
-- on any RestApi, which indicates that the callers with the API key can
-- make requests to that stage.
--
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-api-keys.html Use API Keys>
--
-- /See:/ 'newApiKey' smart constructor.
data ApiKey = ApiKey'
  { -- | Specifies whether the API Key can be used by callers.
    ApiKey -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The value of the API Key.
    ApiKey -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
    -- | An AWS Marketplace customer identifier , when integrating with the AWS
    -- SaaS Marketplace.
    ApiKey -> Maybe Text
customerId :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the API Key was created.
    ApiKey -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The name of the API Key.
    ApiKey -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the API Key.
    ApiKey -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | A list of Stage resources that are associated with the ApiKey resource.
    ApiKey -> Maybe [Text]
stageKeys :: Prelude.Maybe [Prelude.Text],
    -- | The timestamp when the API Key was last updated.
    ApiKey -> Maybe POSIX
lastUpdatedDate :: Prelude.Maybe Core.POSIX,
    -- | The description of the API Key.
    ApiKey -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The collection of tags. Each tag element is associated with a given
    -- resource.
    ApiKey -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text 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)

-- |
-- Create a value of 'ApiKey' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'enabled', 'apiKey_enabled' - Specifies whether the API Key can be used by callers.
--
-- 'value', 'apiKey_value' - The value of the API Key.
--
-- 'customerId', 'apiKey_customerId' - An AWS Marketplace customer identifier , when integrating with the AWS
-- SaaS Marketplace.
--
-- 'createdDate', 'apiKey_createdDate' - The timestamp when the API Key was created.
--
-- 'name', 'apiKey_name' - The name of the API Key.
--
-- 'id', 'apiKey_id' - The identifier of the API Key.
--
-- 'stageKeys', 'apiKey_stageKeys' - A list of Stage resources that are associated with the ApiKey resource.
--
-- 'lastUpdatedDate', 'apiKey_lastUpdatedDate' - The timestamp when the API Key was last updated.
--
-- 'description', 'apiKey_description' - The description of the API Key.
--
-- 'tags', 'apiKey_tags' - The collection of tags. Each tag element is associated with a given
-- resource.
newApiKey ::
  ApiKey
newApiKey :: ApiKey
newApiKey =
  ApiKey' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ApiKey
ApiKey'
    { $sel:enabled:ApiKey' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:value:ApiKey' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customerId:ApiKey' :: Maybe Text
customerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:ApiKey' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ApiKey' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ApiKey' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stageKeys:ApiKey' :: Maybe [Text]
stageKeys = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDate:ApiKey' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ApiKey' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ApiKey' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies whether the API Key can be used by callers.
apiKey_enabled :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Bool)
apiKey_enabled :: (Maybe Bool -> f (Maybe Bool)) -> ApiKey -> f ApiKey
apiKey_enabled = (ApiKey -> Maybe Bool)
-> (ApiKey -> Maybe Bool -> ApiKey)
-> Lens ApiKey ApiKey (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiKey' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ApiKey' :: ApiKey -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: ApiKey
s@ApiKey' {} Maybe Bool
a -> ApiKey
s {$sel:enabled:ApiKey' :: Maybe Bool
enabled = Maybe Bool
a} :: ApiKey)

-- | The value of the API Key.
apiKey_value :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Text)
apiKey_value :: (Maybe Text -> f (Maybe Text)) -> ApiKey -> f ApiKey
apiKey_value = (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
value :: Maybe Text
$sel:value:ApiKey' :: ApiKey -> Maybe Text
value} -> Maybe Text
value) (\s :: ApiKey
s@ApiKey' {} Maybe Text
a -> ApiKey
s {$sel:value:ApiKey' :: Maybe Text
value = Maybe Text
a} :: ApiKey)

-- | An AWS Marketplace customer identifier , when integrating with the AWS
-- SaaS Marketplace.
apiKey_customerId :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Text)
apiKey_customerId :: (Maybe Text -> f (Maybe Text)) -> ApiKey -> f ApiKey
apiKey_customerId = (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
customerId :: Maybe Text
$sel:customerId:ApiKey' :: ApiKey -> Maybe Text
customerId} -> Maybe Text
customerId) (\s :: ApiKey
s@ApiKey' {} Maybe Text
a -> ApiKey
s {$sel:customerId:ApiKey' :: Maybe Text
customerId = Maybe Text
a} :: ApiKey)

-- | The timestamp when the API Key was created.
apiKey_createdDate :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.UTCTime)
apiKey_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ApiKey -> f ApiKey
apiKey_createdDate = (ApiKey -> Maybe POSIX)
-> (ApiKey -> Maybe POSIX -> ApiKey)
-> Lens ApiKey ApiKey (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiKey' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:ApiKey' :: ApiKey -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: ApiKey
s@ApiKey' {} Maybe POSIX
a -> ApiKey
s {$sel:createdDate:ApiKey' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: ApiKey) ((Maybe POSIX -> f (Maybe POSIX)) -> ApiKey -> f ApiKey)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ApiKey
-> f ApiKey
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the API Key.
apiKey_name :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.Text)
apiKey_name :: (Maybe Text -> f (Maybe Text)) -> ApiKey -> f ApiKey
apiKey_name = (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
name :: Maybe Text
$sel:name:ApiKey' :: ApiKey -> Maybe Text
name} -> Maybe Text
name) (\s :: ApiKey
s@ApiKey' {} Maybe Text
a -> ApiKey
s {$sel:name:ApiKey' :: Maybe Text
name = Maybe Text
a} :: ApiKey)

-- | The identifier of the API Key.
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)

-- | A list of Stage resources that are associated with the ApiKey resource.
apiKey_stageKeys :: Lens.Lens' ApiKey (Prelude.Maybe [Prelude.Text])
apiKey_stageKeys :: (Maybe [Text] -> f (Maybe [Text])) -> ApiKey -> f ApiKey
apiKey_stageKeys = (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]
stageKeys :: Maybe [Text]
$sel:stageKeys:ApiKey' :: ApiKey -> Maybe [Text]
stageKeys} -> Maybe [Text]
stageKeys) (\s :: ApiKey
s@ApiKey' {} Maybe [Text]
a -> ApiKey
s {$sel:stageKeys:ApiKey' :: Maybe [Text]
stageKeys = Maybe [Text]
a} :: ApiKey) ((Maybe [Text] -> f (Maybe [Text])) -> ApiKey -> f ApiKey)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ApiKey
-> f ApiKey
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The timestamp when the API Key was last updated.
apiKey_lastUpdatedDate :: Lens.Lens' ApiKey (Prelude.Maybe Prelude.UTCTime)
apiKey_lastUpdatedDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ApiKey -> f ApiKey
apiKey_lastUpdatedDate = (ApiKey -> Maybe POSIX)
-> (ApiKey -> Maybe POSIX -> ApiKey)
-> Lens ApiKey ApiKey (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiKey' {Maybe POSIX
lastUpdatedDate :: Maybe POSIX
$sel:lastUpdatedDate:ApiKey' :: ApiKey -> Maybe POSIX
lastUpdatedDate} -> Maybe POSIX
lastUpdatedDate) (\s :: ApiKey
s@ApiKey' {} Maybe POSIX
a -> ApiKey
s {$sel:lastUpdatedDate:ApiKey' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
a} :: ApiKey) ((Maybe POSIX -> f (Maybe POSIX)) -> ApiKey -> f ApiKey)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ApiKey
-> f ApiKey
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The description of the API Key.
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)

-- | The collection of tags. Each tag element is associated with a given
-- resource.
apiKey_tags :: Lens.Lens' ApiKey (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
apiKey_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ApiKey -> f ApiKey
apiKey_tags = (ApiKey -> Maybe (HashMap Text Text))
-> (ApiKey -> Maybe (HashMap Text Text) -> ApiKey)
-> Lens
     ApiKey
     ApiKey
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiKey' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ApiKey' :: ApiKey -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ApiKey
s@ApiKey' {} Maybe (HashMap Text Text)
a -> ApiKey
s {$sel:tags:ApiKey' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ApiKey) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ApiKey -> f ApiKey)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ApiKey
-> f ApiKey
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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 Bool
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ApiKey
ApiKey'
            (Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> ApiKey)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> ApiKey)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"enabled")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ApiKey)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text 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
"value")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ApiKey)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text 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
"customerId")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ApiKey)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> ApiKey)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdDate")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ApiKey)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text 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
"name")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ApiKey)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text 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]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ApiKey)
-> Parser (Maybe [Text])
-> Parser
     (Maybe POSIX -> Maybe Text -> Maybe (HashMap Text Text) -> ApiKey)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stageKeys" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe POSIX -> Maybe Text -> Maybe (HashMap Text Text) -> ApiKey)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe (HashMap Text Text) -> ApiKey)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdatedDate")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> ApiKey)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text 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
"description")
            Parser (Maybe (HashMap Text Text) -> ApiKey)
-> Parser (Maybe (HashMap Text Text)) -> Parser ApiKey
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ApiKey

instance Prelude.NFData ApiKey